mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-05-06 22:18:28 +00:00
Enhance Package JSON representation with Key, ShortKey and FilesHash. #168
This commit is contained in:
+6
-1
@@ -213,7 +213,12 @@ func (p *Package) String() string {
|
||||
|
||||
// MarshalJSON implements json.Marshaller interface
|
||||
func (p *Package) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(p.Stanza())
|
||||
stanza := p.Stanza()
|
||||
stanza["FilesHash"] = fmt.Sprintf("%08x", p.FilesHash)
|
||||
stanza["Key"] = string(p.Key(""))
|
||||
stanza["ShortKey"] = string(p.ShortKey(""))
|
||||
|
||||
return json.Marshal(stanza)
|
||||
}
|
||||
|
||||
// GetField returns fields from package
|
||||
|
||||
Reference in New Issue
Block a user