protocol

package
v0.0.0-...-f429149 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCluster = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCluster   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthLog = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLog   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthMetadata = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowMetadata   = fmt.Errorf("proto: integer overflow")
)
View Source
var (
	ErrInvalidLengthProtocol = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowProtocol   = fmt.Errorf("proto: integer overflow")
)
View Source
var Member_Type_name = map[int32]string{
	0: "INACTIVE",
	1: "PASSIVE",
	2: "PROMOTABLE",
	3: "ACTIVE",
}
View Source
var Member_Type_value = map[string]int32{
	"INACTIVE":   0,
	"PASSIVE":    1,
	"PROMOTABLE": 2,
	"ACTIVE":     3,
}
View Source
var ReadConsistency_name = map[int32]string{
	0: "SEQUENTIAL",
	1: "LINEARIZABLE_LEASE",
	2: "LINEARIZABLE",
}
View Source
var ReadConsistency_value = map[string]int32{
	"SEQUENTIAL":         0,
	"LINEARIZABLE_LEASE": 1,
	"LINEARIZABLE":       2,
}
View Source
var ResponseError_name = map[int32]string{
	0:  "NO_LEADER",
	1:  "QUERY_FAILURE",
	2:  "COMMAND_FAILURE",
	3:  "APPLICATION_ERROR",
	4:  "ILLEGAL_MEMBER_STATE",
	5:  "UNKNOWN_CLIENT",
	6:  "UNKNOWN_SESSION",
	7:  "UNKNOWN_SERVICE",
	8:  "CLOSED_SESSION",
	9:  "PROTOCOL_ERROR",
	10: "CONFIGURATION_ERROR",
	11: "UNAVAILABLE",
}
View Source
var ResponseError_value = map[string]int32{
	"NO_LEADER":            0,
	"QUERY_FAILURE":        1,
	"COMMAND_FAILURE":      2,
	"APPLICATION_ERROR":    3,
	"ILLEGAL_MEMBER_STATE": 4,
	"UNKNOWN_CLIENT":       5,
	"UNKNOWN_SESSION":      6,
	"UNKNOWN_SERVICE":      7,
	"CLOSED_SESSION":       8,
	"PROTOCOL_ERROR":       9,
	"CONFIGURATION_ERROR":  10,
	"UNAVAILABLE":          11,
}
View Source
var ResponseStatus_name = map[int32]string{
	0: "OK",
	1: "ERROR",
}
View Source
var ResponseStatus_value = map[string]int32{
	"OK":    0,
	"ERROR": 1,
}

Functions

func RegisterRaftServiceServer

func RegisterRaftServiceServer(s *grpc.Server, srv RaftServiceServer)

Types

type AppendRequest

type AppendRequest struct {
	Term         Term        `protobuf:"varint,1,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Leader       MemberID    `protobuf:"bytes,2,opt,name=leader,proto3,casttype=MemberID" json:"leader,omitempty"`
	PrevLogIndex Index       `protobuf:"varint,3,opt,name=prev_log_index,json=prevLogIndex,proto3,casttype=Index" json:"prev_log_index,omitempty"`
	PrevLogTerm  Term        `protobuf:"varint,4,opt,name=prev_log_term,json=prevLogTerm,proto3,casttype=Term" json:"prev_log_term,omitempty"`
	Entries      []*LogEntry `protobuf:"bytes,5,rep,name=entries,proto3" json:"entries,omitempty"`
	CommitIndex  Index       `protobuf:"varint,6,opt,name=commit_index,json=commitIndex,proto3,casttype=Index" json:"commit_index,omitempty"`
}

func NewPopulatedAppendRequest

func NewPopulatedAppendRequest(r randyProtocol, easy bool) *AppendRequest

func (*AppendRequest) Descriptor

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

func (*AppendRequest) Equal

func (this *AppendRequest) Equal(that interface{}) bool

func (*AppendRequest) GetCommitIndex

func (m *AppendRequest) GetCommitIndex() Index

func (*AppendRequest) GetEntries

func (m *AppendRequest) GetEntries() []*LogEntry

func (*AppendRequest) GetLeader

func (m *AppendRequest) GetLeader() MemberID

func (*AppendRequest) GetPrevLogIndex

func (m *AppendRequest) GetPrevLogIndex() Index

func (*AppendRequest) GetPrevLogTerm

func (m *AppendRequest) GetPrevLogTerm() Term

func (*AppendRequest) GetTerm

func (m *AppendRequest) GetTerm() Term

func (*AppendRequest) Marshal

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

func (*AppendRequest) MarshalTo

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

func (*AppendRequest) MarshalToSizedBuffer

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

func (*AppendRequest) ProtoMessage

func (*AppendRequest) ProtoMessage()

func (*AppendRequest) Reset

func (m *AppendRequest) Reset()

func (*AppendRequest) Size

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

func (*AppendRequest) String

func (m *AppendRequest) String() string

func (*AppendRequest) Unmarshal

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

func (*AppendRequest) XXX_DiscardUnknown

func (m *AppendRequest) XXX_DiscardUnknown()

func (*AppendRequest) XXX_Marshal

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

func (*AppendRequest) XXX_Merge

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

func (*AppendRequest) XXX_Size

func (m *AppendRequest) XXX_Size() int

func (*AppendRequest) XXX_Unmarshal

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

type AppendResponse

type AppendResponse struct {
	Status       ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error        ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Term         Term           `protobuf:"varint,3,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Succeeded    bool           `protobuf:"varint,4,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
	LastLogIndex Index          `protobuf:"varint,5,opt,name=last_log_index,json=lastLogIndex,proto3,casttype=Index" json:"last_log_index,omitempty"`
}

func NewPopulatedAppendResponse

func NewPopulatedAppendResponse(r randyProtocol, easy bool) *AppendResponse

func (*AppendResponse) Descriptor

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

func (*AppendResponse) Equal

func (this *AppendResponse) Equal(that interface{}) bool

func (*AppendResponse) GetError

func (m *AppendResponse) GetError() ResponseError

func (*AppendResponse) GetLastLogIndex

func (m *AppendResponse) GetLastLogIndex() Index

func (*AppendResponse) GetStatus

func (m *AppendResponse) GetStatus() ResponseStatus

func (*AppendResponse) GetSucceeded

func (m *AppendResponse) GetSucceeded() bool

func (*AppendResponse) GetTerm

func (m *AppendResponse) GetTerm() Term

func (*AppendResponse) Marshal

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

func (*AppendResponse) MarshalTo

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

func (*AppendResponse) MarshalToSizedBuffer

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

func (*AppendResponse) ProtoMessage

func (*AppendResponse) ProtoMessage()

func (*AppendResponse) Reset

func (m *AppendResponse) Reset()

func (*AppendResponse) Size

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

func (*AppendResponse) String

func (m *AppendResponse) String() string

func (*AppendResponse) Unmarshal

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

func (*AppendResponse) XXX_DiscardUnknown

func (m *AppendResponse) XXX_DiscardUnknown()

func (*AppendResponse) XXX_Marshal

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

func (*AppendResponse) XXX_Merge

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

func (*AppendResponse) XXX_Size

func (m *AppendResponse) XXX_Size() int

func (*AppendResponse) XXX_Unmarshal

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

type Client

type Client interface {
	// Join sends a join request
	Join(ctx context.Context, request *JoinRequest, member MemberID) (*JoinResponse, error)

	// Leave sends a leave request
	Leave(ctx context.Context, request *LeaveRequest, member MemberID) (*LeaveResponse, error)

	// Configure sends a configure request
	Configure(ctx context.Context, request *ConfigureRequest, member MemberID) (*ConfigureResponse, error)

	// Reconfigure sends a reconfigure request
	Reconfigure(ctx context.Context, request *ReconfigureRequest, member MemberID) (*ReconfigureResponse, error)

	// Poll sends a poll request
	Poll(ctx context.Context, request *PollRequest, member MemberID) (*PollResponse, error)

	// Vote sends a vote request
	Vote(ctx context.Context, request *VoteRequest, member MemberID) (*VoteResponse, error)

	// Transfer sends a leadership transfer request
	Transfer(ctx context.Context, request *TransferRequest, member MemberID) (*TransferResponse, error)

	// Append sends an append request
	Append(ctx context.Context, request *AppendRequest, member MemberID) (*AppendResponse, error)

	// Install sends a stream of install requests
	Install(ctx context.Context, member MemberID) (chan<- *InstallRequest, <-chan *InstallStreamResponse, error)

	// Command sends a command request
	Command(ctx context.Context, request *CommandRequest, member MemberID) (<-chan *CommandStreamResponse, error)

	// Query sends a query request
	Query(ctx context.Context, request *QueryRequest, member MemberID) (<-chan *QueryStreamResponse, error)
}

Client is an interface for sending messages to Raft nodes

func NewClient

func NewClient(cluster Cluster) Client

NewClient creates a new Raft protocol client

