Documentation ¶
Index ¶
- func SeqIDGenRegister(name string, adapter SeqIDGenInstance)
- func UUIDGenRegister(name string, adapter UUIDGenInstance)
- type RedisSeqClient
- type RpcIDGenClient
- func (c *RpcIDGenClient) GetCurrentSeqID(key string) (int64, error)
- func (c *RpcIDGenClient) GetNextNSeqID(key string, n int) (int64, error)
- func (c *RpcIDGenClient) GetNextSeqID(key string) (int64, error)
- func (c *RpcIDGenClient) GetUUID() (int64, error)
- func (c *RpcIDGenClient) Initialize(config string) error
- type SeqIDGen
- type SeqIDGenInstance
- type SeqsvrClient
- type SnowflakeUUIDGen
- type UUIDGen
- type UUIDGenInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SeqIDGenRegister ¶
func SeqIDGenRegister(name string, adapter SeqIDGenInstance)
func UUIDGenRegister ¶
func UUIDGenRegister(name string, adapter UUIDGenInstance)
Types ¶
type RedisSeqClient ¶
type RedisSeqClient struct {
// contains filtered or unexported fields
}
func NewRedisSeqClient ¶
func NewRedisSeqClient(redis *redis_client.RedisPool) *RedisSeqClient
func (*RedisSeqClient) GetCurrentSeqID ¶
func (c *RedisSeqClient) GetCurrentSeqID(key string) (seq int64, err error)
func (*RedisSeqClient) GetNextNSeqID ¶
func (c *RedisSeqClient) GetNextNSeqID(key string, n int) (seq int64, err error)
func (*RedisSeqClient) GetNextSeqID ¶
func (c *RedisSeqClient) GetNextSeqID(key string) (seq int64, err error)
func (*RedisSeqClient) Initialize ¶
func (c *RedisSeqClient) Initialize(config string) error
type RpcIDGenClient ¶
type RpcIDGenClient struct {
// contains filtered or unexported fields
}
func NewRpcIDGenClient ¶
func NewRpcIDGenClient(discovery *service_discovery.ServiceDiscoveryClientConfig) *RpcIDGenClient
func (*RpcIDGenClient) GetCurrentSeqID ¶
func (c *RpcIDGenClient) GetCurrentSeqID(key string) (int64, error)
func (*RpcIDGenClient) GetNextNSeqID ¶
func (c *RpcIDGenClient) GetNextNSeqID(key string, n int) (int64, error)
func (*RpcIDGenClient) GetNextSeqID ¶
func (c *RpcIDGenClient) GetNextSeqID(key string) (int64, error)
func (*RpcIDGenClient) GetUUID ¶
func (c *RpcIDGenClient) GetUUID() (int64, error)
func (*RpcIDGenClient) Initialize ¶
func (c *RpcIDGenClient) Initialize(config string) error
type SeqIDGen ¶
type SeqIDGen interface { Initialize(config string) error GetCurrentSeqID(key string) (int64, error) GetNextSeqID(key string) (int64, error) GetNextNSeqID(key string, n int) (seq int64, err error) }
func NewSeqIDGen ¶
type SeqIDGenInstance ¶
type SeqIDGenInstance func() SeqIDGen
/////////////////////////////////////////////////////////////////////////////////////////
type SeqsvrClient ¶
type SeqsvrClient struct { }
func (*SeqsvrClient) GetCurrentSeqID ¶
func (c *SeqsvrClient) GetCurrentSeqID(key string) (int64, error)
func (*SeqsvrClient) GetNextNSeqID ¶
func (c *SeqsvrClient) GetNextNSeqID(key string, n int) (int64, error)
func (*SeqsvrClient) GetNextSeqID ¶
func (c *SeqsvrClient) GetNextSeqID(key string) (int64, error)
func (*SeqsvrClient) Initialize ¶
func (c *SeqsvrClient) Initialize(config string) error
type SnowflakeUUIDGen ¶
type SnowflakeUUIDGen struct {
// contains filtered or unexported fields
}
func NewSnowflakeUUIDGen ¶
func NewSnowflakeUUIDGen(serverId int) *SnowflakeUUIDGen
func (*SnowflakeUUIDGen) GetUUID ¶
func (id *SnowflakeUUIDGen) GetUUID() (int64, error)
func (*SnowflakeUUIDGen) Initialize ¶
func (id *SnowflakeUUIDGen) Initialize(config string) error
type UUIDGen ¶
/////////////////////////////////////////////////////////////////////////////////////////
func NewUUIDGen ¶
type UUIDGenInstance ¶
type UUIDGenInstance func() UUIDGen
Click to show internal directories.
Click to hide internal directories.