Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IDGenerator ¶
type IDGenerator interface { // GenID generates a new ID. This method is go-routine safe. GenID() uint64 }
IDGenerator generates 64-bit IDs.
type RandomIDGen ¶
type RandomIDGen struct{}
RandomIDGen generates random IDs.
func (*RandomIDGen) GenID ¶
func (g *RandomIDGen) GenID() uint64
type SeqIDGen ¶
type SeqIDGen struct {
// contains filtered or unexported fields
}
SeqIDGen generates sequential IDs.
func NewSeqIDGen ¶
NewSeqIDGen creates a SeqIDGen that will start its IDs from init+1.
Click to show internal directories.
Click to hide internal directories.