type Cluster

type Cluster interface {
	// Member returns the local member ID
	Member() MemberID

	// Members returns a list of all members in the Raft cluster
	Members() []MemberID

	// GetMember returns a Member by ID
	GetMember(memberID MemberID) *Member

	// GetClient gets a RaftServiceClient connection for the given member
	GetClient(memberID MemberID) (RaftServiceClient, error)
}

Cluster provides cluster information for the Raft protocol

func NewCluster

func NewCluster(config node.Cluster) Cluster

NewCluster returns a new Cluster with the given configuration

type CommandEntry

type CommandEntry struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

func NewPopulatedCommandEntry

func NewPopulatedCommandEntry(r randyLog, easy bool) *CommandEntry

func (*CommandEntry) Descriptor

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

func (*CommandEntry) Equal

func (this *CommandEntry) Equal(that interface{}) bool

func (*CommandEntry) GetValue

func (m *CommandEntry) GetValue() []byte

func (*CommandEntry) Marshal

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

func (*CommandEntry) MarshalTo

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

func (*CommandEntry) MarshalToSizedBuffer

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

func (*CommandEntry) ProtoMessage

func (*CommandEntry) ProtoMessage()

func (*CommandEntry) Reset

func (m *CommandEntry) Reset()

func (*CommandEntry) Size

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

func (*CommandEntry) String

func (m *CommandEntry) String() string

func (*CommandEntry) Unmarshal

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

func (*CommandEntry) XXX_DiscardUnknown

func (m *CommandEntry) XXX_DiscardUnknown()

func (*CommandEntry) XXX_Marshal

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

func (*CommandEntry) XXX_Merge

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

func (*CommandEntry) XXX_Size

func (m *CommandEntry) XXX_Size() int

func (*CommandEntry) XXX_Unmarshal

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

type CommandRequest

type CommandRequest struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

func NewPopulatedCommandRequest

func NewPopulatedCommandRequest(r randyProtocol, easy bool) *CommandRequest

func (*CommandRequest) Descriptor

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

func (*CommandRequest) Equal

func (this *CommandRequest) Equal(that interface{}) bool

func (*CommandRequest) GetValue

func (m *CommandRequest) GetValue() []byte

func (*CommandRequest) Marshal

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

func (*CommandRequest) MarshalTo

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

func (*CommandRequest) MarshalToSizedBuffer

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

func (*CommandRequest) ProtoMessage

func (*CommandRequest) ProtoMessage()

func (*CommandRequest) Reset

func (m *CommandRequest) Reset()

func (*CommandRequest) Size

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

func (*CommandRequest) String

func (m *CommandRequest) String() string

func (*CommandRequest) Unmarshal

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

func (*CommandRequest) XXX_DiscardUnknown

func (m *CommandRequest) XXX_DiscardUnknown()

func (*CommandRequest) XXX_Marshal

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

func (*CommandRequest) XXX_Merge

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

func (*CommandRequest) XXX_Size

func (m *CommandRequest) XXX_Size() int

func (*CommandRequest) XXX_Unmarshal

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

type CommandResponse

type CommandResponse struct {
	Status  ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error   ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Message string         `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Leader  MemberID       `protobuf:"bytes,4,opt,name=leader,proto3,casttype=MemberID" json:"leader,omitempty"`
	Term    Term           `protobuf:"varint,5,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Members []MemberID     `protobuf:"bytes,6,rep,name=members,proto3,casttype=MemberID" json:"members,omitempty"`
	Output  []byte         `protobuf:"bytes,7,opt,name=output,proto3" json:"output,omitempty"`
}

func NewPopulatedCommandResponse

func NewPopulatedCommandResponse(r randyProtocol, easy bool) *CommandResponse

func (*CommandResponse) Descriptor

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

func (*CommandResponse) Equal

func (this *CommandResponse) Equal(that interface{}) bool

func (*CommandResponse) GetError

func (m *CommandResponse) GetError() ResponseError

func (*CommandResponse) GetLeader

func (m *CommandResponse) GetLeader() MemberID

func (*CommandResponse) GetMembers

func (m *CommandResponse) GetMembers() []MemberID

func (*CommandResponse) GetMessage

func (m *CommandResponse) GetMessage() string

func (*CommandResponse) GetOutput

func (m *CommandResponse) GetOutput() []byte

func (*CommandResponse) GetStatus

func (m *CommandResponse) GetStatus() ResponseStatus

func (*CommandResponse) GetTerm

func (m *CommandResponse) GetTerm() Term

func (*CommandResponse) Marshal

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

func (*CommandResponse) MarshalTo

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

func (*CommandResponse) MarshalToSizedBuffer

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

func (*CommandResponse) ProtoMessage

func (*CommandResponse) ProtoMessage()

func (*CommandResponse) Reset

func (m *CommandResponse) Reset()

func (*CommandResponse) Size

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

func (*CommandResponse) String

func (m *CommandResponse) String() string

func (*CommandResponse) Unmarshal

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

func (*CommandResponse) XXX_DiscardUnknown

func (m *CommandResponse) XXX_DiscardUnknown()

func (*CommandResponse) XXX_Marshal

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

func (*CommandResponse) XXX_Merge

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

func (*CommandResponse) XXX_Size

func (m *CommandResponse) XXX_Size() int

func (*CommandResponse) XXX_Unmarshal

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

type CommandStreamResponse

type CommandStreamResponse struct {
	*StreamMessage
	Response *CommandResponse
}

CommandStreamResponse is a stream response for CommandRequest

func NewCommandStreamResponse

func NewCommandStreamResponse(response *CommandResponse, err error) *CommandStreamResponse

NewCommandStreamResponse returns a new CommandStreamResponse with the given response and error

type Configuration

type Configuration struct {
	Index     Index      `protobuf:"varint,1,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Term      Term       `protobuf:"varint,2,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Timestamp *time.Time `protobuf:"bytes,3,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"`
	Members   []*Member  `protobuf:"bytes,4,rep,name=members,proto3" json:"members,omitempty"`
}

Raft system configuration

func NewPopulatedConfiguration

func NewPopulatedConfiguration(r randyMetadata, easy bool) *Configuration

func (*Configuration) Descriptor

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

func (*Configuration) Equal

func (this *Configuration) Equal(that interface{}) bool

func (*Configuration) GetIndex

func (m *Configuration) GetIndex() Index

func (*Configuration) GetMembers

func (m *Configuration) GetMembers() []*Member

func (*Configuration) GetTerm

func (m *Configuration) GetTerm() Term

func (*Configuration) GetTimestamp

func (m *Configuration) GetTimestamp() *time.Time

func (*Configuration) Marshal

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

func (*Configuration) MarshalTo

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

func (*Configuration) MarshalToSizedBuffer

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

func (*Configuration) ProtoMessage

func (*Configuration) ProtoMessage()

func (*Configuration) Reset

func (m *Configuration) Reset()

func (*Configuration) Size

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

func (*Configuration) String

func (m *Configuration) String() string

func (*Configuration) Unmarshal

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

func (*Configuration) XXX_DiscardUnknown

func (m *Configuration) XXX_DiscardUnknown()

func (*Configuration) XXX_Marshal

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

func (*Configuration) XXX_Merge

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

func (*Configuration) XXX_Size

func (m *Configuration) XXX_Size() int

func (*Configuration) XXX_Unmarshal

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

type ConfigurationEntry

type ConfigurationEntry struct {
	Members []*Member `protobuf:"bytes,1,rep,name=members,proto3" json:"members,omitempty"`
}

func NewPopulatedConfigurationEntry

func NewPopulatedConfigurationEntry(r randyLog, easy bool) *ConfigurationEntry

func (*ConfigurationEntry) Descriptor

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

func (*ConfigurationEntry) Equal

func (this *ConfigurationEntry) Equal(that interface{}) bool

func (*ConfigurationEntry) GetMembers

func (m *ConfigurationEntry) GetMembers() []*Member

func (*ConfigurationEntry) Marshal

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

func (*ConfigurationEntry) MarshalTo

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

func (*ConfigurationEntry) MarshalToSizedBuffer

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

func (*ConfigurationEntry) ProtoMessage

func (*ConfigurationEntry) ProtoMessage()

func (*ConfigurationEntry) Reset

func (m *ConfigurationEntry) Reset()

func (*ConfigurationEntry) Size

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

func (*ConfigurationEntry) String

func (m *ConfigurationEntry) String() string

func (*ConfigurationEntry) Unmarshal

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

func (*ConfigurationEntry) XXX_DiscardUnknown

func (m *ConfigurationEntry) XXX_DiscardUnknown()

func (*ConfigurationEntry) XXX_Marshal

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

func (*ConfigurationEntry) XXX_Merge

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

func (*ConfigurationEntry) XXX_Size

func (m *ConfigurationEntry) XXX_Size() int

func (*ConfigurationEntry) XXX_Unmarshal

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

type ConfigureRequest

