Documentation ¶
Index ¶
- Variables
- type ID
- func (id ID) Cmp(v ID) int
- func (id ID) Compare(v ID) int
- func (id ID) Equal(v ID) bool
- func (id ID) GreaterThan(v ID) bool
- func (id ID) GreaterThanOrEqual(v ID) bool
- func (id ID) IsZero() bool
- func (id ID) LessThan(v ID) bool
- func (id ID) LessThanOrEqual(v ID) bool
- func (id ID) MarshalJSON() ([]byte, error)
- func (id ID) MarshalText() ([]byte, error)
- func (id *ID) Scan(value any) error
- func (id ID) String() string
- func (id ID) Uint64() uint64
- func (id *ID) UnmarshalJSON(b []byte) error
- func (id *ID) UnmarshalText(b []byte) error
- func (id ID) Value() (driver.Value, error)
- type IDs
Constants ¶
This section is empty.
Variables ¶
var ( // Zero is the zero value of the ID type. Zero = New(zero) )
Functions ¶
This section is empty.
Types ¶
type ID ¶
type ID uint64
ID represents a unique identifier. It is a wrapper around an uint64.
func NewFromString ¶
NewFromString creates a new ID from a string.
func (ID) Cmp ¶
Cmp compares the numbers represented by id and v and returns: -1 if id < v 0 if id == v +1 if id > v
func (ID) Compare ¶
Compare compares the numbers represented by id and v and returns: -1 if id < v 0 if id == v +1 if id > v
func (ID) GreaterThan ¶
GreaterThan returns true if id is greater than v.
func (ID) GreaterThanOrEqual ¶
GreaterThanOrEqual returns true if id is greater than or equal to v.
func (ID) LessThanOrEqual ¶
LessThanOrEqual returns true if id is less than or equal to v.
func (ID) MarshalJSON ¶
MarshalJSON implements the json.Marshaler interface.
func (ID) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface.
func (*ID) UnmarshalJSON ¶
UnmarshalJSON implements the json.Unmarshaler interface.
func (*ID) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface.