Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSequence ¶
func NewSequence(generator *config.SequenceGenerator, tableName string) (proto.SequenceGenerator, error)
Types ¶
type SegmentConfig ¶
type SegmentWorker ¶
type SegmentWorker struct {
// contains filtered or unexported fields
}
func NewSegmentWorker ¶
func NewSegmentWorker(dsn string, from, len int64, biz string) (*SegmentWorker, error)
func (*SegmentWorker) NextID ¶
func (w *SegmentWorker) NextID() (int64, error)
func (*SegmentWorker) ProduceID ¶
func (w *SegmentWorker) ProduceID()
type SnowflakeConfig ¶
type SnowflakeConfig struct {
WorkerID int64 `json:"worker_id"`
}
type SnowflakeWorker ¶
type SnowflakeWorker struct {
// contains filtered or unexported fields
}
func NewWorker ¶
func NewWorker(id int64) (*SnowflakeWorker, error)
func (*SnowflakeWorker) NextID ¶
func (w *SnowflakeWorker) NextID() (int64, error)
Click to show internal directories.
Click to hide internal directories.