alloc

package
v0.0.0-...-8588863 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alloc

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

Alloc lease /segment/{table}/alloc/{addr}, watch /segment/{table}/routing/{addr}/{tag}/{hashId} handle pending routing rule, set value 'running' if the 'pending' rule is ready to serve. If alloc goes down, it will try to delete lease key and delete --prefix routing key at once; assign will do the same in case alloc crashed.

func NewAlloc

func NewAlloc(ctx context.Context, conf *utils.Config) (*Alloc, error)

func (*Alloc) Close

func (a *Alloc) Close(ctx context.Context) error

func (*Alloc) GenUserSeq

func (a *Alloc) GenUserSeq(ctx context.Context, id uint32, tag string) (int64, error)

func (*Alloc) GetUserSeq

func (a *Alloc) GetUserSeq(ctx context.Context, id uint32, tag string) (int64, error)

type Server

type Server struct {
	*pb.UnimplementedAllocServer
	// contains filtered or unexported fields
}

func NewAllocServer

func NewAllocServer(ctx context.Context, conf *utils.Config) (*Server, error)

func (*Server) Close

func (a *Server) Close(ctx context.Context) error

func (*Server) GenUserSeq

func (a *Server) GenUserSeq(ctx context.Context, in *pb.GenUserSeqReq) (*pb.GenUserSeqResp, error)

func (*Server) GetUserSeq

func (a *Server) GetUserSeq(ctx context.Context, in *pb.GetUserSeqReq) (*pb.GetUserSeqResp, error)

Jump to

Keyboard shortcuts

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