-
Notifications
You must be signed in to change notification settings - Fork 0
/
cluster_client_token.go
83 lines (74 loc) · 1.58 KB
/
cluster_client_token.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
package model
import (
"database/sql"
"time"
)
//go:generate go run -mod=mod github.com/abice/go-enum --file=cluster_client_token.go --names --nocase=true
/*
ENUM(
id
uuid
name
summary
cluster_uuid
token
issued_at_time
expiration_time
created
updated
)
*/
type ClusterClientTokenFields int
type ClusterClientToken struct {
ID int64 `column:"id"` // pk
UUID string `column:"uuid"` // uuid
Name string `column:"name"`
Summary sql.NullString `column:"summary"`
ClusterUUID string `column:"cluster_uuid"`
Token string `column:"token"`
IssuedAtTime time.Time `column:"issued_at_time"`
ExpirationTime time.Time `column:"expiration_time"`
Created time.Time `column:"created"`
Updated time.Time `column:"updated"`
}
var _ ModelContext = (*ClusterClientToken)(nil)
func (ClusterClientToken) TableName() string { return "cluster_token" }
func (ClusterClientToken) ColumnNames() []string {
return ClusterClientTokenFieldsNames()
}
func (r *ClusterClientToken) Scan(s Scanner) error {
var (
created sql.NullTime
updated sql.NullTime
)
defer func() {
r.Created = created.Time
r.Updated = updated.Time
}()
return s.Scan(
&r.ID,
&r.UUID,
&r.Name,
&r.Summary,
&r.ClusterUUID,
&r.Token,
&r.IssuedAtTime,
&r.ExpirationTime,
&created,
&updated,
)
}
func (r ClusterClientToken) ColumnValues() []any {
return []any{
r.ID,
r.UUID,
r.Name,
r.Summary,
r.ClusterUUID,
r.Token,
r.IssuedAtTime,
r.ExpirationTime,
r.Created,
r.Updated,
}
}