Added Package struct
This commit is contained in:
parent
f07ba741c5
commit
65f2051a5e
1 changed files with 21 additions and 13 deletions
|
|
@ -1,6 +1,14 @@
|
||||||
package ProtoHandler
|
package ProtoHandler
|
||||||
|
|
||||||
import proto "lpm-cli/Proto/lpm/go"
|
import (
|
||||||
|
"lpm-cli/Lotus"
|
||||||
|
proto "lpm-cli/Proto/lpm/go"
|
||||||
|
)
|
||||||
|
|
||||||
|
type Package struct{
|
||||||
|
PackageMetadata PackageMetadata
|
||||||
|
Register Lotus.Registry
|
||||||
|
}
|
||||||
|
|
||||||
type PackageMetadata struct {
|
type PackageMetadata struct {
|
||||||
Publisher string
|
Publisher string
|
||||||
|
|
@ -43,16 +51,16 @@ func fillChecksums(checksum []*proto.Checksum) Checksums {
|
||||||
return checksums
|
return checksums
|
||||||
}
|
}
|
||||||
|
|
||||||
func (metadata* PackageMetadata) FillMetadata(protoData *proto.PackageMetadata) {
|
func (pkgMeta *PackageMetadata) FillMetadata(protoData *proto.PackageMetadata) {
|
||||||
metadata.Publisher = protoData.GetPublisher()
|
pkgMeta.Publisher = protoData.GetPublisher()
|
||||||
metadata.Name = protoData.GetName()
|
pkgMeta.Name = protoData.GetName()
|
||||||
metadata.Version = protoData.GetVersion()
|
pkgMeta.Version = protoData.GetVersion()
|
||||||
metadata.Description = protoData.GetDescription()
|
pkgMeta.Description = protoData.GetDescription()
|
||||||
metadata.Tags = protoData.GetTags()
|
pkgMeta.Tags = protoData.GetTags()
|
||||||
metadata.Labels = protoData.GetLabels()
|
pkgMeta.Labels = protoData.GetLabels()
|
||||||
metadata.PackageSize = protoData.GetPackageSize()
|
pkgMeta.PackageSize = protoData.GetPackageSize()
|
||||||
metadata.Checksums = fillChecksums(protoData.GetChecksums())
|
pkgMeta.Checksums = fillChecksums(protoData.GetChecksums())
|
||||||
metadata.Platform = protoData.Platform
|
pkgMeta.Platform = protoData.Platform
|
||||||
metadata.Architecture = protoData.Architecture
|
pkgMeta.Architecture = protoData.Architecture
|
||||||
metadata.Dependencies = fillDependencies(protoData.GetDependencies())
|
pkgMeta.Dependencies = fillDependencies(protoData.GetDependencies())
|
||||||
}
|
}
|
||||||
Reference in a new issue