type ConfigureRequest struct {
	Term      Term      `protobuf:"varint,1,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Leader    MemberID  `protobuf:"bytes,2,opt,name=leader,proto3,casttype=MemberID" json:"leader,omitempty"`
	Index     Index     `protobuf:"varint,3,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Timestamp time.Time `protobuf:"bytes,4,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
	Members   []*Member `protobuf:"bytes,5,rep,name=members,proto3" json:"members,omitempty"`
}

func NewPopulatedConfigureRequest

func NewPopulatedConfigureRequest(r randyProtocol, easy bool) *ConfigureRequest

func (*ConfigureRequest) Descriptor

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

func (*ConfigureRequest) Equal

func (this *ConfigureRequest) Equal(that interface{}) bool

func (*ConfigureRequest) GetIndex

func (m *ConfigureRequest) GetIndex() Index

func (*ConfigureRequest) GetLeader

func (m *ConfigureRequest) GetLeader() MemberID

func (*ConfigureRequest) GetMembers

func (m *ConfigureRequest) GetMembers() []*Member

func (*ConfigureRequest) GetTerm

func (m *ConfigureRequest) GetTerm() Term

func (*ConfigureRequest) GetTimestamp

func (m *ConfigureRequest) GetTimestamp() time.Time

func (*ConfigureRequest) Marshal

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

func (*ConfigureRequest) MarshalTo

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

func (*ConfigureRequest) MarshalToSizedBuffer

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

func (*ConfigureRequest) ProtoMessage

func (*ConfigureRequest) ProtoMessage()

func (*ConfigureRequest) Reset

func (m *ConfigureRequest) Reset()

func (*ConfigureRequest) Size

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

func (*ConfigureRequest) String

func (m *ConfigureRequest) String() string

func (*ConfigureRequest) Unmarshal

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

func (*ConfigureRequest) XXX_DiscardUnknown

func (m *ConfigureRequest) XXX_DiscardUnknown()

func (*ConfigureRequest) XXX_Marshal

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

func (*ConfigureRequest) XXX_Merge

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

func (*ConfigureRequest) XXX_Size

func (m *ConfigureRequest) XXX_Size() int

func (*ConfigureRequest) XXX_Unmarshal

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

type ConfigureResponse

type ConfigureResponse struct {
	Status ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error  ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
}

func NewPopulatedConfigureResponse

func NewPopulatedConfigureResponse(r randyProtocol, easy bool) *ConfigureResponse

func (*ConfigureResponse) Descriptor

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

func (*ConfigureResponse) Equal

func (this *ConfigureResponse) Equal(that interface{}) bool

func (*ConfigureResponse) GetError

func (m *ConfigureResponse) GetError() ResponseError

func (*ConfigureResponse) GetStatus

func (m *ConfigureResponse) GetStatus() ResponseStatus

func (*ConfigureResponse) Marshal

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

func (*ConfigureResponse) MarshalTo

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

func (*ConfigureResponse) MarshalToSizedBuffer

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

func (*ConfigureResponse) ProtoMessage

func (*ConfigureResponse) ProtoMessage()

func (*ConfigureResponse) Reset

func (m *ConfigureResponse) Reset()

func (*ConfigureResponse) Size

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

func (*ConfigureResponse) String

func (m *ConfigureResponse) String() string

func (*ConfigureResponse) Unmarshal

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

func (*ConfigureResponse) XXX_DiscardUnknown

func (m *ConfigureResponse) XXX_DiscardUnknown()

func (*ConfigureResponse) XXX_Marshal

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

func (*ConfigureResponse) XXX_Merge

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

func (*ConfigureResponse) XXX_Size

func (m *ConfigureResponse) XXX_Size() int

func (*ConfigureResponse) XXX_Unmarshal

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

type Event

type Event struct {
	Type   EventType
	Status Status
	Role   RoleType
	Term   Term
	Leader *MemberID
}

Event is a Raft protocol state change event

type EventType

type EventType string

EventType is a Raft protocol state change event type

const (
	// EventTypeStatus is a status change event
	EventTypeStatus EventType = "Status"

	// EventTypeRole is a role change event
	EventTypeRole EventType = "Role"

	// EventTypeTerm is a term change event
	EventTypeTerm EventType = "Term"

	// EventTypeLeader is a leader change event
	EventTypeLeader EventType = "Leader"
)

type Index

type Index uint64

Index is a Raft log index

type InitializeEntry

type InitializeEntry struct {
}

func NewPopulatedInitializeEntry

func NewPopulatedInitializeEntry(r randyLog, easy bool) *InitializeEntry

func (*InitializeEntry) Descriptor

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

func (*InitializeEntry) Equal

func (this *InitializeEntry) Equal(that interface{}) bool

func (*InitializeEntry) Marshal

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

func (*InitializeEntry) MarshalTo

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

func (*InitializeEntry) MarshalToSizedBuffer

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

func (*InitializeEntry) ProtoMessage

func (*InitializeEntry) ProtoMessage()

func (*InitializeEntry) Reset

func (m *InitializeEntry) Reset()

func (*InitializeEntry) Size

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

func (*InitializeEntry) String

func (m *InitializeEntry) String() string

func (*InitializeEntry) Unmarshal

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

func (*InitializeEntry) XXX_DiscardUnknown

func (m *InitializeEntry) XXX_DiscardUnknown()

func (*InitializeEntry) XXX_Marshal

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

func (*InitializeEntry) XXX_Merge

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

func (*InitializeEntry) XXX_Size

func (m *InitializeEntry) XXX_Size() int

func (*InitializeEntry) XXX_Unmarshal

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

type InstallRequest

type InstallRequest struct {
	Term      Term      `protobuf:"varint,1,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Leader    MemberID  `protobuf:"bytes,2,opt,name=leader,proto3,casttype=MemberID" json:"leader,omitempty"`
	Index     Index     `protobuf:"varint,3,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Timestamp time.Time `protobuf:"bytes,4,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
	Data      []byte    `protobuf:"bytes,5,opt,name=data,proto3" json:"data,omitempty"`
}

func NewPopulatedInstallRequest

func NewPopulatedInstallRequest(r randyProtocol, easy bool) *InstallRequest

func (*InstallRequest) Descriptor

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

func (*InstallRequest) Equal

func (this *InstallRequest) Equal(that interface{}) bool

func (*InstallRequest) GetData

func (m *InstallRequest) GetData() []byte

func (*InstallRequest) GetIndex

func (m *InstallRequest) GetIndex() Index

func (*InstallRequest) GetLeader

func (m *InstallRequest) GetLeader() MemberID

func (*InstallRequest) GetTerm

func (m *InstallRequest) GetTerm() Term

func (*InstallRequest) GetTimestamp

func (m *InstallRequest) GetTimestamp() time.Time

func (*InstallRequest) Marshal

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

func (*InstallRequest) MarshalTo

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

func (*InstallRequest) MarshalToSizedBuffer

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

func (*InstallRequest) ProtoMessage

func (*InstallRequest) ProtoMessage()

func (*InstallRequest) Reset

func (m *InstallRequest) Reset()

func (*InstallRequest) Size

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

func (*InstallRequest) String

func (m *InstallRequest) String() string

func (*InstallRequest) Unmarshal

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

func (*InstallRequest) XXX_DiscardUnknown

func (m *InstallRequest) XXX_DiscardUnknown()

func (*InstallRequest) XXX_Marshal

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

func (*InstallRequest) XXX_Merge

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

func (*InstallRequest) XXX_Size

func (m *InstallRequest) XXX_Size() int

func (*InstallRequest) XXX_Unmarshal

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

type InstallResponse

type InstallResponse struct {
	Status ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error  ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
}

func NewPopulatedInstallResponse

func NewPopulatedInstallResponse(r randyProtocol, easy bool) *InstallResponse

func (*InstallResponse) Descriptor

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

func (*InstallResponse) Equal

func (this *InstallResponse) Equal(that interface{}) bool

func (*InstallResponse) GetError

func (m *InstallResponse) GetError() ResponseError

func (*InstallResponse) GetStatus

func (m *InstallResponse) GetStatus() ResponseStatus

func (*InstallResponse) Marshal

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

func (*InstallResponse) MarshalTo

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

func (*InstallResponse) MarshalToSizedBuffer

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

func (*InstallResponse) ProtoMessage

func (*InstallResponse) ProtoMessage()

func (*InstallResponse) Reset

func (m *InstallResponse) Reset()

func (*InstallResponse) Size

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

func (*InstallResponse) String

func (m *InstallResponse) String() string

func (*InstallResponse) Unmarshal

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

func (*InstallResponse) XXX_DiscardUnknown

func (m *InstallResponse) XXX_DiscardUnknown()

func (*InstallResponse) XXX_Marshal

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

func (*InstallResponse) XXX_Merge

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

func (*InstallResponse) XXX_Size

func (m *InstallResponse) XXX_Size() int

