id

package
v0.0.0-...-8ee3789 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AppName       string `toml:"appName"`
	Profile       string `toml:"profile"`
	Port          int    `toml:"port"`
	Router        string `toml:"router"`
	DateCenterId  int64  `toml:"date_center_id"`
	WorkerId      int64  `toml:"worker_id"`
	ConnectString string `toml:"connectString"`
	NodePath      string `toml:"nodePath"`
}

func LoadConfig

func LoadConfig(filename string) (*Config, error)

type Generator

type Generator struct {
	StartTimestamp int64

	DataCenterBits uint16
	WorkerBits     uint16
	SequenceBits   uint16
	DataCenterId   int64
	WorkerId       int64
	// contains filtered or unexported fields
}

func NewGenerator

func NewGenerator(startTimestamp int64, dataCenterBits uint16, workerBits uint16, sequenceBits uint16, dataCenterId int64, workerId int64) (*Generator, error)

func (*Generator) NextId

func (gen *Generator) NextId() (int64, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL