Documentation
¶
Index ¶
- Variables
- func RegisterRaftServer(s *grpc.Server, srv RaftServer)
- type Empty
- func (*Empty) Descriptor() ([]byte, []int)
- func (m *Empty) Marshal() (dAtA []byte, err error)
- func (m *Empty) MarshalTo(dAtA []byte) (int, error)
- func (*Empty) ProtoMessage()
- func (m *Empty) Reset()
- func (m *Empty) Size() (n int)
- func (m *Empty) String() string
- func (m *Empty) Unmarshal(dAtA []byte) error
- func (m *Empty) XXX_DiscardUnknown()
- func (m *Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Empty) XXX_Merge(src proto.Message)
- func (m *Empty) XXX_Size() int
- func (m *Empty) XXX_Unmarshal(b []byte) error
- type Entry
- func (*Entry) Descriptor() ([]byte, []int)
- func (m *Entry) GetData() []byte
- func (m *Entry) GetIndex() uint64
- func (m *Entry) Marshal() (dAtA []byte, err error)
- func (m *Entry) MarshalTo(dAtA []byte) (int, error)
- func (*Entry) ProtoMessage()
- func (m *Entry) Reset()
- func (m *Entry) Size() (n int)
- func (m *Entry) String() string
- func (m *Entry) Unmarshal(dAtA []byte) error
- func (m *Entry) XXX_DiscardUnknown()
- func (m *Entry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Entry) XXX_Merge(src proto.Message)
- func (m *Entry) XXX_Size() int
- func (m *Entry) XXX_Unmarshal(b []byte) error
- type Peer
- func (*Peer) Descriptor() ([]byte, []int)
- func (m *Peer) GetAddress() []byte
- func (m *Peer) GetId() uint64
- func (m *Peer) Marshal() (dAtA []byte, err error)
- func (m *Peer) MarshalTo(dAtA []byte) (int, error)
- func (*Peer) ProtoMessage()
- func (m *Peer) Reset()
- func (m *Peer) Size() (n int)
- func (m *Peer) String() string
- func (m *Peer) Unmarshal(dAtA []byte) error
- func (m *Peer) XXX_DiscardUnknown()
- func (m *Peer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Peer) XXX_Merge(src proto.Message)
- func (m *Peer) XXX_Size() int
- func (m *Peer) XXX_Unmarshal(b []byte) error
- type PeerID
- func (*PeerID) Descriptor() ([]byte, []int)
- func (m *PeerID) GetAddress() []byte
- func (m *PeerID) Marshal() (dAtA []byte, err error)
- func (m *PeerID) MarshalTo(dAtA []byte) (int, error)
- func (*PeerID) ProtoMessage()
- func (m *PeerID) Reset()
- func (m *PeerID) Size() (n int)
- func (m *PeerID) String() string
- func (m *PeerID) Unmarshal(dAtA []byte) error
- func (m *PeerID) XXX_DiscardUnknown()
- func (m *PeerID) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *PeerID) XXX_Merge(src proto.Message)
- func (m *PeerID) XXX_Size() int
- func (m *PeerID) XXX_Unmarshal(b []byte) error
- type Proposal
- func (*Proposal) Descriptor() ([]byte, []int)
- func (m *Proposal) GetData() []byte
- func (m *Proposal) Marshal() (dAtA []byte, err error)
- func (m *Proposal) MarshalTo(dAtA []byte) (int, error)
- func (*Proposal) ProtoMessage()
- func (m *Proposal) Reset()
- func (m *Proposal) Size() (n int)
- func (m *Proposal) String() string
- func (m *Proposal) Unmarshal(dAtA []byte) error
- func (m *Proposal) XXX_DiscardUnknown()
- func (m *Proposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Proposal) XXX_Merge(src proto.Message)
- func (m *Proposal) XXX_Size() int
- func (m *Proposal) XXX_Unmarshal(b []byte) error
- type RaftClient
- type RaftServer
- type Raft_DiscoverClient
- type Raft_DiscoverServer
- type Raft_LogClient
- type Raft_LogServer
- type Raft_PeersClient
- type Raft_PeersServer
- type StatusInfo
- func (*StatusInfo) Descriptor() ([]byte, []int)
- func (m *StatusInfo) GetId() uint64
- func (m *StatusInfo) GetRunning() bool
- func (m *StatusInfo) Marshal() (dAtA []byte, err error)
- func (m *StatusInfo) MarshalTo(dAtA []byte) (int, error)
- func (*StatusInfo) ProtoMessage()
- func (m *StatusInfo) Reset()
- func (m *StatusInfo) Size() (n int)
- func (m *StatusInfo) String() string
- func (m *StatusInfo) Unmarshal(dAtA []byte) error
- func (m *StatusInfo) XXX_DiscardUnknown()
- func (m *StatusInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *StatusInfo) XXX_Merge(src proto.Message)
- func (m *StatusInfo) XXX_Size() int
- func (m *StatusInfo) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthRaft = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowRaft = fmt.Errorf("proto: integer overflow") )
Functions ¶
func RegisterRaftServer ¶
func RegisterRaftServer(s *grpc.Server, srv RaftServer)
Types ¶
type Empty ¶
type Empty struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *Empty) XXX_DiscardUnknown()
func (*Empty) XXX_Marshal ¶ added in v0.2.0
func (*Empty) XXX_Unmarshal ¶ added in v0.2.0
type Entry ¶
type Entry struct {
Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
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 (*Entry) Descriptor ¶
func (*Entry) ProtoMessage ¶
func (*Entry) ProtoMessage()
func (*Entry) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *Entry) XXX_DiscardUnknown()
func (*Entry) XXX_Marshal ¶ added in v0.2.0
func (*Entry) XXX_Unmarshal ¶ added in v0.2.0
type Peer ¶
type Peer struct {
Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Address []byte `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Peer) Descriptor ¶
func (*Peer) GetAddress ¶
func (*Peer) ProtoMessage ¶
func (*Peer) ProtoMessage()
func (*Peer) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *Peer) XXX_DiscardUnknown()
func (*Peer) XXX_Marshal ¶ added in v0.2.0
func (*Peer) XXX_Unmarshal ¶ added in v0.2.0
type PeerID ¶
type PeerID struct {
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*PeerID) Descriptor ¶
func (*PeerID) GetAddress ¶
func (*PeerID) ProtoMessage ¶
func (*PeerID) ProtoMessage()
func (*PeerID) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *PeerID) XXX_DiscardUnknown()
func (*PeerID) XXX_Marshal ¶ added in v0.2.0
func (*PeerID) XXX_Unmarshal ¶ added in v0.2.0
type Proposal ¶
type Proposal struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Proposal) Descriptor ¶
func (*Proposal) ProtoMessage ¶
func (*Proposal) ProtoMessage()
func (*Proposal) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *Proposal) XXX_DiscardUnknown()
func (*Proposal) XXX_Marshal ¶ added in v0.2.0
func (*Proposal) XXX_Unmarshal ¶ added in v0.2.0
type RaftClient ¶
type RaftClient interface {
Start(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
Stop(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
Status(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*StatusInfo, error)
Peers(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Raft_PeersClient, error)
Discover(ctx context.Context, in *PeerID, opts ...grpc.CallOption) (Raft_DiscoverClient, error)
Invite(ctx context.Context, in *PeerID, opts ...grpc.CallOption) (*Empty, error)
Join(ctx context.Context, in *PeerID, opts ...grpc.CallOption) (*Empty, error)
Expel(ctx context.Context, in *PeerID, opts ...grpc.CallOption) (*Empty, error)
Propose(ctx context.Context, in *Proposal, opts ...grpc.CallOption) (*Empty, error)
Log(ctx context.Context, in *Empty, opts ...grpc.CallOption) (Raft_LogClient, error)
}
func NewRaftClient ¶
func NewRaftClient(cc *grpc.ClientConn) RaftClient
type RaftServer ¶
type RaftServer interface {
Start(context.Context, *Empty) (*Empty, error)
Stop(context.Context, *Empty) (*Empty, error)
Status(context.Context, *Empty) (*StatusInfo, error)
Peers(*Empty, Raft_PeersServer) error
Discover(*PeerID, Raft_DiscoverServer) error
Invite(context.Context, *PeerID) (*Empty, error)
Join(context.Context, *PeerID) (*Empty, error)
Expel(context.Context, *PeerID) (*Empty, error)
Propose(context.Context, *Proposal) (*Empty, error)
Log(*Empty, Raft_LogServer) error
}
type Raft_DiscoverClient ¶
type Raft_DiscoverClient interface {
Recv() (*Peer, error)
grpc.ClientStream
}
type Raft_DiscoverServer ¶
type Raft_DiscoverServer interface {
Send(*Peer) error
grpc.ServerStream
}
type Raft_LogClient ¶
type Raft_LogClient interface {
Recv() (*Entry, error)
grpc.ClientStream
}
type Raft_LogServer ¶
type Raft_LogServer interface {
Send(*Entry) error
grpc.ServerStream
}
type Raft_PeersClient ¶
type Raft_PeersClient interface {
Recv() (*Peer, error)
grpc.ClientStream
}
type Raft_PeersServer ¶
type Raft_PeersServer interface {
Send(*Peer) error
grpc.ServerStream
}
type StatusInfo ¶
type StatusInfo struct {
Running bool `protobuf:"varint,1,opt,name=running,proto3" json:"running,omitempty"`
Id uint64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*StatusInfo) Descriptor ¶
func (*StatusInfo) Descriptor() ([]byte, []int)
func (*StatusInfo) GetId ¶
func (m *StatusInfo) GetId() uint64
func (*StatusInfo) GetRunning ¶
func (m *StatusInfo) GetRunning() bool
func (*StatusInfo) Marshal ¶
func (m *StatusInfo) Marshal() (dAtA []byte, err error)
func (*StatusInfo) ProtoMessage ¶
func (*StatusInfo) ProtoMessage()
func (*StatusInfo) Reset ¶
func (m *StatusInfo) Reset()
func (*StatusInfo) Size ¶
func (m *StatusInfo) Size() (n int)
func (*StatusInfo) String ¶
func (m *StatusInfo) String() string
func (*StatusInfo) Unmarshal ¶
func (m *StatusInfo) Unmarshal(dAtA []byte) error
func (*StatusInfo) XXX_DiscardUnknown ¶ added in v0.2.0
func (m *StatusInfo) XXX_DiscardUnknown()
func (*StatusInfo) XXX_Marshal ¶ added in v0.2.0
func (m *StatusInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*StatusInfo) XXX_Merge ¶ added in v0.2.0
func (dst *StatusInfo) XXX_Merge(src proto.Message)
func (*StatusInfo) XXX_Size ¶ added in v0.2.0
func (m *StatusInfo) XXX_Size() int
func (*StatusInfo) XXX_Unmarshal ¶ added in v0.2.0
func (m *StatusInfo) XXX_Unmarshal(b []byte) error
Click to show internal directories.
Click to hide internal directories.