func (*InstallResponse) XXX_Unmarshal

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

type InstallStreamRequest

type InstallStreamRequest struct {
	*StreamMessage
	Request *InstallRequest
}

InstallStreamRequest is a stream request for InstallRequest

func NewInstallStreamRequest

func NewInstallStreamRequest(request *InstallRequest, err error) *InstallStreamRequest

NewInstallStreamRequest returns a new InstallStreamRequest with the given request and error

type InstallStreamResponse

type InstallStreamResponse struct {
	*StreamMessage
	Response *InstallResponse
}

InstallStreamResponse is a stream request for InstallResponse

func NewInstallStreamResponse

func NewInstallStreamResponse(response *InstallResponse, err error) *InstallStreamResponse

NewInstallStreamResponse returns a new InstallStreamResponse with the given request and error

type JoinRequest

type JoinRequest struct {
	Member *Member `protobuf:"bytes,1,opt,name=member,proto3" json:"member,omitempty"`
}

func NewPopulatedJoinRequest

func NewPopulatedJoinRequest(r randyProtocol, easy bool) *JoinRequest

func (*JoinRequest) Descriptor

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

func (*JoinRequest) Equal

func (this *JoinRequest) Equal(that interface{}) bool

func (*JoinRequest) GetMember

func (m *JoinRequest) GetMember() *Member

func (*JoinRequest) Marshal

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

func (*JoinRequest) MarshalTo

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

func (*JoinRequest) MarshalToSizedBuffer

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

func (*JoinRequest) ProtoMessage

func (*JoinRequest) ProtoMessage()

func (*JoinRequest) Reset

func (m *JoinRequest) Reset()

func (*JoinRequest) Size

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

func (*JoinRequest) String

func (m *JoinRequest) String() string

func (*JoinRequest) Unmarshal

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

func (*JoinRequest) XXX_DiscardUnknown

func (m *JoinRequest) XXX_DiscardUnknown()

func (*JoinRequest) XXX_Marshal

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

func (*JoinRequest) XXX_Merge

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

func (*JoinRequest) XXX_Size

func (m *JoinRequest) XXX_Size() int

func (*JoinRequest) XXX_Unmarshal

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

type JoinResponse

type JoinResponse struct {
	Status    ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error     ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Index     Index          `protobuf:"varint,3,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Term      Term           `protobuf:"varint,4,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Timestamp time.Time      `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
	Members   []*Member      `protobuf:"bytes,6,rep,name=members,proto3" json:"members,omitempty"`
}

func NewPopulatedJoinResponse

func NewPopulatedJoinResponse(r randyProtocol, easy bool) *JoinResponse

func (*JoinResponse) Descriptor

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

func (*JoinResponse) Equal

func (this *JoinResponse) Equal(that interface{}) bool

func (*JoinResponse) GetError

func (m *JoinResponse) GetError() ResponseError

func (*JoinResponse) GetIndex

func (m *JoinResponse) GetIndex() Index

func (*JoinResponse) GetMembers

func (m *JoinResponse) GetMembers() []*Member

func (*JoinResponse) GetStatus

func (m *JoinResponse) GetStatus() ResponseStatus

func (*JoinResponse) GetTerm

func (m *JoinResponse) GetTerm() Term

func (*JoinResponse) GetTimestamp

func (m *JoinResponse) GetTimestamp() time.Time

func (*JoinResponse) Marshal

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

func (*JoinResponse) MarshalTo

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

func (*JoinResponse) MarshalToSizedBuffer

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

func (*JoinResponse) ProtoMessage

func (*JoinResponse) ProtoMessage()

func (*JoinResponse) Reset

func (m *JoinResponse) Reset()

func (*JoinResponse) Size

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

func (*JoinResponse) String

func (m *JoinResponse) String() string

func (*JoinResponse) Unmarshal

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

func (*JoinResponse) XXX_DiscardUnknown

func (m *JoinResponse) XXX_DiscardUnknown()

func (*JoinResponse) XXX_Marshal

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

func (*JoinResponse) XXX_Merge

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

func (*JoinResponse) XXX_Size

func (m *JoinResponse) XXX_Size() int

func (*JoinResponse) XXX_Unmarshal

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

type LeaveRequest

type LeaveRequest struct {
	Member *Member `protobuf:"bytes,1,opt,name=member,proto3" json:"member,omitempty"`
}

func NewPopulatedLeaveRequest

func NewPopulatedLeaveRequest(r randyProtocol, easy bool) *LeaveRequest

func (*LeaveRequest) Descriptor

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

func (*LeaveRequest) Equal

func (this *LeaveRequest) Equal(that interface{}) bool

func (*LeaveRequest) GetMember

func (m *LeaveRequest) GetMember() *Member

func (*LeaveRequest) Marshal

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

func (*LeaveRequest) MarshalTo

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

func (*LeaveRequest) MarshalToSizedBuffer

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

func (*LeaveRequest) ProtoMessage

func (*LeaveRequest) ProtoMessage()

func (*LeaveRequest) Reset

func (m *LeaveRequest) Reset()

func (*LeaveRequest) Size

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

func (*LeaveRequest) String

func (m *LeaveRequest) String() string

func (*LeaveRequest) Unmarshal

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

func (*LeaveRequest) XXX_DiscardUnknown

func (m *LeaveRequest) XXX_DiscardUnknown()

func (*LeaveRequest) XXX_Marshal

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

func (*LeaveRequest) XXX_Merge

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

func (*LeaveRequest) XXX_Size

func (m *LeaveRequest) XXX_Size() int

func (*LeaveRequest) XXX_Unmarshal

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

type LeaveResponse

type LeaveResponse struct {
	Status    ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error     ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Index     Index          `protobuf:"varint,3,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Term      Term           `protobuf:"varint,4,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Timestamp time.Time      `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
	Members   []*Member      `protobuf:"bytes,6,rep,name=members,proto3" json:"members,omitempty"`
}

func NewPopulatedLeaveResponse

func NewPopulatedLeaveResponse(r randyProtocol, easy bool) *LeaveResponse

func (*LeaveResponse) Descriptor

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

func (*LeaveResponse) Equal

func (this *LeaveResponse) Equal(that interface{}) bool

func (*LeaveResponse) GetError

func (m *LeaveResponse) GetError() ResponseError

func (*LeaveResponse) GetIndex

func (m *LeaveResponse) GetIndex() Index

func (*LeaveResponse) GetMembers

func (m *LeaveResponse) GetMembers() []*Member

func (*LeaveResponse) GetStatus

func (m *LeaveResponse) GetStatus() ResponseStatus

func (*LeaveResponse) GetTerm

func (m *LeaveResponse) GetTerm() Term

func (*LeaveResponse) GetTimestamp

func (m *LeaveResponse) GetTimestamp() time.Time

func (*LeaveResponse) Marshal

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

func (*LeaveResponse) MarshalTo

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

func (*LeaveResponse) MarshalToSizedBuffer

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

func (*LeaveResponse) ProtoMessage

func (*LeaveResponse) ProtoMessage()

func (*LeaveResponse) Reset

func (m *LeaveResponse) Reset()

func (*LeaveResponse) Size

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

func (*LeaveResponse) String

func (m *LeaveResponse) String() string

func (*LeaveResponse) Unmarshal

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

func (*LeaveResponse) XXX_DiscardUnknown

func (m *LeaveResponse) XXX_DiscardUnknown()

func (*LeaveResponse) XXX_Marshal

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

func (*LeaveResponse) XXX_Merge

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

func (*LeaveResponse) XXX_Size

func (m *LeaveResponse) XXX_Size() int

func (*LeaveResponse) XXX_Unmarshal

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

type LogEntry

type LogEntry struct {
	Term      Term      `protobuf:"varint,1,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Timestamp time.Time `protobuf:"bytes,2,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
	// Types that are valid to be assigned to Entry:
	//	*LogEntry_Initialize
	//	*LogEntry_Configuration
	//	*LogEntry_Command
	//	*LogEntry_Query
	Entry isLogEntry_Entry `protobuf_oneof:"entry"`
}

Raft log entry

func NewPopulatedLogEntry

func NewPopulatedLogEntry(r randyLog, easy bool) *LogEntry

func (*LogEntry) Descriptor

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

func (*LogEntry) Equal

func (this *LogEntry) Equal(that interface{}) bool

func (*LogEntry) GetCommand

func (m *LogEntry) GetCommand() *CommandEntry

func (*LogEntry) GetConfiguration

func (m *LogEntry) GetConfiguration() *ConfigurationEntry

func (*LogEntry) GetEntry

func (m *LogEntry) GetEntry() isLogEntry_Entry

func (*LogEntry) GetInitialize

func (m *LogEntry) GetInitialize() *InitializeEntry

func (*LogEntry) GetQuery

func (m *LogEntry) GetQuery() *QueryEntry

func (*LogEntry) GetTerm

func (m *LogEntry) GetTerm() Term

