-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcovenantsql.go
67 lines (57 loc) · 1.53 KB
/
covenantsql.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
package covenant
import (
"time"
"github.com/CovenantSQL/CovenantSQL/crypto/hash"
"github.com/CovenantSQL/CovenantSQL/proto"
)
//go:generate hsp
const Eight = 8
type MyInt int
type Data []byte
type Struct struct {
Which map[string]*MyInt `hsp:"2which"`
Other Data `hsp:"1other"`
Nums [Eight]float64 `hsp:"3nums"`
}
// HeaderTest is a block header.
type HeaderTest struct {
Version int32 `hsp:"01"`
TestName string `hsp:"00"`
TestArray []byte
S Struct
Producer proto.NodeID `hsp:"02"`
GenesisHash []hash.Hash `hsp:"06"`
ParentHash []*hash.Hash `hsp:"03"`
MerkleRoot *[]*hash.Hash `hsp:"05"`
Timestamp time.Time `hsp:"04"`
xx int
}
// HeaderTest is a block header.
type HeaderTest2 struct {
S Struct // position is not relevant
Version2 int32 `hsp:"01"`
TestName2 string `hsp:"00"`
TestArray []byte
Producer2 proto.NodeID `hsp:"02"`
GenesisHash2 []hash.Hash `hsp:"06"`
ParentHash2 []*hash.Hash `hsp:"03"`
MerkleRoot2 *[]*hash.Hash `hsp:"05"`
Timestamp2 time.Time `hsp:"04"`
xx int
}
type Person1 struct {
Name string
Age int
Address string
Map map[string]int
unexported bool // this field is ignored
Unexported string `hsp:"-"` // this field is ignored
}
type Person2 struct {
Name string
Address string
Age int
Map222 map[string]int `hspack:"Map"`
unexported bool // this field is ignored
Unexported string `hsp:"-"` // this field is ignored
}