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 CounterState
- func (*CounterState) Descriptor() ([]byte, []int)
- func (m *CounterState) GetValue() int64
- func (m *CounterState) Marshal() (dAtA []byte, err error)
- func (m *CounterState) MarshalTo(dAtA []byte) (int, error)
- func (m *CounterState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*CounterState) ProtoMessage()
- func (m *CounterState) Reset()
- func (m *CounterState) Size() (n int)
- func (m *CounterState) String() string
- func (m *CounterState) Unmarshal(dAtA []byte) error
- func (m *CounterState) XXX_DiscardUnknown()
- func (m *CounterState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *CounterState) XXX_Merge(src proto.Message)
- func (m *CounterState) XXX_Size() int
- func (m *CounterState) XXX_Unmarshal(b []byte) error
- type DecrementProposal
- type DecrementProposals
- type GetProposal
- type GetProposals
- type IncrementProposal
- type IncrementProposals
- type NewServiceFunc
- type Proposal
- type ProposalID
- type Proposals
- type Service
- type ServiceAdaptor
- type ServiceContext
- type Session
- type SessionID
- type SessionState
- type Sessions
- type SetProposal
- type SetProposals
- type SnapshotReader
- type SnapshotWriter
- type Watcher
Constants ¶
View Source
const Type = "Counter"
Variables ¶
Functions ¶
func RegisterService ¶
RegisterService registers the election primitive service on the given node
Types ¶
type CounterState ¶
type CounterState 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 (*CounterState) Descriptor ¶
func (*CounterState) Descriptor() ([]byte, []int)
func (*CounterState) GetValue ¶
func (m *CounterState) GetValue() int64
func (*CounterState) Marshal ¶
func (m *CounterState) Marshal() (dAtA []byte, err error)
func (*CounterState) MarshalToSizedBuffer ¶
func (m *CounterState) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*CounterState) ProtoMessage ¶
func (*CounterState) ProtoMessage()
func (*CounterState) Reset ¶
func (m *CounterState) Reset()
func (*CounterState) Size ¶
func (m *CounterState) Size() (n int)
func (*CounterState) String ¶
func (m *CounterState) String() string
func (*CounterState) Unmarshal ¶
func (m *CounterState) Unmarshal(dAtA []byte) error
func (*CounterState) XXX_DiscardUnknown ¶
func (m *CounterState) XXX_DiscardUnknown()
func (*CounterState) XXX_Marshal ¶
func (m *CounterState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*CounterState) XXX_Merge ¶
func (m *CounterState) XXX_Merge(src proto.Message)
func (*CounterState) XXX_Size ¶
func (m *CounterState) XXX_Size() int
func (*CounterState) XXX_Unmarshal ¶
func (m *CounterState) XXX_Unmarshal(b []byte) error
type DecrementProposal ¶
type DecrementProposal interface { Proposal Request() *counter.DecrementRequest Reply(*counter.DecrementResponse) error // contains filtered or unexported methods }
type DecrementProposals ¶
type DecrementProposals interface { Get(ProposalID) (DecrementProposal, bool) List() []DecrementProposal // contains filtered or unexported methods }
type GetProposal ¶
type GetProposal interface { Proposal Request() *counter.GetRequest Reply(*counter.GetResponse) error // contains filtered or unexported methods }
type GetProposals ¶
type GetProposals interface { Get(ProposalID) (GetProposal, bool) List() []GetProposal // contains filtered or unexported methods }
type IncrementProposal ¶
type IncrementProposal interface { Proposal Request() *counter.IncrementRequest Reply(*counter.IncrementResponse) error // contains filtered or unexported methods }
type IncrementProposals ¶
type IncrementProposals interface { Get(ProposalID) (IncrementProposal, bool) List() []IncrementProposal // contains filtered or unexported methods }
type NewServiceFunc ¶
type NewServiceFunc func(ServiceContext) Service
type ProposalID ¶
type ProposalID uint64
type Proposals ¶
type Proposals interface { Set() SetProposals Get() GetProposals Increment() IncrementProposals Decrement() DecrementProposals }
type Service ¶
type Service interface { ServiceContext Backup(SnapshotWriter) error Restore(SnapshotReader) error // Set sets the counter value Set(SetProposal) error // Get gets the current counter value Get(GetProposal) error // Increment increments the counter value Increment(IncrementProposal) error // Decrement decrements the counter value Decrement(DecrementProposal) 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 SetProposal ¶
type SetProposal interface { Proposal Request() *counter.SetRequest Reply(*counter.SetResponse) error // contains filtered or unexported methods }
type SetProposals ¶
type SetProposals interface { Get(ProposalID) (SetProposal, bool) List() []SetProposal // contains filtered or unexported methods }
type SnapshotReader ¶
type SnapshotReader interface {
ReadState() (*CounterState, error)
}
type SnapshotWriter ¶
type SnapshotWriter interface {
WriteState(*CounterState) error
}
Click to show internal directories.
Click to hide internal directories.