X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=common.go;h=01bfa4f3a3f1010ad877f1365bf35dec445d69d2;hb=ec81c80180666b65ffa5c0b04b78b85d4db3d9d4;hp=3eed481d5392f092aeb56a43187ec90bbe0afb1d;hpb=1efa4b2c0439a7f041a619d99e9b18c6a4045979;p=meta4ra.git diff --git a/common.go b/common.go index 3eed481..01bfa4f 100644 --- a/common.go +++ b/common.go @@ -1,74 +1,23 @@ -/* -meta4a -- Metalink 4.0 creator -Copyright (C) 2021-2023 Sergey Matveev - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, version 3 of the License. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*/ +// meta4ra -- Metalink 4.0 utilities +// Copyright (C) 2021-2024 Sergey Matveev +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, version 3 of the License. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . // Metalink 4.0 utilities package meta4ra -import ( - "encoding/xml" - "time" -) - const ( - Generator = "meta4ra/0.2.0" - GPGSigMediaType = "application/pgp-signature" - HashSHA256 = "sha-256" - HashSHA512 = "sha-512" - HashStreebog256 = "streebog-256" - HashStreebog512 = "streebog-512" + Generator = "meta4ra/0.5.0" + SigMediaTypePGP = "application/pgp-signature" + SigMediaTypeSSH = "application/ssh-signature" ) - -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"` -}