multiraftpb

package
v2.1.7+incompatible Latest Latest
Warning

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

Go to latest
Published: May 7, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

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

Constants

This section is empty.

Variables

View Source
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) MarshalTo

func (m *RaftProposal) MarshalTo(dAtA []byte) (int, 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) MarshalTo

func (m *RaftReadIndex) MarshalTo(dAtA []byte) (int, 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) MarshalTo

func (m *RaftResponse) MarshalTo(dAtA []byte) (int, 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) Descriptor() ([]byte, []int)

func (*Session) GetClientID

func (m *Session) GetClientID() uint64

func (*Session) GetClusterID

func (m *Session) GetClusterID() uint64

func (*Session) GetRespondedTo

func (m *Session) GetRespondedTo() uint64

func (*Session) GetSeriesID

func (m *Session) GetSeriesID() uint64

func (*Session) Marshal

func (m *Session) Marshal() (dAtA []byte, err error)

func (*Session) MarshalTo

func (m *Session) MarshalTo(dAtA []byte) (int, error)

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) Reset

func (m *Session) Reset()

func (*Session) Size

func (m *Session) Size() (n int)

func (*Session) String

func (m *Session) String() string

func (*Session) Unmarshal

func (m *Session) Unmarshal(dAtA []byte) error

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) MarshalTo

func (m *SessionRequest) MarshalTo(dAtA []byte) (int, 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) MarshalTo

func (m *SessionResponse) MarshalTo(dAtA []byte) (int, 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

Jump to

Keyboard shortcuts

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