Documentation ¶
Overview ¶
Code generated by atomix-go-framework. DO NOT EDIT.
Code generated by atomix-go-framework. DO NOT EDIT.
Index ¶
- Constants
- Variables
- func RegisterService(node *rsm.Node)
- type EventsProposal
- type EventsProposals
- type GetProposal
- type GetProposals
- type LatchProposal
- type LatchProposals
- type LeaderLatchState
- func (*LeaderLatchState) Descriptor() ([]byte, []int)
- func (m *LeaderLatchState) GetValue() int64
- func (m *LeaderLatchState) Marshal() (dAtA []byte, err error)
- func (m *LeaderLatchState) MarshalTo(dAtA []byte) (int, error)
- func (m *LeaderLatchState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*LeaderLatchState) ProtoMessage()
- func (m *LeaderLatchState) Reset()
- func (m *LeaderLatchState) Size() (n int)
- func (m *LeaderLatchState) String() string
- func (m *LeaderLatchState) Unmarshal(dAtA []byte) error
- func (m *LeaderLatchState) XXX_DiscardUnknown()
- func (m *LeaderLatchState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *LeaderLatchState) XXX_Merge(src proto.Message)
- func (m *LeaderLatchState) XXX_Size() int
- func (m *LeaderLatchState) XXX_Unmarshal(b []byte) error
- type NewServiceFunc
- type Proposal
- type ProposalID
- type Proposals
- type Service
- type ServiceAdaptor
- type ServiceContext
- type Session
- type SessionID
- type SessionState
- type Sessions
- type SnapshotReader
- type SnapshotWriter
- type Watcher
Constants ¶
View Source
const Type = "LeaderLatch"
Variables ¶
Functions ¶
func RegisterService ¶
RegisterService registers the election primitive service on the given node
Types ¶
type EventsProposal ¶
type EventsProposal interface { Proposal Request() *leader.EventsRequest Notify(*leader.EventsResponse) error Close() error }
type EventsProposals ¶
type EventsProposals interface { Get(ProposalID) (EventsProposal, bool) List() []EventsProposal // contains filtered or unexported methods }
type GetProposal ¶
type GetProposal interface { Proposal Request() *leader.GetRequest Reply(*leader.GetResponse) error // contains filtered or unexported methods }
type GetProposals ¶
type GetProposals interface { Get(ProposalID) (GetProposal, bool) List() []GetProposal // contains filtered or unexported methods }
type LatchProposal ¶
type LatchProposal interface { Proposal Request() *leader.LatchRequest Reply(*leader.LatchResponse) error // contains filtered or unexported methods }
type LatchProposals ¶
type LatchProposals interface { Get(ProposalID) (LatchProposal, bool) List() []LatchProposal // contains filtered or unexported methods }
type LeaderLatchState ¶
type LeaderLatchState struct { meta.ObjectMeta `protobuf:"bytes,1,opt,name=meta,proto3,embedded=meta" json:"meta"` Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"` }
func (*LeaderLatchState) Descriptor ¶
func (*LeaderLatchState) Descriptor() ([]byte, []int)
func (*LeaderLatchState) GetValue ¶
func (m *LeaderLatchState) GetValue() int64
func (*LeaderLatchState) Marshal ¶
func (m *LeaderLatchState) Marshal() (dAtA []byte, err error)
func (*LeaderLatchState) MarshalToSizedBuffer ¶
func (m *LeaderLatchState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*LeaderLatchState) ProtoMessage ¶
func (*LeaderLatchState) ProtoMessage()
func (*LeaderLatchState) Reset ¶
func (m *LeaderLatchState) Reset()
func (*LeaderLatchState) Size ¶
func (m *LeaderLatchState) Size() (n int)
func (*LeaderLatchState) String ¶
func (m *LeaderLatchState) String() string
func (*LeaderLatchState) Unmarshal ¶
func (m *LeaderLatchState) Unmarshal(dAtA []byte) error
func (*LeaderLatchState) XXX_DiscardUnknown ¶
func (m *LeaderLatchState) XXX_DiscardUnknown()
func (*LeaderLatchState) XXX_Marshal ¶
func (m *LeaderLatchState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*LeaderLatchState) XXX_Merge ¶
func (m *LeaderLatchState) XXX_Merge(src proto.Message)
func (*LeaderLatchState) XXX_Size ¶
func (m *LeaderLatchState) XXX_Size() int
func (*LeaderLatchState) XXX_Unmarshal ¶
func (m *LeaderLatchState) XXX_Unmarshal(b []byte) error
type NewServiceFunc ¶
type NewServiceFunc func(ServiceContext) Service
type ProposalID ¶
type ProposalID uint64
type Proposals ¶
type Proposals interface { Latch() LatchProposals Get() GetProposals Events() EventsProposals }
type Service ¶
type Service interface { ServiceContext Backup(SnapshotWriter) error Restore(SnapshotReader) error // Latch attempts to acquire the leader latch Latch(LatchProposal) error // Get gets the current leader Get(GetProposal) error // Events listens for leader change events Events(EventsProposal) error }
type ServiceAdaptor ¶
func (*ServiceAdaptor) SessionClosed ¶
func (s *ServiceAdaptor) SessionClosed(session rsm.Session)
func (*ServiceAdaptor) SessionExpired ¶
func (s *ServiceAdaptor) SessionExpired(session rsm.Session)
func (*ServiceAdaptor) SessionOpen ¶
func (s *ServiceAdaptor) SessionOpen(rsmSession rsm.Session)
type ServiceContext ¶
type Session ¶
type Session interface { ID() SessionID State() SessionState Watch(func(SessionState)) Watcher Proposals() Proposals // contains filtered or unexported methods }
type SnapshotReader ¶
type SnapshotReader interface {
ReadState() (*LeaderLatchState, error)
}
type SnapshotWriter ¶
type SnapshotWriter interface {
WriteState(*LeaderLatchState) error
}
Click to show internal directories.
Click to hide internal directories.