Documentation
¶
Index ¶
- Variables
- type Config
- type FOxID
- func (id *FOxID) Bytes() []byte
- func (id *FOxID) Counter() uint32
- func (id *FOxID) Datacenter() uint16
- func (id *FOxID) GenerateRandom()
- func (id *FOxID) Generator() uint32
- func (id *FOxID) IncrementCounter()
- func (id *FOxID) Random() uint32
- func (id *FOxID) SetCounter(value uint32)
- func (id *FOxID) SetDatacenter(value uint16)
- func (id *FOxID) SetGenerator(value uint32)
- func (id *FOxID) SetRandom(value uint32)
- func (id *FOxID) SetTime(t time.Time)
- func (id *FOxID) SetTimestamp(timestamp uint64)
- func (id *FOxID) SetWorker(value uint16)
- func (id *FOxID) String() string
- func (id *FOxID) Time() time.Time
- func (id *FOxID) Timestamp() uint64
- func (id *FOxID) Worker() uint16
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidFOxID = errors.New("invalid FOxID")
Functions ¶
This section is empty.
Types ¶
type FOxID ¶
type FOxID [16]byte
FOxID is a unique identifier with lexicographic sorting capabilities.
func (*FOxID) Datacenter ¶
Datacenter returns the datacenter id encoded in the FOxID.
func (*FOxID) GenerateRandom ¶
func (id *FOxID) GenerateRandom()
GenerateRandom sets the random component of FOxID to random value.
func (*FOxID) IncrementCounter ¶
func (id *FOxID) IncrementCounter()
IncrementCounter sets the FOxID counter component to the global incrementing counter.
func (*FOxID) SetCounter ¶
SetCounter sets the counter component of FOxID to the given value.
func (*FOxID) SetDatacenter ¶
SetDatacenter sets the datacenter component of FOxID to the given value.
func (*FOxID) SetGenerator ¶
SetGenerator sets the generator component of FOxID to the given value.
func (*FOxID) SetTime ¶
SetTime sets the time component of the FOxID to the given in time.Time amount of milliseconds since Unix epoch.
func (*FOxID) SetTimestamp ¶
SetTimestamp sets the timestamp component to the given amount of milliseconds since Unix epoch.