func (*LogEntry) GetTimestamp

func (m *LogEntry) GetTimestamp() time.Time

func (*LogEntry) Marshal

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

func (*LogEntry) MarshalTo

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

func (*LogEntry) MarshalToSizedBuffer

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

func (*LogEntry) ProtoMessage

func (*LogEntry) ProtoMessage()

func (*LogEntry) Reset

func (m *LogEntry) Reset()

func (*LogEntry) Size

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

func (*LogEntry) String

func (m *LogEntry) String() string

func (*LogEntry) Unmarshal

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

func (*LogEntry) XXX_DiscardUnknown

func (m *LogEntry) XXX_DiscardUnknown()

func (*LogEntry) XXX_Marshal

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

func (*LogEntry) XXX_Merge

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

func (*LogEntry) XXX_OneofFuncs

func (*LogEntry) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})

XXX_OneofFuncs is for the internal use of the proto package.

func (*LogEntry) XXX_Size

func (m *LogEntry) XXX_Size() int

func (*LogEntry) XXX_Unmarshal

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

type LogEntry_Command

type LogEntry_Command struct {
	Command *CommandEntry `protobuf:"bytes,5,opt,name=command,proto3,oneof"`
}

func NewPopulatedLogEntry_Command

func NewPopulatedLogEntry_Command(r randyLog, easy bool) *LogEntry_Command

func (*LogEntry_Command) Equal

func (this *LogEntry_Command) Equal(that interface{}) bool

func (*LogEntry_Command) MarshalTo

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

func (*LogEntry_Command) MarshalToSizedBuffer

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

func (*LogEntry_Command) Size

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

type LogEntry_Configuration

type LogEntry_Configuration struct {
	Configuration *ConfigurationEntry `protobuf:"bytes,4,opt,name=configuration,proto3,oneof"`
}

func NewPopulatedLogEntry_Configuration

func NewPopulatedLogEntry_Configuration(r randyLog, easy bool) *LogEntry_Configuration

func (*LogEntry_Configuration) Equal

func (this *LogEntry_Configuration) Equal(that interface{}) bool

func (*LogEntry_Configuration) MarshalTo

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

func (*LogEntry_Configuration) MarshalToSizedBuffer

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

func (*LogEntry_Configuration) Size

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

type LogEntry_Initialize

type LogEntry_Initialize struct {
	Initialize *InitializeEntry `protobuf:"bytes,3,opt,name=initialize,proto3,oneof"`
}

func NewPopulatedLogEntry_Initialize

func NewPopulatedLogEntry_Initialize(r randyLog, easy bool) *LogEntry_Initialize

func (*LogEntry_Initialize) Equal

func (this *LogEntry_Initialize) Equal(that interface{}) bool

func (*LogEntry_Initialize) MarshalTo

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

func (*LogEntry_Initialize) MarshalToSizedBuffer

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

func (*LogEntry_Initialize) Size

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

type LogEntry_Query

type LogEntry_Query struct {
	Query *QueryEntry `protobuf:"bytes,6,opt,name=query,proto3,oneof"`
}

func NewPopulatedLogEntry_Query

func NewPopulatedLogEntry_Query(r randyLog, easy bool) *LogEntry_Query

func (*LogEntry_Query) Equal

func (this *LogEntry_Query) Equal(that interface{}) bool

func (*LogEntry_Query) MarshalTo

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

func (*LogEntry_Query) MarshalToSizedBuffer

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

func (*LogEntry_Query) Size

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

type Member

type Member struct {
	MemberID MemberID    `protobuf:"bytes,1,opt,name=member_id,json=memberId,proto3,casttype=MemberID" json:"member_id,omitempty"`
	Type     Member_Type `protobuf:"varint,2,opt,name=type,proto3,enum=atomix.raft.protocol.Member_Type" json:"type,omitempty"`
	Updated  time.Time   `protobuf:"bytes,3,opt,name=updated,proto3,stdtime" json:"updated"`
}

func NewPopulatedMember

func NewPopulatedMember(r randyCluster, easy bool) *Member

func (*Member) Descriptor

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

func (*Member) Equal

func (this *Member) Equal(that interface{}) bool

func (*Member) GetMemberID

func (m *Member) GetMemberID() MemberID

func (*Member) GetType

func (m *Member) GetType() Member_Type

func (*Member) GetUpdated

func (m *Member) GetUpdated() time.Time

func (*Member) Marshal

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

func (*Member) MarshalTo

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

func (*Member) MarshalToSizedBuffer

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

func (*Member) ProtoMessage

func (*Member) ProtoMessage()

func (*Member) Reset

func (m *Member) Reset()

func (*Member) Size

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

func (*Member) String

func (m *Member) String() string

func (*Member) Unmarshal

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

func (*Member) XXX_DiscardUnknown

func (m *Member) XXX_DiscardUnknown()

func (*Member) XXX_Marshal

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

func (*Member) XXX_Merge

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

func (*Member) XXX_Size

func (m *Member) XXX_Size() int

func (*Member) XXX_Unmarshal

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

type MemberID

type MemberID string

MemberID is the ID of a Raft cluster member

type Member_Type

type Member_Type int32
const (
	Member_INACTIVE   Member_Type = 0
	Member_PASSIVE    Member_Type = 1
	Member_PROMOTABLE Member_Type = 2
	Member_ACTIVE     Member_Type = 3
)

func (Member_Type) EnumDescriptor

func (Member_Type) EnumDescriptor() ([]byte, []int)

func (Member_Type) String

func (x Member_Type) String() string

type Metadata

type Metadata struct {
	Term Term     `protobuf:"varint,1,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Vote MemberID `protobuf:"bytes,2,opt,name=vote,proto3,casttype=MemberID" json:"vote,omitempty"`
}

Raft system metadata

func NewPopulatedMetadata

func NewPopulatedMetadata(r randyMetadata, easy bool) *Metadata

func (*Metadata) Descriptor

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

func (*Metadata) Equal

func (this *Metadata) Equal(that interface{}) bool

func (*Metadata) GetTerm

func (m *Metadata) GetTerm() Term

func (*Metadata) GetVote

func (m *Metadata) GetVote() MemberID

func (*Metadata) Marshal

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

func (*Metadata) MarshalTo

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

func (*Metadata) MarshalToSizedBuffer

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

func (*Metadata) ProtoMessage

func (*Metadata) ProtoMessage()

func (*Metadata) Reset

func (m *Metadata) Reset()

func (*Metadata) Size

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

func (*Metadata) String

func (m *Metadata) String() string

func (*Metadata) Unmarshal

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

func (*Metadata) XXX_DiscardUnknown

func (m *Metadata) XXX_DiscardUnknown()

func (*Metadata) XXX_Marshal

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

func (*Metadata) XXX_Merge

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

func (*Metadata) XXX_Size

func (m *Metadata) XXX_Size() int

func (*Metadata) XXX_Unmarshal

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

type MetadataStore

type MetadataStore interface {
	// StoreTerm stores the Raft term
	StoreTerm(term Term)

	// LoadTerm loads the Raft term
	LoadTerm() *Term

	// StoreVote stores the Raft vote
	StoreVote(vote *MemberID)

	// LoadVote loads the Raft vote
	LoadVote() *MemberID

	// Close closes the store
	Close() error
}

MetadataStore stores metadata for a Raft server

type PollRequest

type PollRequest struct {
	Term         Term     `protobuf:"varint,1,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Candidate    MemberID `protobuf:"bytes,2,opt,name=candidate,proto3,casttype=MemberID" json:"candidate,omitempty"`
	LastLogIndex Index    `protobuf:"varint,3,opt,name=last_log_index,json=lastLogIndex,proto3,casttype=Index" json:"last_log_index,omitempty"`
	LastLogTerm  Term     `protobuf:"varint,4,opt,name=last_log_term,json=lastLogTerm,proto3,casttype=Term" json:"last_log_term,omitempty"`
}

func NewPopulatedPollRequest

func NewPopulatedPollRequest(r randyProtocol, easy bool) *PollRequest

func (*PollRequest) Descriptor

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

func (*PollRequest) Equal

func (this *PollRequest) Equal(that interface{}) bool

func (*PollRequest) GetCandidate

func (m *PollRequest) GetCandidate() MemberID

func (*PollRequest) GetLastLogIndex

func (m *PollRequest) GetLastLogIndex() Index

func (*PollRequest) GetLastLogTerm

func (m *PollRequest) GetLastLogTerm() Term

func (*PollRequest) GetTerm

func (m *PollRequest) GetTerm() Term

func (*PollRequest) Marshal

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

func (*PollRequest) MarshalTo

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

func (*PollRequest) MarshalToSizedBuffer

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

func (*PollRequest) ProtoMessage

func (*PollRequest) ProtoMessage()

func (*PollRequest) Reset

func (m *PollRequest) Reset()

func (*PollRequest) Size

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

func (*PollRequest) String

func (m *PollRequest) String() string

