-
Notifications
You must be signed in to change notification settings - Fork 2
/
schema_private.go
43 lines (38 loc) · 927 Bytes
/
schema_private.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
package caskin
// idInterface it is only for get/set id method
type idInterface interface {
// GetID get id method
GetID() uint64
// SetID set id method
SetID(uint64)
}
func isValid(item idInterface) error {
if item == nil {
return ErrNil
}
if item.GetID() == 0 {
return ErrEmptyID
}
return nil
}
// domainInterface it is only for get/set domain_id method
type domainInterface interface {
// GetDomainID get domain_id method
GetDomainID() uint64
// SetDomainID set domain_id method
SetDomainID(uint64)
}
// codeInterface it is only for encode/decode method
type codeInterface interface {
// Encode to string method
Encode() string
// Decode string to instance method
Decode(string) error
}
// parentInterface it is only for get/set parent_id method
type parentInterface interface {
// GetParentID get parent id method
GetParentID() uint64
// SetParentID set parent id method
SetParentID(uint64)
}