Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Container = &UuidContainer{}
)
Initialize a uuid container singleton instance
Functions ¶
func InitializeUuidGenerator ¶
InitializeUuidGenerator initializes the current uuid generator according to the config
Types ¶
type InternalUuidGenerator ¶
type InternalUuidGenerator struct {
// contains filtered or unexported fields
}
InternalUuidGenerator represents internal bundled uuid generator
func NewInternalUuidGenerator ¶
func NewInternalUuidGenerator(config *settings.Config) (*InternalUuidGenerator, error)
NewInternalUuidGenerator returns a new internal uuid generator
func (*InternalUuidGenerator) GenerateUuid ¶
func (u *InternalUuidGenerator) GenerateUuid(idType UuidType) int64
GenerateUuid returns a new uuid
func (*InternalUuidGenerator) ParseUuidInfo ¶
func (u *InternalUuidGenerator) ParseUuidInfo(uuid int64) *InternalUuidInfo
ParseUuidInfo returns a info struct which contains all information in uuid
type InternalUuidInfo ¶
type InternalUuidInfo struct {
UnixTime uint32
UuidType uint8
UuidServerId uint8
SequentialId uint32
}
InternalUuidInfo represents a struct which has all information in uuid
type UuidContainer ¶
type UuidContainer struct {
Current UuidGenerator
}
UuidContainer contains the current uuid generator
func (*UuidContainer) GenerateUuid ¶
func (u *UuidContainer) GenerateUuid(uuidType UuidType) int64
GenerateUuid returns a new uuid by the current uuid generator
type UuidGenerator ¶
UuidGenerator is common uuid generator interface
Click to show internal directories.
Click to hide internal directories.