func (*PollRequest) Unmarshal

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

func (*PollRequest) XXX_DiscardUnknown

func (m *PollRequest) XXX_DiscardUnknown()

func (*PollRequest) XXX_Marshal

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

func (*PollRequest) XXX_Merge

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

func (*PollRequest) XXX_Size

func (m *PollRequest) XXX_Size() int

func (*PollRequest) XXX_Unmarshal

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

type PollResponse

type PollResponse struct {
	Status   ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error    ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Term     Term           `protobuf:"varint,3,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Accepted bool           `protobuf:"varint,4,opt,name=accepted,proto3" json:"accepted,omitempty"`
}

func NewPopulatedPollResponse

func NewPopulatedPollResponse(r randyProtocol, easy bool) *PollResponse

func (*PollResponse) Descriptor

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

func (*PollResponse) Equal

func (this *PollResponse) Equal(that interface{}) bool

func (*PollResponse) GetAccepted

func (m *PollResponse) GetAccepted() bool

func (*PollResponse) GetError

func (m *PollResponse) GetError() ResponseError

func (*PollResponse) GetStatus

func (m *PollResponse) GetStatus() ResponseStatus

func (*PollResponse) GetTerm

func (m *PollResponse) GetTerm() Term

func (*PollResponse) Marshal

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

func (*PollResponse) MarshalTo

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

func (*PollResponse) MarshalToSizedBuffer

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

func (*PollResponse) ProtoMessage

func (*PollResponse) ProtoMessage()

func (*PollResponse) Reset

func (m *PollResponse) Reset()

func (*PollResponse) Size

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

func (*PollResponse) String

func (m *PollResponse) String() string

func (*PollResponse) Unmarshal

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

func (*PollResponse) XXX_DiscardUnknown

func (m *PollResponse) XXX_DiscardUnknown()

func (*PollResponse) XXX_Marshal

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

func (*PollResponse) XXX_Merge

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

func (*PollResponse) XXX_Size

func (m *PollResponse) XXX_Size() int

func (*PollResponse) XXX_Unmarshal

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

type QueryEntry

type QueryEntry struct {
	Value []byte `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
}

func NewPopulatedQueryEntry

func NewPopulatedQueryEntry(r randyLog, easy bool) *QueryEntry

func (*QueryEntry) Descriptor

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

func (*QueryEntry) Equal

func (this *QueryEntry) Equal(that interface{}) bool

func (*QueryEntry) GetValue

func (m *QueryEntry) GetValue() []byte

func (*QueryEntry) Marshal

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

func (*QueryEntry) MarshalTo

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

func (*QueryEntry) MarshalToSizedBuffer

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

func (*QueryEntry) ProtoMessage

func (*QueryEntry) ProtoMessage()

func (*QueryEntry) Reset

func (m *QueryEntry) Reset()

func (*QueryEntry) Size

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

func (*QueryEntry) String

func (m *QueryEntry) String() string

func (*QueryEntry) Unmarshal

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

func (*QueryEntry) XXX_DiscardUnknown

func (m *QueryEntry) XXX_DiscardUnknown()

func (*QueryEntry) XXX_Marshal

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

func (*QueryEntry) XXX_Merge

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

func (*QueryEntry) XXX_Size

func (m *QueryEntry) XXX_Size() int

func (*QueryEntry) XXX_Unmarshal

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

type QueryRequest

type QueryRequest struct {
	Value           []byte          `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	ReadConsistency ReadConsistency `` /* 149-byte string literal not displayed */
}

func NewPopulatedQueryRequest

func NewPopulatedQueryRequest(r randyProtocol, easy bool) *QueryRequest

func (*QueryRequest) Descriptor

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

func (*QueryRequest) Equal

func (this *QueryRequest) Equal(that interface{}) bool

func (*QueryRequest) GetReadConsistency

func (m *QueryRequest) GetReadConsistency() ReadConsistency

func (*QueryRequest) GetValue

func (m *QueryRequest) GetValue() []byte

func (*QueryRequest) Marshal

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

func (*QueryRequest) MarshalTo

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

func (*QueryRequest) MarshalToSizedBuffer

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

func (*QueryRequest) ProtoMessage

func (*QueryRequest) ProtoMessage()

func (*QueryRequest) Reset

func (m *QueryRequest) Reset()

func (*QueryRequest) Size

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

func (*QueryRequest) String

func (m *QueryRequest) String() string

func (*QueryRequest) Unmarshal

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

func (*QueryRequest) XXX_DiscardUnknown

func (m *QueryRequest) XXX_DiscardUnknown()

func (*QueryRequest) XXX_Marshal

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

func (*QueryRequest) XXX_Merge

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

func (*QueryRequest) XXX_Size

func (m *QueryRequest) XXX_Size() int

func (*QueryRequest) XXX_Unmarshal

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

type QueryResponse

type QueryResponse struct {
	Status  ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error   ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Message string         `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	Output  []byte         `protobuf:"bytes,4,opt,name=output,proto3" json:"output,omitempty"`
}

func NewPopulatedQueryResponse

func NewPopulatedQueryResponse(r randyProtocol, easy bool) *QueryResponse

func (*QueryResponse) Descriptor

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

func (*QueryResponse) Equal

func (this *QueryResponse) Equal(that interface{}) bool

func (*QueryResponse) GetError

func (m *QueryResponse) GetError() ResponseError

func (*QueryResponse) GetMessage

func (m *QueryResponse) GetMessage() string

func (*QueryResponse) GetOutput

func (m *QueryResponse) GetOutput() []byte

func (*QueryResponse) GetStatus

func (m *QueryResponse) GetStatus() ResponseStatus

func (*QueryResponse) Marshal

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

func (*QueryResponse) MarshalTo

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

func (*QueryResponse) MarshalToSizedBuffer

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

func (*QueryResponse) ProtoMessage

func (*QueryResponse) ProtoMessage()

func (*QueryResponse) Reset

func (m *QueryResponse) Reset()

func (*QueryResponse) Size

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

func (*QueryResponse) String

func (m *QueryResponse) String() string

func (*QueryResponse) Unmarshal

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

func (*QueryResponse) XXX_DiscardUnknown

func (m *QueryResponse) XXX_DiscardUnknown()

func (*QueryResponse) XXX_Marshal

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

func (*QueryResponse) XXX_Merge

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

func (*QueryResponse) XXX_Size

func (m *QueryResponse) XXX_Size() int

func (*QueryResponse) XXX_Unmarshal

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

type QueryStreamResponse

type QueryStreamResponse struct {
	*StreamMessage
	Response *QueryResponse
}

QueryStreamResponse is a stream response for QueryRequest

func NewQueryStreamResponse

func NewQueryStreamResponse(response *QueryResponse, err error) *QueryStreamResponse

NewQueryStreamResponse returns a new CommandStreamResponse with the given response and error

type Raft

type Raft interface {
	Server

	// Init initializes the Raft state
	Init()

	// Watch watches the Raft protocol state for changes
	Watch(func(Event))

	// Role is the current role
	Role() RoleType

	// Status returns the Raft protocol status
	Status() Status

	// Config returns the Raft protocol configuration
	Config() *config.ProtocolConfig

	// Member returns the local member ID
	Member() MemberID

	// Members returns a list of all members in the Raft cluster
	Members() []MemberID

	// GetMember returns a RaftMember by ID
	GetMember(memberID MemberID) *Member

	// Client returns the Raft messaging protocol
	Protocol() Client

	// Term returns the current term
	Term() Term

	// SetTerm sets the current term
	SetTerm(term Term) error

	// Leader returns the current leader
	Leader() *MemberID

	// SetLeader sets the current leader
	SetLeader(leader *MemberID) error

	// LastVotedFor returns the last member voted for by this node
	LastVotedFor() *MemberID

	// SetLastVotedFor sets the last member voted for by this node
	SetLastVotedFor(memberID MemberID) error

	// CommitIndex returns the current commit index
	CommitIndex() Index

	// SetCommitIndex sets the highest known commit index
	SetCommitIndex(index Index)

	// Commit sets the persisted commit index
	Commit(index Index) Index

	// WriteLock acquires a write lock on the state
	WriteLock()

	// WriteUnlock releases a write lock on the state
	WriteUnlock()

	// ReadLock acquires a read lock on the state
	ReadLock()

	// ReadUnlock releases a read lock on the state
	ReadUnlock()

	// SetRole sets the protocol's current role
	SetRole(role RoleType)

	// Close closes the Raft state
	Close() error
}

Raft is an interface for managing the state of the Raft consensus protocol

func NewRaft

func NewRaft(cluster Cluster, config *config.ProtocolConfig, protocol Client, roles map[RoleType]func(Raft) Role) Raft

NewRaft returns a new Raft protocol state struct

type RaftServiceClient

RaftServiceClient is the client API for RaftService service.

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

func NewRaftServiceClient

func NewRaftServiceClient(cc *grpc.ClientConn) RaftServiceClient

