Documentation ¶
Index ¶
- Variables
- func SyncXORMTables()
- type Endpoint
- type IDGen
- type LeafAllocService
- func (s *LeafAllocService) GetAllLeafAllocs(ctx context.Context) (array []*dao.LeafAllocDao, err error)
- func (s *LeafAllocService) GetAllTags(ctx context.Context) (array []string, err error)
- func (s *LeafAllocService) GetLeafAlloc(ctx context.Context, tag string) (err error)
- func (s *LeafAllocService) UpdateMaxId(ctx context.Context, tag string) (err error)
- func (s *LeafAllocService) UpdateMaxIdByCustomStep(ctx context.Context, step int, tag string) (err error)
- type SegmentIDGenImpl
- func (s *SegmentIDGenImpl) Get(ctx context.Context, key string) models.Result
- func (s *SegmentIDGenImpl) GetAllLeafAllocs(ctx context.Context) (array []*dao.LeafAllocDao, err error)
- func (s *SegmentIDGenImpl) GetCache(ctx context.Context) *sync.Map
- func (s *SegmentIDGenImpl) GetDao(ctx context.Context) *dao.LeafAllocDao
- func (s *SegmentIDGenImpl) Init() bool
- func (s *SegmentIDGenImpl) SetDao(dao *dao.LeafAllocDao)
- type SnowFlakeEtcdHolder
- type SnowFlakeIdGenImpl
- type SnowFlakeZookeeperHolder
- type ZeroIDGenImpl
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PREFIX_ZK_PATH = "/snowflake/" + conf.GetString("LEAF_NAME") PROP_PATH = filepath.Join(conf.GetConfigPath(), conf.GetString("LEAF_NAME")) + "/leafconf/{port}/workerID.toml" PATH_FOREVER = PREFIX_ZK_PATH + "/forever" // 保存所有数据持久的节点 )
Functions ¶
func SyncXORMTables ¶
func SyncXORMTables()
Types ¶
type LeafAllocService ¶
type LeafAllocService struct {
Dao *dao.LeafAllocDao
}
func NewLeafAllocService ¶
func NewLeafAllocService() *LeafAllocService
func (*LeafAllocService) GetAllLeafAllocs ¶
func (s *LeafAllocService) GetAllLeafAllocs(ctx context.Context) (array []*dao.LeafAllocDao, err error)
func (*LeafAllocService) GetAllTags ¶
func (s *LeafAllocService) GetAllTags(ctx context.Context) (array []string, err error)
func (*LeafAllocService) GetLeafAlloc ¶
func (s *LeafAllocService) GetLeafAlloc(ctx context.Context, tag string) (err error)
func (*LeafAllocService) UpdateMaxId ¶
func (s *LeafAllocService) UpdateMaxId(ctx context.Context, tag string) (err error)
func (*LeafAllocService) UpdateMaxIdByCustomStep ¶
type SegmentIDGenImpl ¶
type SegmentIDGenImpl struct {
// contains filtered or unexported fields
}
func NewSegmentIDGenImpl ¶
func NewSegmentIDGenImpl() *SegmentIDGenImpl
func (*SegmentIDGenImpl) GetAllLeafAllocs ¶
func (s *SegmentIDGenImpl) GetAllLeafAllocs(ctx context.Context) (array []*dao.LeafAllocDao, err error)
func (*SegmentIDGenImpl) GetCache ¶
func (s *SegmentIDGenImpl) GetCache(ctx context.Context) *sync.Map
func (*SegmentIDGenImpl) GetDao ¶
func (s *SegmentIDGenImpl) GetDao(ctx context.Context) *dao.LeafAllocDao
func (*SegmentIDGenImpl) Init ¶
func (s *SegmentIDGenImpl) Init() bool
func (*SegmentIDGenImpl) SetDao ¶
func (s *SegmentIDGenImpl) SetDao(dao *dao.LeafAllocDao)
type SnowFlakeEtcdHolder ¶
type SnowFlakeEtcdHolder struct { WorkerId int // contains filtered or unexported fields }
func NewSnowFlakeEtcdHolder ¶
func NewSnowFlakeEtcdHolder(ip, port string, endpoints []string, dialTimeout int) *SnowFlakeEtcdHolder
func (*SnowFlakeEtcdHolder) GetWorkerId ¶
func (s *SnowFlakeEtcdHolder) GetWorkerId() int
func (*SnowFlakeEtcdHolder) Init ¶
func (s *SnowFlakeEtcdHolder) Init() bool
type SnowFlakeIdGenImpl ¶
type SnowFlakeIdGenImpl struct {
// contains filtered or unexported fields
}
func NewSnowFlakeIdGenImpl ¶
func NewSnowFlakeIdGenImpl(port int, twepoch int64) *SnowFlakeIdGenImpl
func (*SnowFlakeIdGenImpl) DecodeSnowflakeId ¶
func (s *SnowFlakeIdGenImpl) DecodeSnowflakeId(idStr string) map[string]interface{}
type SnowFlakeZookeeperHolder ¶
type SnowFlakeZookeeperHolder struct { ZKAddressNode string WorkerId int // contains filtered or unexported fields }
func NewSnowFlakeZookeeperHolder ¶
func NewSnowFlakeZookeeperHolder(ip, port, connectionStr string) *SnowFlakeZookeeperHolder
func (*SnowFlakeZookeeperHolder) GetWorkerId ¶
func (s *SnowFlakeZookeeperHolder) GetWorkerId() int
func (*SnowFlakeZookeeperHolder) Init ¶
func (s *SnowFlakeZookeeperHolder) Init() bool
type ZeroIDGenImpl ¶
type ZeroIDGenImpl struct { }
func NewZeroIDGenImpl ¶
func NewZeroIDGenImpl() *ZeroIDGenImpl
Click to show internal directories.
Click to hide internal directories.