]> Sergey Matveev's repositories - meta4ra.git/blobdiff - scheme.go
Ability to skip Published/Generator fields inclusion
[meta4ra.git] / scheme.go
index 6c37040c425c0fd9e9793e88b9b180134179c020..a1cbec378881d69424bb1cb5592112749db18eef 100644 (file)
--- a/scheme.go
+++ b/scheme.go
@@ -1,19 +1,17 @@
-/*
-meta4a -- Metalink 4.0 creator
-Copyright (C) 2021-2023 Sergey Matveev <stargrave@stargrave.org>
-
-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 <http://www.gnu.org/licenses/>.
-*/
+// meta4ra -- Metalink 4.0 utilities
+// Copyright (C) 2021-2024 Sergey Matveev <stargrave@stargrave.org>
+//
+// 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 <http://www.gnu.org/licenses/>.
 
 package meta4ra
 
@@ -23,21 +21,21 @@ import (
 )
 
 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"`
+       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"`
+       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"`
+       Size        uint64      `xml:"size,,omitempty"`
+       URLs        []URL       `xml:"url,,omitempty"`
 }
 
 type URL struct {