X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=common.go;h=a20c2439ced190e6bf3e325888a9f4c86080ce1f;hb=8f03605cd965568241c7475b3d662adb025c6cf5;hp=f8d8a45fe31238a397bcc65c41737c3552193397;hpb=1df2854b39c97f92d8fc8a77a6f763e5e8752009;p=meta4ra.git diff --git a/common.go b/common.go index f8d8a45..a20c243 100644 --- a/common.go +++ b/common.go @@ -18,59 +18,7 @@ along with this program. If not, see . // Metalink 4.0 utilities package meta4ra -import ( - "encoding/xml" - "time" -) - const ( - Generator = "meta4ra/0.2.0" + Generator = "meta4ra/0.3.0" GPGSigMediaType = "application/pgp-signature" - HashSHA256 = "sha-256" - HashSHA512 = "sha-512" - HashStreebog256 = "streebog-256" - HashStreebog512 = "streebog-512" - HashSHAKE128 = "shake128" - HashSHAKE256 = "shake256" ) - -type Metalink struct { - XMLName xml.Name `xml:"urn:ietf:params:xml:ns:metalink metalink"` - Files []File `xml:"file"` - Generator string `xml:"generator,,omitempty"` - Published time.Time `xml:"published,,omitempty"` -} - -type File struct { - XMLName xml.Name `xml:"file"` - Name string `xml:"name,attr"` - Description string `xml:"description,,omitempty"` - Hashes []Hash `xml:"hash,,omitempty"` - MetaURLs []MetaURL `xml:"metaurl,,omitempty"` - Signature *Signature `xml:"signature"` - Size uint64 `xml:"size,,omitempty"` - URLs []URL `xml:"url,,omitempty"` -} - -type URL struct { - XMLName xml.Name `xml:"url"` - URL string `xml:",chardata"` -} - -type Signature struct { - XMLName xml.Name `xml:"signature"` - MediaType string `xml:"mediatype,attr"` - Signature string `xml:",cdata"` -} - -type Hash struct { - XMLName xml.Name `xml:"hash"` - Type string `xml:"type,attr"` - Hash string `xml:",chardata"` -} - -type MetaURL struct { - XMLName xml.Name `xml:"metaurl"` - MediaType string `xml:"mediatype,attr"` - URL string `xml:",chardata"` -}