service

package
v0.0.0-...-ef50a8d Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ModName = "uuid"

ModName named a mod

Variables

Functions

This section is empty.

Types

type Config

type Config struct {
	// Epoch is set to the twitter snowflake epoch of Nov 04 2010 01:42:54 UTC in milliseconds
	// You may customize this to set a different epoch for your application.
	Epoch int64
	// NodeBits holds the number of bits to use for Node
	// Remember, you have a total 22 bits to share between Node/Step
	NodeBits uint8
	// StepBits holds the number of bits to use for Step
	// Remember, you have a total 22 bits to share between Node/Step
	StepBits uint8

	// NodeID determine the specific value of the node id; 0 nodeID are not used by default
	NodeID int64

	// EnableRedis whether to enable the use of redis to assign node IDs
	EnableRedis bool
	// RedisAddr redis addr, default to 'Host:Port'
	RedisAddr string
}

Config uuid service config

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig ...

func RawConfig

func RawConfig(key string) *Config

RawConfig ...

func StdConfig

func StdConfig(name string) *Config

StdConfig Jupiter Standard HTTP Server config

func (*Config) Build

func (config *Config) Build() (*Uuid, error)

Build create server instance, then initialize it with necessary interceptor

func (*Config) MustBuild

func (config *Config) MustBuild() *Uuid

type Options

type Options struct {
	// 没有依赖任何服务,这里就不存在client
	// UuidGrpc grpc.UuidInterface
	// ExampleMysql mysql.ExampleInterface
	Redis redisCli.RedisInterface
}

Options wireservice

type Uuid

type Uuid struct {
	Options
	// contains filtered or unexported fields
}

func NewUuidService

func NewUuidService(options Options) *Uuid

NewUuidService 创建uuid服务

Jump to

Keyboard shortcuts

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