type RaftServiceServer

RaftServiceServer is the server API for RaftService service.

func NewServer

func NewServer(server Server) RaftServiceServer

NewServer creates a new RaftServiceServer for the given Server

type RaftService_CommandClient

type RaftService_CommandClient interface {
	Recv() (*CommandResponse, error)
	grpc.ClientStream
}

type RaftService_CommandServer

type RaftService_CommandServer interface {
	Send(*CommandResponse) error
	grpc.ServerStream
}

type RaftService_InstallClient

type RaftService_InstallClient interface {
	Send(*InstallRequest) error
	CloseAndRecv() (*InstallResponse, error)
	grpc.ClientStream
}

type RaftService_InstallServer

type RaftService_InstallServer interface {
	SendAndClose(*InstallResponse) error
	Recv() (*InstallRequest, error)
	grpc.ServerStream
}

type RaftService_QueryClient

type RaftService_QueryClient interface {
	Recv() (*QueryResponse, error)
	grpc.ClientStream
}

type RaftService_QueryServer

type RaftService_QueryServer interface {
	Send(*QueryResponse) error
	grpc.ServerStream
}

type ReadConsistency

type ReadConsistency int32
const (
	ReadConsistency_SEQUENTIAL         ReadConsistency = 0
	ReadConsistency_LINEARIZABLE_LEASE ReadConsistency = 1
	ReadConsistency_LINEARIZABLE       ReadConsistency = 2
)

func (ReadConsistency) EnumDescriptor

func (ReadConsistency) EnumDescriptor() ([]byte, []int)

func (ReadConsistency) String

func (x ReadConsistency) String() string

type ReconfigureRequest

type ReconfigureRequest struct {
	Member *Member `protobuf:"bytes,1,opt,name=member,proto3" json:"member,omitempty"`
	Index  Index   `protobuf:"varint,2,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Term   Term    `protobuf:"varint,3,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
}

func NewPopulatedReconfigureRequest

func NewPopulatedReconfigureRequest(r randyProtocol, easy bool) *ReconfigureRequest

func (*ReconfigureRequest) Descriptor

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

func (*ReconfigureRequest) Equal

func (this *ReconfigureRequest) Equal(that interface{}) bool

func (*ReconfigureRequest) GetIndex

func (m *ReconfigureRequest) GetIndex() Index

func (*ReconfigureRequest) GetMember

func (m *ReconfigureRequest) GetMember() *Member

func (*ReconfigureRequest) GetTerm

func (m *ReconfigureRequest) GetTerm() Term

func (*ReconfigureRequest) Marshal

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

func (*ReconfigureRequest) MarshalTo

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

func (*ReconfigureRequest) MarshalToSizedBuffer

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

func (*ReconfigureRequest) ProtoMessage

func (*ReconfigureRequest) ProtoMessage()

func (*ReconfigureRequest) Reset

func (m *ReconfigureRequest) Reset()

func (*ReconfigureRequest) Size

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

func (*ReconfigureRequest) String

func (m *ReconfigureRequest) String() string

func (*ReconfigureRequest) Unmarshal

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

func (*ReconfigureRequest) XXX_DiscardUnknown

func (m *ReconfigureRequest) XXX_DiscardUnknown()

func (*ReconfigureRequest) XXX_Marshal

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

func (*ReconfigureRequest) XXX_Merge

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

func (*ReconfigureRequest) XXX_Size

func (m *ReconfigureRequest) XXX_Size() int

func (*ReconfigureRequest) XXX_Unmarshal

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

type ReconfigureResponse

type ReconfigureResponse struct {
	Status    ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error     ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Index     Index          `protobuf:"varint,3,opt,name=index,proto3,casttype=Index" json:"index,omitempty"`
	Term      Term           `protobuf:"varint,4,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Timestamp time.Time      `protobuf:"bytes,5,opt,name=timestamp,proto3,stdtime" json:"timestamp"`
	Members   []*Member      `protobuf:"bytes,6,rep,name=members,proto3" json:"members,omitempty"`
}

func NewPopulatedReconfigureResponse

func NewPopulatedReconfigureResponse(r randyProtocol, easy bool) *ReconfigureResponse

func (*ReconfigureResponse) Descriptor

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

func (*ReconfigureResponse) Equal

func (this *ReconfigureResponse) Equal(that interface{}) bool

func (*ReconfigureResponse) GetError

func (m *ReconfigureResponse) GetError() ResponseError

func (*ReconfigureResponse) GetIndex

func (m *ReconfigureResponse) GetIndex() Index

func (*ReconfigureResponse) GetMembers

func (m *ReconfigureResponse) GetMembers() []*Member

func (*ReconfigureResponse) GetStatus

func (m *ReconfigureResponse) GetStatus() ResponseStatus

func (*ReconfigureResponse) GetTerm

func (m *ReconfigureResponse) GetTerm() Term

func (*ReconfigureResponse) GetTimestamp

func (m *ReconfigureResponse) GetTimestamp() time.Time

func (*ReconfigureResponse) Marshal

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

func (*ReconfigureResponse) MarshalTo

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

func (*ReconfigureResponse) MarshalToSizedBuffer

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

func (*ReconfigureResponse) ProtoMessage

func (*ReconfigureResponse) ProtoMessage()

func (*ReconfigureResponse) Reset

func (m *ReconfigureResponse) Reset()

func (*ReconfigureResponse) Size

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

func (*ReconfigureResponse) String

func (m *ReconfigureResponse) String() string

func (*ReconfigureResponse) Unmarshal

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

func (*ReconfigureResponse) XXX_DiscardUnknown

func (m *ReconfigureResponse) XXX_DiscardUnknown()

func (*ReconfigureResponse) XXX_Marshal

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

func (*ReconfigureResponse) XXX_Merge

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

func (*ReconfigureResponse) XXX_Size

func (m *ReconfigureResponse) XXX_Size() int

func (*ReconfigureResponse) XXX_Unmarshal

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

type ResponseError

type ResponseError int32
const (
	ResponseError_NO_LEADER            ResponseError = 0
	ResponseError_QUERY_FAILURE        ResponseError = 1
	ResponseError_COMMAND_FAILURE      ResponseError = 2
	ResponseError_APPLICATION_ERROR    ResponseError = 3
	ResponseError_ILLEGAL_MEMBER_STATE ResponseError = 4
	ResponseError_UNKNOWN_CLIENT       ResponseError = 5
	ResponseError_UNKNOWN_SESSION      ResponseError = 6
	ResponseError_UNKNOWN_SERVICE      ResponseError = 7
	ResponseError_CLOSED_SESSION       ResponseError = 8
	ResponseError_PROTOCOL_ERROR       ResponseError = 9
	ResponseError_CONFIGURATION_ERROR  ResponseError = 10
	ResponseError_UNAVAILABLE          ResponseError = 11
)

func (ResponseError) EnumDescriptor

func (ResponseError) EnumDescriptor() ([]byte, []int)

func (ResponseError) String

func (x ResponseError) String() string

type ResponseStatus

type ResponseStatus int32
const (
	ResponseStatus_OK    ResponseStatus = 0
	ResponseStatus_ERROR ResponseStatus = 1
)

func (ResponseStatus) EnumDescriptor

func (ResponseStatus) EnumDescriptor() ([]byte, []int)

func (ResponseStatus) String

func (x ResponseStatus) String() string

type Role

type Role interface {
	Server

	// Type is the type of the role
	Type() RoleType

	// Start initializes the role
	// The Start method will always be called with a write lock on the Raft object
	Start() error

	// Stop stops the role
	// The Stop method will always be called with a write lock on the Raft object
	Stop() error
}

Role is implemented by server roles to support protocol requests

type RoleType

type RoleType string

RoleType is the name of a role

const (
	// RoleFollower is a Raft follower role
	RoleFollower RoleType = "Follower"

	// RoleCandidate is a Raft candidate role
	RoleCandidate RoleType = "Candidate"

	// RoleLeader is a Raft leader role
	RoleLeader RoleType = "Leader"
)

type Server

type Server interface {
	// Join handles a join request
	Join(ctx context.Context, request *JoinRequest) (*JoinResponse, error)

	// Leave handles a leave request
	Leave(ctx context.Context, request *LeaveRequest) (*LeaveResponse, error)

	// Configure handles a configure request
	Configure(ctx context.Context, request *ConfigureRequest) (*ConfigureResponse, error)

	// Reconfigure handles a reconfigure request
	Reconfigure(ctx context.Context, request *ReconfigureRequest) (*ReconfigureResponse, error)

	// Poll handles a poll request
	Poll(ctx context.Context, request *PollRequest) (*PollResponse, error)

	// Vote handles a vote request
	Vote(ctx context.Context, request *VoteRequest) (*VoteResponse, error)

	// Transfer handles a leadership transfer request
	Transfer(ctx context.Context, request *TransferRequest) (*TransferResponse, error)

	// Append handles an append request
	Append(ctx context.Context, request *AppendRequest) (*AppendResponse, error)

	// Install handles an install request
	Install(ch <-chan *InstallStreamRequest) (*InstallResponse, error)

	// Command handles a command request
	Command(request *CommandRequest, ch chan<- *CommandStreamResponse) error

	// Query handles a query request
	Query(request *QueryRequest, ch chan<- *QueryStreamResponse) error
}

Server is an interface for receiving Raft messages

type Status

type Status string

Status represents the status of a Raft server

const (
	// StatusStopped indicates the server is not running
	StatusStopped Status = "stopped"

	// StatusRunning indicates the server is running but has not found a leader
	StatusRunning Status = "running"

	// StatusReady indicates the server is running, has found a leader, and has applied committed entries to its state machine
	StatusReady Status = "ready"
)

type StreamMessage

type StreamMessage struct {
	Error error
}

StreamMessage is a stream message/error pair

func (*StreamMessage) Failed

func (r *StreamMessage) Failed() bool

Failed returns a bool indicating whether the request failed

func (*StreamMessage) Succeeded

func (r *StreamMessage) Succeeded() bool

Succeeded returns a bool indicating whether the request succeeded

type Term

type Term uint64

Term is a Raft term

type TransferRequest

type TransferRequest struct {
	Member MemberID `protobuf:"bytes,1,opt,name=member,proto3,casttype=MemberID" json:"member,omitempty"`
}

func NewPopulatedTransferRequest

func NewPopulatedTransferRequest(r randyProtocol, easy bool) *TransferRequest

func (*TransferRequest) Descriptor

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

func (*TransferRequest) Equal

func (this *TransferRequest) Equal(that interface{}) bool

func (*TransferRequest) GetMember

func (m *TransferRequest) GetMember() MemberID

func (*TransferRequest) Marshal

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

func (*TransferRequest) MarshalTo

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

func (*TransferRequest) MarshalToSizedBuffer

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

func (*TransferRequest) ProtoMessage

func (*TransferRequest) ProtoMessage()

func (*TransferRequest) Reset

func (m *TransferRequest) Reset()

func (*TransferRequest) Size

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

func (*TransferRequest) String

func (m *TransferRequest) String() string

func (*TransferRequest) Unmarshal

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

func (*TransferRequest) XXX_DiscardUnknown

func (m *TransferRequest) XXX_DiscardUnknown()

func (*TransferRequest) XXX_Marshal

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

func (*TransferRequest) XXX_Merge

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

func (*TransferRequest) XXX_Size

func (m *TransferRequest) XXX_Size() int

func (*TransferRequest) XXX_Unmarshal

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

type TransferResponse

type TransferResponse struct {
	Status ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error  ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
}

func NewPopulatedTransferResponse

func NewPopulatedTransferResponse(r randyProtocol, easy bool) *TransferResponse

func (*TransferResponse) Descriptor

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

func (*TransferResponse) Equal

func (this *TransferResponse) Equal(that interface{}) bool

func (*TransferResponse) GetError

func (m *TransferResponse) GetError() ResponseError

func (*TransferResponse) GetStatus

func (m *TransferResponse) GetStatus() ResponseStatus

func (*TransferResponse) Marshal

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

func (*TransferResponse) MarshalTo

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

func (*TransferResponse) MarshalToSizedBuffer

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

func (*TransferResponse) ProtoMessage

func (*TransferResponse) ProtoMessage()

func (*TransferResponse) Reset

func (m *TransferResponse) Reset()

func (*TransferResponse) Size

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

func (*TransferResponse) String

func (m *TransferResponse) String() string

func (*TransferResponse) Unmarshal

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

func (*TransferResponse) XXX_DiscardUnknown

func (m *TransferResponse) XXX_DiscardUnknown()

func (*TransferResponse) XXX_Marshal

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

func (*TransferResponse) XXX_Merge

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

func (*TransferResponse) XXX_Size

func (m *TransferResponse) XXX_Size() int

func (*TransferResponse) XXX_Unmarshal

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

type UnimplementedRaftServiceServer

type UnimplementedRaftServiceServer struct {
}

UnimplementedRaftServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedRaftServiceServer) Append

func (*UnimplementedRaftServiceServer) Command

func (*UnimplementedRaftServiceServer) Configure

func (*UnimplementedRaftServiceServer) Install

func (*UnimplementedRaftServiceServer) Join

func (*UnimplementedRaftServiceServer) Leave

func (*UnimplementedRaftServiceServer) Poll

func (*UnimplementedRaftServiceServer) Query

func (*UnimplementedRaftServiceServer) Reconfigure

func (*UnimplementedRaftServiceServer) Transfer

func (*UnimplementedRaftServiceServer) Vote

type VoteRequest

type VoteRequest struct {
	Term         Term     `protobuf:"varint,1,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Candidate    MemberID `protobuf:"bytes,2,opt,name=candidate,proto3,casttype=MemberID" json:"candidate,omitempty"`
	LastLogIndex Index    `protobuf:"varint,3,opt,name=last_log_index,json=lastLogIndex,proto3,casttype=Index" json:"last_log_index,omitempty"`
	LastLogTerm  Term     `protobuf:"varint,4,opt,name=last_log_term,json=lastLogTerm,proto3,casttype=Term" json:"last_log_term,omitempty"`
}

