Documentation ¶
Index ¶
- func CaptureException()
- func InitMachineID(machineID int16)
- func MachineID(id int64) int16
- func MachineIDHigh(id int64) int16
- func MachineIDLow(id int64) int16
- func NewPrometheusHandlerWrapper(opts ...server.Option) server.HandlerWrapper
- func NextID(tp int) (int64, error)
- func SectionIDRandSelector(id int64) selector.SelectOption
- func SpecificIDSelector(id int64) selector.SelectOption
- type FakeRandom
- type Snowflakes
- type WaitGroupWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaptureException ¶ added in v1.0.1
func CaptureException()
func InitMachineID ¶
func InitMachineID(machineID int16)
snow flakes machine_id: 10 bits machineID + 6 bits plugin_type
func MachineIDHigh ¶
func MachineIDLow ¶
func NewPrometheusHandlerWrapper ¶ added in v1.0.1
func NewPrometheusHandlerWrapper(opts ...server.Option) server.HandlerWrapper
func SectionIDRandSelector ¶
func SectionIDRandSelector(id int64) selector.SelectOption
select node by section id: game_id / 10
func SpecificIDSelector ¶
func SpecificIDSelector(id int64) selector.SelectOption
select node by specific game_id
Types ¶
type FakeRandom ¶ added in v1.0.1
type FakeRandom struct {
// contains filtered or unexported fields
}
func NewFakeRandom ¶ added in v1.0.1
func NewFakeRandom(seed int) *FakeRandom
func (*FakeRandom) Rand ¶ added in v1.0.1
func (f *FakeRandom) Rand() int
------------------------------------------------------------------------------- 生成一个SHORT伪随机数 -------------------------------------------------------------------------------
func (*FakeRandom) RandSection ¶ added in v1.0.1
func (f *FakeRandom) RandSection(min, max int) int
func (*FakeRandom) Reset ¶ added in v1.0.1
func (f *FakeRandom) Reset(seed int)
------------------------------------------------------------------------------- 重置种子 -------------------------------------------------------------------------------
type Snowflakes ¶
type Snowflakes struct {
// contains filtered or unexported fields
}
type WaitGroupWrapper ¶
func (*WaitGroupWrapper) Wrap ¶
func (w *WaitGroupWrapper) Wrap(cb func())
Click to show internal directories.
Click to hide internal directories.