rpc

package
v0.0.0-...-b9a86dc Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2017 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PATH       = "/seqs/"
	UUID_KEY   = "/seqs/snowflake-uuid"
	BACKOFF    = 100  // max backoff delay millisecond
	CONCURRENT = 128  // max concurrent connections to etcd
	UUID_QUEUE = 1024 // uuid process queue
)
View Source
const (
	TS_MASK         = 0x1FFFFFFFFFF // 41bit
	SN_MASK         = 0xFFF         // 12bit
	MACHINE_ID_MASK = 0x3FF         // 10bit
)

Variables

This section is empty.

Functions

func RPCServerInit

func RPCServerInit()

Types

type RPCServer

type RPCServer struct {
	// contains filtered or unexported fields
}

func (*RPCServer) GetUUID

generate an unique uuid

func (*RPCServer) Next

func (s *RPCServer) Next(ctx context.Context, in *rpc.Snowflake_Key) (sfRes *rpc.Snowflake_Value, err error)

get next value of a key, like auto-increment in mysql

Jump to

Keyboard shortcuts

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