-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.go
134 lines (112 loc) · 4 KB
/
schema.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
package metroninfo
import "time"
var xmlHeader = []byte(`<?xml version="1.0" encoding="UTF-8"?>`)
type MetronInfo struct {
IDS IDS `xml:"IDS,omitempty"`
Publisher *Publisher `xml:"Publisher,omitempty"`
Series Series `xml:"Series"`
MangaVolume string `xml:"MangaVolume,omitempty"`
CollectionTitle string `xml:"CollectionTitle,omitempty"`
Number string `xml:"Number,omitempty"`
Stories Stories `xml:"Stories,omitempty"`
Summary string `xml:"Summary,omitempty"`
Notes string `xml:"Notes,omitempty"`
Prices Prices `xml:"Prices,omitempty"`
CoverDate *Date `xml:"CoverDate,omitempty"`
StoreDate *Date `xml:"StoreDate,omitempty"`
PageCount int `xml:"PageCount,omitempty"`
Genres Genres `xml:"Genres,omitempty"`
Tags Tags `xml:"Tags,omitempty"`
Arcs Arcs `xml:"Arcs,omitempty"`
Characters Characters `xml:"Characters,omitempty"`
Teams Teams `xml:"Teams,omitempty"`
Universes Universes `xml:"Universes,omitempty"`
Locations Locations `xml:"Locations,omitempty"`
GTIN *GTIN `xml:"GTIN,omitempty"`
AgeRating AgeRating `xml:"AgeRating,omitempty"`
Reprints Reprints `xml:"Reprints,omitempty"`
URLs URLs `xml:"URLs,omitempty"`
Credits Credits `xml:"Credits,omitempty"`
LastModified *time.Time `xml:"LastModified,omitempty"`
// Internal
//XmlnsXsd string `xml:"xmlns:xsd,attr"`
XmlNsXsi string `xml:"xmlns:xsi,attr"`
XmlXsiNoNameSpace string `xml:"xsi:noNamespaceSchemaLocation,attr"`
}
type ID struct {
Source InformationSource `xml:"source,attr,omitempty"`
Primary bool `xml:"primary,attr,omitempty"`
Value string `xml:",chardata"`
}
type Resource struct {
ID string `xml:"id,attr,omitempty"`
Value string `xml:",chardata"`
}
type Publisher struct {
ID string `xml:"id,attr,omitempty"`
Name string `xml:"Name"`
Imprint Resource `xml:"Imprint,omitempty"`
}
type AlternativeName struct {
ID string `xml:"id,attr,omitempty"`
Lang LanguageCode `xml:"lang,attr,omitempty"`
Value string `xml:",chardata"`
}
type Series struct {
ID string `xml:"id,attr,omitempty"`
Lang LanguageCode `xml:"lang,attr,omitempty"`
Name string `xml:"Name"`
SortName string `xml:"SortName,omitempty"`
Volume int `xml:"Volume,omitempty"`
Format Format `xml:"Format,omitempty"`
StartYear int `xml:"StartYear,omitempty"`
IssueCount int `xml:"IssueCount,omitempty"`
VolumeCount int `xml:"VolumeCount,omitempty"`
AlternativeNames AlternativeNames `xml:"AlternativeNames,omitempty"`
}
type Price struct {
Country CountryCode `xml:"country,attr"`
Value float64 `xml:",chardata"`
}
type Genre struct {
ID string `xml:"id,attr,omitempty"`
Value string `xml:",chardata"`
}
type Universe struct {
ID string `xml:"id,attr,omitempty"`
Name string `xml:"Name"`
Designation string `xml:"Designation,omitempty"`
}
type Arc struct {
ID string `xml:"id,attr,omitempty"`
Name string `xml:"Name"`
Number int `xml:"Number,omitempty"`
}
type GTIN struct {
ISBN string `xml:"ISBN"`
UPC string `xml:"UPC"`
}
type URL struct {
Primary bool `xml:"primary,attr,omitempty"`
Value string `xml:",chardata"`
}
type Credit struct {
Creator Resource `xml:"Creator"`
Roles Roles `xml:"Roles"`
}
type Role struct {
ID string `xml:"id,attr,omitempty"`
Value RoleValue `xml:",chardata"`
}
type LanguageCode string
type CountryCode string
func (mi *MetronInfo) SetXMLAttributes() {
//mi.XmlnsXsd = "http://www.w3.org/2001/XMLSchema"
mi.XmlNsXsi = "http://www.w3.org/2001/XMLSchema-instance"
mi.XmlXsiNoNameSpace = "MetronInfo.xsd"
}
func NewMetronInfo() *MetronInfo {
mi := &MetronInfo{}
mi.SetXMLAttributes()
return mi
}