Documentation
¶
Index ¶
- Constants
- func Lock() error
- type AllocService
- type PrepareApply
- type RegisterEndpoint
- type RegisterNodeInfo
- type Router
- type Section
- type Sequence
- func (s *Sequence) ApplyRouter(tick int64)
- func (s *Sequence) CommitRouter(version uint64, applyTick int64, sectionSize uint32, sections []uint32)
- func (s *Sequence) FetchNextSeq(ctx context.Context, ID uint32) (seq uint64, err error)
- func (s *Sequence) Open()
- func (s *Sequence) Pause()
- func (s *Sequence) Paused() bool
- func (s *Sequence) Reset()
- type Storage
- type TickType
- type Ticker
Constants ¶
View Source
const ( SectionStateCreated = iota SectionStateInitialized )
View Source
const ( StatePause uint32 = iota + 1 StateOpen )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AllocService ¶
type AllocService struct { api.UnimplementedAllocServer // contains filtered or unexported fields }
func NewAllocService ¶
func NewAllocService(sequence *Sequence, router *Router) *AllocService
func (*AllocService) FetchNext ¶
func (a *AllocService) FetchNext(ctx context.Context, req *api.FetchSeqNextReq) (*api.UUID, error)
type PrepareApply ¶
type RegisterEndpoint ¶
type RegisterNodeInfo ¶
type RegisterNodeInfo struct { IP string `json:"ip,omitempty"` Endpoints []*RegisterEndpoint `json:"endpoints,omitempty"` }
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) UpdateRouter ¶
type Section ¶
type Section struct { ID uint32 // contains filtered or unexported fields }
func NewSection ¶
type Sequence ¶
type Sequence struct {
// contains filtered or unexported fields
}
func NewSequence ¶
func (*Sequence) ApplyRouter ¶
func (*Sequence) CommitRouter ¶
func (*Sequence) FetchNextSeq ¶
type Storage ¶
type Storage interface { Register(ctx context.Context, node *RegisterNodeInfo) error Unregister(ctx context.Context) error Heartbeat(ctx context.Context, version uint64) (*proto.Router, error) IncrAndGetMax(ctx context.Context, ID uint32, nowVal, step uint64) (uint64, error) }
func NewEtcdv3Storage ¶
func NewEtcdv3Storage() Storage
Source Files
¶
Click to show internal directories.
Click to hide internal directories.