forked from bold-commerce/protoc-gen-struct-transformer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
model.go
75 lines (62 loc) · 1.2 KB
/
model.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
package model
import (
"time"
"github.com/bold-commerce/protoc-gen-struct-transformer/example/nulls"
)
type (
Product struct {
ID int `db:"id" json:"id"`
Name string `db:"name" json:"name"`
One string `db:"one" json:"one"`
SecondID string `db:"two" json:"two"`
}
Order struct {
ID int
FirstID string
SecondID string
ThirdURL string
}
Address struct {
ID int
Type string
}
Customer struct {
ID int
Name string
Addresses []Address
DefaultAddress *Address
BillingAddress Address
MapField1 string
MapField2 string
}
MyLineItem struct {
ID int
Type string
}
MyLineItemUsage struct {
List []MyLineItem
Item *MyLineItem
}
Value2Pointer struct {
AddressNil *Address
}
Pointer2Value struct {
AddressNotNil Address
}
// TimeModel is used for testing time-related transformations.
TimeModel struct {
TimeTime time.Time
PtrTimeTime *time.Time
NullsTime nulls.Time
PtrNullsTime *nulls.Time
NullsTime2 nulls.Time
PtrNullsTime2 *nulls.Time
}
IntsModel struct {
IntFor64Value int
IntFor32Value int
Int32Value int32
Int64Value int64
StringValue string
}
)