pb

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthRaft        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowRaft          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupRaft = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterRaftServer

func RegisterRaftServer(s *grpc.Server, srv RaftServer)

Types

type Chunk

type Chunk struct {
	// Index specifies the chunk index.
	Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
	// Data specifies the raw chunk data.
	Data                 []byte   `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*Chunk) Descriptor

func (*Chunk) Descriptor() ([]byte, []int)

func (*Chunk) Marshal

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

func (*Chunk) MarshalTo

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

func (*Chunk) MarshalToSizedBuffer

func (m *Chunk) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Chunk) ProtoMessage

func (*Chunk) ProtoMessage()

func (*Chunk) Reset

func (m *Chunk) Reset()

func (*Chunk) Size

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

func (*Chunk) String

func (m *Chunk) String() string

func (*Chunk) Unmarshal

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

func (*Chunk) XXX_DiscardUnknown

func (m *Chunk) XXX_DiscardUnknown()

func (*Chunk) XXX_Marshal

func (m *Chunk) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Chunk) XXX_Merge

func (m *Chunk) XXX_Merge(src proto.Message)

func (*Chunk) XXX_Size

func (m *Chunk) XXX_Size() int

func (*Chunk) XXX_Unmarshal

func (m *Chunk) XXX_Unmarshal(b []byte) error

type RaftClient

type RaftClient interface {
	Message(ctx context.Context, opts ...grpc.CallOption) (Raft_MessageClient, error)
	Snapshot(ctx context.Context, opts ...grpc.CallOption) (Raft_SnapshotClient, error)
	Join(ctx context.Context, in *raftpb.Member, opts ...grpc.CallOption) (*raftpb.JoinResponse, error)
	PromoteMember(ctx context.Context, in *raftpb.Member, opts ...grpc.CallOption) (*empty.Empty, error)
}

RaftClient is the client API for Raft service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewRaftClient

func NewRaftClient(cc *grpc.ClientConn) RaftClient

type RaftServer

type RaftServer interface {
	Message(Raft_MessageServer) error
	Snapshot(Raft_SnapshotServer) error
	Join(context.Context, *raftpb.Member) (*raftpb.JoinResponse, error)
	PromoteMember(context.Context, *raftpb.Member) (*empty.Empty, error)
}

RaftServer is the server API for Raft service.

type Raft_MessageClient

type Raft_MessageClient interface {
	Send(*Chunk) error
	CloseAndRecv() (*empty.Empty, error)
	grpc.ClientStream
}

type Raft_MessageServer

type Raft_MessageServer interface {
	SendAndClose(*empty.Empty) error
	Recv() (*Chunk, error)
	grpc.ServerStream
}

type Raft_SnapshotClient

type Raft_SnapshotClient interface {
	Send(*Chunk) error
	CloseAndRecv() (*empty.Empty, error)
	grpc.ClientStream
}

type Raft_SnapshotServer

type Raft_SnapshotServer interface {
	SendAndClose(*empty.Empty) error
	Recv() (*Chunk, error)
	grpc.ServerStream
}

type UnimplementedRaftServer

type UnimplementedRaftServer struct {
}

UnimplementedRaftServer can be embedded to have forward compatible implementations.

func (*UnimplementedRaftServer) Join

func (*UnimplementedRaftServer) Message

func (*UnimplementedRaftServer) PromoteMember

func (*UnimplementedRaftServer) PromoteMember(ctx context.Context, req *raftpb.Member) (*empty.Empty, error)

func (*UnimplementedRaftServer) Snapshot

Jump to

Keyboard shortcuts

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