-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.go
More file actions
84 lines (73 loc) · 2.26 KB
/
Copy pathtypes.go
File metadata and controls
84 lines (73 loc) · 2.26 KB
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
package main
import "regexp"
import "encoding/xml"
import "net/url"
type AST struct {
ID string `xml:"id,attr"`
XMLName xml.Name `json:"-" xml:"html"`
Version string `json:"version" xml:"version,attr"`
Meta []*Meta `json:"-" xml:"head>meta"`
Navs []*Nav `json:"-" xml:"body>nav"`
Forms []*Form `json:"-" xml:"body>form"`
Templates []*Template `json:"-" xml:"body>template"`
InputsIndex map[string]*Input `json:"inputs" xml:"-"`
FormsIndex map[string]*Form `json:"forms" xml:"-"`
NavsIndex map[string]*Nav `json:"navs" xml:"-"`
ConfigsMap map[string]string `json:"configs" xml:"-"`
}
type Meta struct {
Key string `xml:"name,attr"`
Value string `xml:"content,attr"`
}
type Nav struct {
ID string `json:"id" xml:"id,attr"`
Title string `json:"title" xml:"title,attr"`
Links []*Link `json:"-" xml:"a"`
LinksIndex map[string]*Link `json:"links" xml:"-"`
}
type Link struct {
ID string `xml:"id,attr"`
Text string `xml:",innerxml"`
Href string `xml:"href,attr"`
HrefParsed *url.URL `xml:"-"`
Reset bool `xml:"reset,attr"`
Embed bool `xml:"embed,attr"`
EmbedRatio string `xml:"ratio,attr"`
}
type Form struct {
ID string `xml:"id,attr"`
Title string `xml:"title,attr"`
Submit string `xml:"submit,attr"`
Action string `xml:"action,attr"`
Method string `xml:"method,attr"`
Inputs []*Input `xml:"input"`
}
type Input struct {
NS string `xml:"-"`
Path string `xml:"-"`
ID string `xml:"id,attr"`
Title string `xml:"title,attr,omitempty"`
Type string `xml:"type,attr,omitempty"`
IfPlain string `xml:"if,attr"`
IfParsed If `xml:"-"`
Options []*Option `xml:"option,omitempty"`
}
type Template struct {
Match string `xml:"match,attr"`
MatchCompiled *regexp.Regexp `xml:"-"`
Replies []*Reply `xml:"reply"`
}
type Reply struct {
Type string `xml:"type,attr"`
Label string `xml:"label,attr"`
Source string `xml:"src,attr"`
}
type If struct {
Right string
Op string
Left string
}
type Option struct {
Key string `xml:"value,attr"`
Text string `xml:",innerxml"`
}