Documentation ¶
Overview ¶
Package multiraftpb is a generated protocol buffer package.
It is generated from these files:
multiraft.proto
It has these top-level messages:
Session SessionRequest SessionResponse RaftProposal RaftReadIndex RaftResponse
Index ¶
- Variables
- func RegisterNodehostAPIServer(s *grpc.Server, srv NodehostAPIServer)
- type NodehostAPIClient
- type NodehostAPIServer
- type RaftProposal
- func (*RaftProposal) Descriptor() ([]byte, []int)
- func (m *RaftProposal) GetData() []byte
- func (m *RaftProposal) GetSession() client.Session
- func (m *RaftProposal) Marshal() (dAtA []byte, err error)
- func (m *RaftProposal) MarshalTo(dAtA []byte) (int, error)
- func (*RaftProposal) ProtoMessage()
- func (m *RaftProposal) Reset()
- func (m *RaftProposal) Size() (n int)
- func (m *RaftProposal) String() string
- func (m *RaftProposal) Unmarshal(dAtA []byte) error
- type RaftReadIndex
- func (*RaftReadIndex) Descriptor() ([]byte, []int)
- func (m *RaftReadIndex) GetClusterId() uint64
- func (m *RaftReadIndex) GetData() []byte
- func (m *RaftReadIndex) Marshal() (dAtA []byte, err error)
- func (m *RaftReadIndex) MarshalTo(dAtA []byte) (int, error)
- func (*RaftReadIndex) ProtoMessage()
- func (m *RaftReadIndex) Reset()
- func (m *RaftReadIndex) Size() (n int)
- func (m *RaftReadIndex) String() string
- func (m *RaftReadIndex) Unmarshal(dAtA []byte) error
- type RaftResponse
- func (*RaftResponse) Descriptor() ([]byte, []int)
- func (m *RaftResponse) GetData() []byte
- func (m *RaftResponse) GetResult() uint64
- func (m *RaftResponse) Marshal() (dAtA []byte, err error)
- func (m *RaftResponse) MarshalTo(dAtA []byte) (int, error)
- func (*RaftResponse) ProtoMessage()
- func (m *RaftResponse) Reset()
- func (m *RaftResponse) Size() (n int)
- func (m *RaftResponse) String() string
- func (m *RaftResponse) Unmarshal(dAtA []byte) error
- type Session
- func (*Session) Descriptor() ([]byte, []int)
- func (m *Session) GetClientID() uint64
- func (m *Session) GetClusterID() uint64
- func (m *Session) GetRespondedTo() uint64
- func (m *Session) GetSeriesID() uint64
- func (m *Session) Marshal() (dAtA []byte, err error)
- func (m *Session) MarshalTo(dAtA []byte) (int, error)
- func (*Session) ProtoMessage()
- func (m *Session) Reset()
- func (m *Session) Size() (n int)
- func (m *Session) String() string
- func (m *Session) Unmarshal(dAtA []byte) error
- type SessionRequest
- func (*SessionRequest) Descriptor() ([]byte, []int)
- func (m *SessionRequest) GetClusterId() uint64
- func (m *SessionRequest) Marshal() (dAtA []byte, err error)
- func (m *SessionRequest) MarshalTo(dAtA []byte) (int, error)
- func (*SessionRequest) ProtoMessage()
- func (m *SessionRequest) Reset()
- func (m *SessionRequest) Size() (n int)
- func (m *SessionRequest) String() string
- func (m *SessionRequest) Unmarshal(dAtA []byte) error
- type SessionResponse
- func (*SessionResponse) Descriptor() ([]byte, []int)
- func (m *SessionResponse) GetCompleted() bool
- func (m *SessionResponse) Marshal() (dAtA []byte, err error)
- func (m *SessionResponse) MarshalTo(dAtA []byte) (int, error)
- func (*SessionResponse) ProtoMessage()
- func (m *SessionResponse) Reset()
- func (m *SessionResponse) Size() (n int)
- func (m *SessionResponse) String() string
- func (m *SessionResponse) Unmarshal(dAtA []byte) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidLengthMultiraft = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowMultiraft = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterNodehostAPIServer ¶
func RegisterNodehostAPIServer(s *grpc.Server, srv NodehostAPIServer)
Types ¶
type NodehostAPIClient ¶
type NodehostAPIClient interface { // GetSession returns a new Session object ready to be used for // making new proposals. GetSession(ctx context.Context, in *SessionRequest, opts ...grpc.CallOption) (*client.Session, error) // CloseSession closes the specified Session object and removes // it from the associated Raft cluster. The Completed boolean field in // the returned SessionResponse object indicates whether the // Session object is successfully closed. CloseSession(ctx context.Context, in *client.Session, opts ...grpc.CallOption) (*SessionResponse, error) // Propose makes a proposal. When there is no error, the Result field of the // returned RaftResponse is the uint64 value returned by the Update function // of the associated IDataStore instance. Propose(ctx context.Context, in *RaftProposal, opts ...grpc.CallOption) (*RaftResponse, error) // Read makes a new linearizable read on the specified cluster. When there is // no error, the Data field of the returned RaftResponse is the returned // query result generated by the Lookup function of the associated IDataStore // instance. Read(ctx context.Context, in *RaftReadIndex, opts ...grpc.CallOption) (*RaftResponse, error) }
func NewNodehostAPIClient ¶
func NewNodehostAPIClient(cc *grpc.ClientConn) NodehostAPIClient
type NodehostAPIServer ¶
type NodehostAPIServer interface { // GetSession returns a new Session object ready to be used for // making new proposals. GetSession(context.Context, *SessionRequest) (*client.Session, error) // CloseSession closes the specified Session object and removes // it from the associated Raft cluster. The Completed boolean field in // the returned SessionResponse object indicates whether the // Session object is successfully closed. CloseSession(context.Context, *client.Session) (*SessionResponse, error) // Propose makes a proposal. When there is no error, the Result field of the // returned RaftResponse is the uint64 value returned by the Update function // of the associated IDataStore instance. Propose(context.Context, *RaftProposal) (*RaftResponse, error) // Read makes a new linearizable read on the specified cluster. When there is // no error, the Data field of the returned RaftResponse is the returned // query result generated by the Lookup function of the associated IDataStore // instance. Read(context.Context, *RaftReadIndex) (*RaftResponse, error) }
type RaftProposal ¶
type RaftProposal struct { Session client.Session `protobuf:"bytes,1,opt,name=session" json:"session"` Data []byte `protobuf:"bytes,2,opt,name=data" json:"data"` }
RaftProposal is the message used to describe the proposal to be made on the selected raft cluster.
func (*RaftProposal) Descriptor ¶
func (*RaftProposal) Descriptor() ([]byte, []int)
func (*RaftProposal) GetData ¶
func (m *RaftProposal) GetData() []byte
func (*RaftProposal) GetSession ¶
func (m *RaftProposal) GetSession() client.Session
func (*RaftProposal) Marshal ¶
func (m *RaftProposal) Marshal() (dAtA []byte, err error)
func (*RaftProposal) ProtoMessage ¶
func (*RaftProposal) ProtoMessage()
func (*RaftProposal) Reset ¶
func (m *RaftProposal) Reset()
func (*RaftProposal) Size ¶
func (m *RaftProposal) Size() (n int)
func (*RaftProposal) String ¶
func (m *RaftProposal) String() string
func (*RaftProposal) Unmarshal ¶
func (m *RaftProposal) Unmarshal(dAtA []byte) error
type RaftReadIndex ¶
type RaftReadIndex struct { ClusterId uint64 `protobuf:"varint,1,opt,name=cluster_id,json=clusterId" json:"cluster_id"` Data []byte `protobuf:"bytes,2,opt,name=data" json:"data"` }
RaftReadIndex is the message used to describe the input to the ReadIndex protocol. The ReadIndex protocol is used for making linearizable read on the selected raft cluster.
func (*RaftReadIndex) Descriptor ¶
func (*RaftReadIndex) Descriptor() ([]byte, []int)
func (*RaftReadIndex) GetClusterId ¶
func (m *RaftReadIndex) GetClusterId() uint64
func (*RaftReadIndex) GetData ¶
func (m *RaftReadIndex) GetData() []byte
func (*RaftReadIndex) Marshal ¶
func (m *RaftReadIndex) Marshal() (dAtA []byte, err error)
func (*RaftReadIndex) ProtoMessage ¶
func (*RaftReadIndex) ProtoMessage()
func (*RaftReadIndex) Reset ¶
func (m *RaftReadIndex) Reset()
func (*RaftReadIndex) Size ¶
func (m *RaftReadIndex) Size() (n int)
func (*RaftReadIndex) String ¶
func (m *RaftReadIndex) String() string
func (*RaftReadIndex) Unmarshal ¶
func (m *RaftReadIndex) Unmarshal(dAtA []byte) error
type RaftResponse ¶
type RaftResponse struct { Result uint64 `protobuf:"varint,1,opt,name=result" json:"result"` Data []byte `protobuf:"bytes,2,opt,name=data" json:"data"` }
RaftResponse is the message used to describe the response produced by the Update or Lookup function of the IDataStore instance.
func (*RaftResponse) Descriptor ¶
func (*RaftResponse) Descriptor() ([]byte, []int)
func (*RaftResponse) GetData ¶
func (m *RaftResponse) GetData() []byte
func (*RaftResponse) GetResult ¶
func (m *RaftResponse) GetResult() uint64
func (*RaftResponse) Marshal ¶
func (m *RaftResponse) Marshal() (dAtA []byte, err error)
func (*RaftResponse) ProtoMessage ¶
func (*RaftResponse) ProtoMessage()
func (*RaftResponse) Reset ¶
func (m *RaftResponse) Reset()
func (*RaftResponse) Size ¶
func (m *RaftResponse) Size() (n int)
func (*RaftResponse) String ¶
func (m *RaftResponse) String() string
func (*RaftResponse) Unmarshal ¶
func (m *RaftResponse) Unmarshal(dAtA []byte) error
type Session ¶
type Session struct { ClusterID uint64 `protobuf:"varint,1,opt,name=ClusterID" json:"ClusterID"` ClientID uint64 `protobuf:"varint,2,opt,name=ClientID" json:"ClientID"` SeriesID uint64 `protobuf:"varint,3,opt,name=SeriesID" json:"SeriesID"` RespondedTo uint64 `protobuf:"varint,4,opt,name=RespondedTo" json:"RespondedTo"` }
Session is the session object used to track proposals for the specified raft cluster. SeriesID is a sequential id used to identify proposals, RespondedTo is a sequential id used to track the last responded proposal.
func (*Session) Descriptor ¶
func (*Session) GetClientID ¶
func (*Session) GetClusterID ¶
func (*Session) GetRespondedTo ¶
func (*Session) GetSeriesID ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
type SessionRequest ¶
type SessionRequest struct {
ClusterId uint64 `protobuf:"varint,1,req,name=cluster_id,json=clusterId" json:"cluster_id"`
}
SessionRequest is the message used to specified the interested raft cluster.
func (*SessionRequest) Descriptor ¶
func (*SessionRequest) Descriptor() ([]byte, []int)
func (*SessionRequest) GetClusterId ¶
func (m *SessionRequest) GetClusterId() uint64
func (*SessionRequest) Marshal ¶
func (m *SessionRequest) Marshal() (dAtA []byte, err error)
func (*SessionRequest) ProtoMessage ¶
func (*SessionRequest) ProtoMessage()
func (*SessionRequest) Reset ¶
func (m *SessionRequest) Reset()
func (*SessionRequest) Size ¶
func (m *SessionRequest) Size() (n int)
func (*SessionRequest) String ¶
func (m *SessionRequest) String() string
func (*SessionRequest) Unmarshal ¶
func (m *SessionRequest) Unmarshal(dAtA []byte) error
type SessionResponse ¶
type SessionResponse struct {
Completed bool `protobuf:"varint,1,req,name=completed" json:"completed"`
}
SessionResponse is the message used to indicate whether the Session object is successfully closed.
func (*SessionResponse) Descriptor ¶
func (*SessionResponse) Descriptor() ([]byte, []int)
func (*SessionResponse) GetCompleted ¶
func (m *SessionResponse) GetCompleted() bool
func (*SessionResponse) Marshal ¶
func (m *SessionResponse) Marshal() (dAtA []byte, err error)
func (*SessionResponse) ProtoMessage ¶
func (*SessionResponse) ProtoMessage()
func (*SessionResponse) Reset ¶
func (m *SessionResponse) Reset()
func (*SessionResponse) Size ¶
func (m *SessionResponse) Size() (n int)
func (*SessionResponse) String ¶
func (m *SessionResponse) String() string
func (*SessionResponse) Unmarshal ¶
func (m *SessionResponse) Unmarshal(dAtA []byte) error