-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex_data.go
50 lines (45 loc) · 870 Bytes
/
index_data.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
package structexplorer
import (
_ "embed"
"html/template"
"strings"
)
//go:embed script.js
var scriptJS string
//go:embed style.css
var styleCSS string
type (
indexData struct {
Rows []tableRow
Script template.JS
Style template.CSS
}
tableRow struct {
Cells []fieldList
}
fieldList struct {
Label template.HTML
Path string
Row int
Column int
Type string
IsRoot bool
HasZeros bool
Access string
Fields []fieldEntry
SelectSize int
SelectID string
NotLive bool
}
fieldEntry struct {
Label string
Key string
Type string
ValueString string // printstring(fieldAcess.value())
Padding template.HTML
}
)
func (f fieldEntry) withPaddingTo(size int) fieldEntry {
f.Padding = template.HTML(strings.Repeat(" ", size-len(f.Label)))
return f
}