Documentation ¶
Index ¶
- func WithGenerator(ctx context.Context, g Generator) context.Context
- func WithGeneratorContext(g Generator) contextx.WithContext
- func WithSFIDGenerator(ctx context.Context, g SFIDGenerator) context.Context
- func WithSFIDGeneratorContext(g SFIDGenerator) contextx.WithContext
- type Generator
- type SFIDGenerator
- func MustNewSFIDGenerator() SFIDGenerator
- func MustNewSFIDGeneratorWithWorkerID(wid uint32) SFIDGenerator
- func MustSFIDGeneratorFromContext(ctx context.Context) SFIDGenerator
- func NewSFIDGenerator() (SFIDGenerator, error)
- func NewSFIDGeneratorWithWorkerID(wid uint32) (SFIDGenerator, error)
- func SFIDGeneratorFromContext(ctx context.Context) (SFIDGenerator, bool)
- type SFIDGeneratorImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithGeneratorContext ¶
func WithGeneratorContext(g Generator) contextx.WithContext
func WithSFIDGenerator ¶
func WithSFIDGenerator(ctx context.Context, g SFIDGenerator) context.Context
func WithSFIDGeneratorContext ¶
func WithSFIDGeneratorContext(g SFIDGenerator) contextx.WithContext
Types ¶
type SFIDGenerator ¶
func MustNewSFIDGenerator ¶
func MustNewSFIDGenerator() SFIDGenerator
func MustNewSFIDGeneratorWithWorkerID ¶
func MustNewSFIDGeneratorWithWorkerID(wid uint32) SFIDGenerator
func MustSFIDGeneratorFromContext ¶
func MustSFIDGeneratorFromContext(ctx context.Context) SFIDGenerator
func NewSFIDGenerator ¶
func NewSFIDGenerator() (SFIDGenerator, error)
func NewSFIDGeneratorWithWorkerID ¶
func NewSFIDGeneratorWithWorkerID(wid uint32) (SFIDGenerator, error)
func SFIDGeneratorFromContext ¶
func SFIDGeneratorFromContext(ctx context.Context) (SFIDGenerator, bool)
type SFIDGeneratorImpl ¶
type SFIDGeneratorImpl struct{ *snowflake_id.Snowflake }
func (*SFIDGeneratorImpl) MustGenSFID ¶
func (sfg *SFIDGeneratorImpl) MustGenSFID() types.SFID
func (*SFIDGeneratorImpl) MustGenSFIDs ¶
func (sfg *SFIDGeneratorImpl) MustGenSFIDs(n int) types.SFIDs
Click to show internal directories.
Click to hide internal directories.