Documentation
¶
Index ¶
- Constants
- type GUID
- func (g GUID) Bytes() []byte
- func (g GUID) Empty() bool
- func (g GUID) Equal(id GUID) bool
- func (g GUID) Gt(id GUID) bool
- func (g GUID) Gte(id GUID) bool
- func (g GUID) HostID() uint16
- func (g GUID) Lt(id GUID) bool
- func (g GUID) Lte(id GUID) bool
- func (g GUID) MarshalBinary() (data []byte, err error)
- func (g GUID) MarshalJSON() ([]byte, error)
- func (g GUID) MarshalText() (text []byte, err error)
- func (g GUID) ProcessID() uint16
- func (g GUID) Random() uint16
- func (g GUID) Reset()
- func (g *GUID) Scan(src any) error
- func (g GUID) Serial() uint16
- func (g GUID) String() string
- func (g GUID) Unix() int64
- func (g *GUID) UnmarshalBinary(data []byte) error
- func (g *GUID) UnmarshalJSON(data []byte) error
- func (g *GUID) UnmarshalText(text []byte) error
- func (g GUID) Value() (driver.Value, error)
Constants ¶
View Source
const ( BLen = 12 // GUID字节长度 SLen = 20 // GUID字符长度 Base = 36 // GUID转换进制 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GUID ¶
GUID is the global unique ID.
var (
NULL GUID // 空GUID
)
func New ¶
func New() GUID
New 生成全局唯一ID 4 byte: 时间戳(S) 2 byte: 主机号 2 byte: 进程号 2 byte: 流水号 2 byte: 随机数
func (GUID) MarshalBinary ¶
MarshalBinary implements the encoding.BinaryMarshaler interface.
func (GUID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (GUID) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*GUID) UnmarshalBinary ¶
UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
func (*GUID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*GUID) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.
Click to show internal directories.
Click to hide internal directories.