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 ¶
func (s *RPCServer) GetUUID(context.Context, *rpc.Snowflake_NullRequest) (*rpc.Snowflake_UUID, error)
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
Click to show internal directories.
Click to hide internal directories.