func NewPopulatedVoteRequest

func NewPopulatedVoteRequest(r randyProtocol, easy bool) *VoteRequest

func (*VoteRequest) Descriptor

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

func (*VoteRequest) Equal

func (this *VoteRequest) Equal(that interface{}) bool

func (*VoteRequest) GetCandidate

func (m *VoteRequest) GetCandidate() MemberID

func (*VoteRequest) GetLastLogIndex

func (m *VoteRequest) GetLastLogIndex() Index

func (*VoteRequest) GetLastLogTerm

func (m *VoteRequest) GetLastLogTerm() Term

func (*VoteRequest) GetTerm

func (m *VoteRequest) GetTerm() Term

func (*VoteRequest) Marshal

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

func (*VoteRequest) MarshalTo

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

func (*VoteRequest) MarshalToSizedBuffer

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

func (*VoteRequest) ProtoMessage

func (*VoteRequest) ProtoMessage()

func (*VoteRequest) Reset

func (m *VoteRequest) Reset()

func (*VoteRequest) Size

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

func (*VoteRequest) String

func (m *VoteRequest) String() string

func (*VoteRequest) Unmarshal

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

func (*VoteRequest) XXX_DiscardUnknown

func (m *VoteRequest) XXX_DiscardUnknown()

func (*VoteRequest) XXX_Marshal

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

func (*VoteRequest) XXX_Merge

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

func (*VoteRequest) XXX_Size

func (m *VoteRequest) XXX_Size() int

func (*VoteRequest) XXX_Unmarshal

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

type VoteResponse

type VoteResponse struct {
	Status ResponseStatus `protobuf:"varint,1,opt,name=status,proto3,enum=atomix.raft.protocol.ResponseStatus" json:"status,omitempty"`
	Error  ResponseError  `protobuf:"varint,2,opt,name=error,proto3,enum=atomix.raft.protocol.ResponseError" json:"error,omitempty"`
	Term   Term           `protobuf:"varint,3,opt,name=term,proto3,casttype=Term" json:"term,omitempty"`
	Voted  bool           `protobuf:"varint,4,opt,name=voted,proto3" json:"voted,omitempty"`
}

func NewPopulatedVoteResponse

func NewPopulatedVoteResponse(r randyProtocol, easy bool) *VoteResponse

func (*VoteResponse) Descriptor

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

func (*VoteResponse) Equal

func (this *VoteResponse) Equal(that interface{}) bool

func (*VoteResponse) GetError

func (m *VoteResponse) GetError() ResponseError

func (*VoteResponse) GetStatus

func (m *VoteResponse) GetStatus() ResponseStatus

func (*VoteResponse) GetTerm

func (m *VoteResponse) GetTerm() Term

func (*VoteResponse) GetVoted

func (m *VoteResponse) GetVoted() bool

func (*VoteResponse) Marshal

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

func (*VoteResponse) MarshalTo

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

func (*VoteResponse) MarshalToSizedBuffer

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

func (*VoteResponse) ProtoMessage

func (*VoteResponse) ProtoMessage()

func (*VoteResponse) Reset

func (m *VoteResponse) Reset()

func (*VoteResponse) Size

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

func (*VoteResponse) String

func (m *VoteResponse) String() string

func (*VoteResponse) Unmarshal

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

func (*VoteResponse) XXX_DiscardUnknown

func (m *VoteResponse) XXX_DiscardUnknown()

func (*VoteResponse) XXX_Marshal

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

func (*VoteResponse) XXX_Merge

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

func (*VoteResponse) XXX_Size

func (m *VoteResponse) XXX_Size() int

func (*VoteResponse) XXX_Unmarshal

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

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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