election

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthManager        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowManager          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupManager = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthPrimitive        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowPrimitive          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupPrimitive = fmt.Errorf("proto: unexpected end of group")
)
View Source
var Event_Type_name = map[int32]string{
	0: "NONE",
	1: "CHANGED",
}
View Source
var Event_Type_value = map[string]int32{
	"NONE":    0,
	"CHANGED": 1,
}

Functions

func RegisterLeaderElectionManagerServer added in v0.7.0

func RegisterLeaderElectionManagerServer(s *grpc.Server, srv LeaderElectionManagerServer)

func RegisterLeaderElectionServer

func RegisterLeaderElectionServer(s *grpc.Server, srv LeaderElectionServer)

Types

type AnointRequest

type AnointRequest struct {
	CandidateID uint64 `protobuf:"varint,2,opt,name=candidate_id,json=candidateId,proto3" json:"candidate_id,omitempty"`
}

func (*AnointRequest) Descriptor

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

func (*AnointRequest) GetCandidateID

func (m *AnointRequest) GetCandidateID() uint64

func (*AnointRequest) Marshal

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

func (*AnointRequest) MarshalTo

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

func (*AnointRequest) MarshalToSizedBuffer

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

func (*AnointRequest) ProtoMessage

func (*AnointRequest) ProtoMessage()

func (*AnointRequest) Reset

func (m *AnointRequest) Reset()

func (*AnointRequest) Size

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

func (*AnointRequest) String

func (m *AnointRequest) String() string

func (*AnointRequest) Unmarshal

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

func (*AnointRequest) XXX_DiscardUnknown

func (m *AnointRequest) XXX_DiscardUnknown()

func (*AnointRequest) XXX_Marshal

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

func (*AnointRequest) XXX_Merge

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

func (*AnointRequest) XXX_Size

func (m *AnointRequest) XXX_Size() int

func (*AnointRequest) XXX_Unmarshal

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

type AnointResponse

type AnointResponse struct {
	Term Term `protobuf:"bytes,2,opt,name=term,proto3" json:"term"`
}

func (*AnointResponse) Descriptor

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

func (*AnointResponse) GetTerm

func (m *AnointResponse) GetTerm() Term

func (*AnointResponse) Marshal

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

func (*AnointResponse) MarshalTo

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

func (*AnointResponse) MarshalToSizedBuffer

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

func (*AnointResponse) ProtoMessage

func (*AnointResponse) ProtoMessage()

func (*AnointResponse) Reset

func (m *AnointResponse) Reset()

func (*AnointResponse) Size

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

func (*AnointResponse) String

func (m *AnointResponse) String() string

func (*AnointResponse) Unmarshal

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

func (*AnointResponse) XXX_DiscardUnknown

func (m *AnointResponse) XXX_DiscardUnknown()

func (*AnointResponse) XXX_Marshal

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

func (*AnointResponse) XXX_Merge

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

func (*AnointResponse) XXX_Size

func (m *AnointResponse) XXX_Size() int

func (*AnointResponse) XXX_Unmarshal

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

type CloseSessionRequest

type CloseSessionRequest struct {
	SessionID github_com_atomix_atomix_api_go_atomix_primitive_v1.SessionID `` /* 160-byte string literal not displayed */
}

func (*CloseSessionRequest) Descriptor

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

func (*CloseSessionRequest) Marshal

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

func (*CloseSessionRequest) MarshalTo

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

func (*CloseSessionRequest) MarshalToSizedBuffer

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

func (*CloseSessionRequest) ProtoMessage

func (*CloseSessionRequest) ProtoMessage()

func (*CloseSessionRequest) Reset

func (m *CloseSessionRequest) Reset()

func (*CloseSessionRequest) Size

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

func (*CloseSessionRequest) String

func (m *CloseSessionRequest) String() string

func (*CloseSessionRequest) Unmarshal

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

func (*CloseSessionRequest) XXX_DiscardUnknown

func (m *CloseSessionRequest) XXX_DiscardUnknown()

func (*CloseSessionRequest) XXX_Marshal

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

func (*CloseSessionRequest) XXX_Merge

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

func (*CloseSessionRequest) XXX_Size

func (m *CloseSessionRequest) XXX_Size() int

func (*CloseSessionRequest) XXX_Unmarshal

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

type CloseSessionResponse

type CloseSessionResponse struct {
}

func (*CloseSessionResponse) Descriptor

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

func (*CloseSessionResponse) Marshal

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

func (*CloseSessionResponse) MarshalTo

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

func (*CloseSessionResponse) MarshalToSizedBuffer

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

func (*CloseSessionResponse) ProtoMessage

func (*CloseSessionResponse) ProtoMessage()

func (*CloseSessionResponse) Reset

func (m *CloseSessionResponse) Reset()

func (*CloseSessionResponse) Size

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

func (*CloseSessionResponse) String

func (m *CloseSessionResponse) String() string

func (*CloseSessionResponse) Unmarshal

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

func (*CloseSessionResponse) XXX_DiscardUnknown

func (m *CloseSessionResponse) XXX_DiscardUnknown()

func (*CloseSessionResponse) XXX_Marshal

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

func (*CloseSessionResponse) XXX_Merge

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

func (*CloseSessionResponse) XXX_Size

func (m *CloseSessionResponse) XXX_Size() int

func (*CloseSessionResponse) XXX_Unmarshal

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

type EnterRequest

type EnterRequest struct {
}

func (*EnterRequest) Descriptor

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

func (*EnterRequest) Marshal

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

func (*EnterRequest) MarshalTo

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

func (*EnterRequest) MarshalToSizedBuffer

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

func (*EnterRequest) ProtoMessage

func (*EnterRequest) ProtoMessage()

func (*EnterRequest) Reset

func (m *EnterRequest) Reset()

func (*EnterRequest) Size

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

func (*EnterRequest) String

func (m *EnterRequest) String() string

func (*EnterRequest) Unmarshal

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

func (*EnterRequest) XXX_DiscardUnknown

func (m *EnterRequest) XXX_DiscardUnknown()

func (*EnterRequest) XXX_Marshal

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

func (*EnterRequest) XXX_Merge

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

func (*EnterRequest) XXX_Size

func (m *EnterRequest) XXX_Size() int

func (*EnterRequest) XXX_Unmarshal

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

type EnterResponse

type EnterResponse struct {
	CandidateID uint64 `protobuf:"varint,1,opt,name=candidate_id,json=candidateId,proto3" json:"candidate_id,omitempty"`
	Term        Term   `protobuf:"bytes,2,opt,name=term,proto3" json:"term"`
}

func (*EnterResponse) Descriptor

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

func (*EnterResponse) GetCandidateID added in v0.8.0

func (m *EnterResponse) GetCandidateID() uint64

func (*EnterResponse) GetTerm

func (m *EnterResponse) GetTerm() Term

func (*EnterResponse) Marshal

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

func (*EnterResponse) MarshalTo

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

func (*EnterResponse) MarshalToSizedBuffer

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

func (*EnterResponse) ProtoMessage

func (*EnterResponse) ProtoMessage()

func (*EnterResponse) Reset

func (m *EnterResponse) Reset()

func (*EnterResponse) Size

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

func (*EnterResponse) String

func (m *EnterResponse) String() string

func (*EnterResponse) Unmarshal

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

func (*EnterResponse) XXX_DiscardUnknown

func (m *EnterResponse) XXX_DiscardUnknown()

func (*EnterResponse) XXX_Marshal

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

func (*EnterResponse) XXX_Merge

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

func (*EnterResponse) XXX_Size

func (m *EnterResponse) XXX_Size() int

func (*EnterResponse) XXX_Unmarshal

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

type Event

type Event struct {
	Type Event_Type `protobuf:"varint,1,opt,name=type,proto3,enum=atomix.primitive.election.v1.Event_Type" json:"type,omitempty"`
	Term Term       `protobuf:"bytes,2,opt,name=term,proto3" json:"term"`
}

func (*Event) Descriptor

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

func (*Event) GetTerm

func (m *Event) GetTerm() Term

func (*Event) GetType

func (m *Event) GetType() Event_Type

func (*Event) Marshal

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

func (*Event) MarshalTo

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

func (*Event) MarshalToSizedBuffer

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

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) Reset

func (m *Event) Reset()

func (*Event) Size

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

func (*Event) String

func (m *Event) String() string

func (*Event) Unmarshal

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

func (*Event) XXX_DiscardUnknown

func (m *Event) XXX_DiscardUnknown()

func (*Event) XXX_Marshal

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

func (*Event) XXX_Merge

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

func (*Event) XXX_Size

func (m *Event) XXX_Size() int

func (*Event) XXX_Unmarshal

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

type Event_Type

type Event_Type int32
const (
	Event_NONE    Event_Type = 0
	Event_CHANGED Event_Type = 1
)

func (Event_Type) EnumDescriptor

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

func (Event_Type) String

func (x Event_Type) String() string

type EventsRequest

type EventsRequest struct {
}

func (*EventsRequest) Descriptor

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

func (*EventsRequest) Marshal

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

func (*EventsRequest) MarshalTo

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

func (*EventsRequest) MarshalToSizedBuffer

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

func (*EventsRequest) ProtoMessage

func (*EventsRequest) ProtoMessage()

func (*EventsRequest) Reset

func (m *EventsRequest) Reset()

func (*EventsRequest) Size

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

func (*EventsRequest) String

func (m *EventsRequest) String() string

func (*EventsRequest) Unmarshal

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

func (*EventsRequest) XXX_DiscardUnknown

func (m *EventsRequest) XXX_DiscardUnknown()

func (*EventsRequest) XXX_Marshal

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

func (*EventsRequest) XXX_Merge

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

func (*EventsRequest) XXX_Size

func (m *EventsRequest) XXX_Size() int

func (*EventsRequest) XXX_Unmarshal

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

type EventsResponse

type EventsResponse struct {
	Event Event `protobuf:"bytes,2,opt,name=event,proto3" json:"event"`
}

func (*EventsResponse) Descriptor

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

func (*EventsResponse) GetEvent

func (m *EventsResponse) GetEvent() Event

func (*EventsResponse) Marshal

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

func (*EventsResponse) MarshalTo

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

func (*EventsResponse) MarshalToSizedBuffer

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

func (*EventsResponse) ProtoMessage

func (*EventsResponse) ProtoMessage()

func (*EventsResponse) Reset

func (m *EventsResponse) Reset()

func (*EventsResponse) Size

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

func (*EventsResponse) String

func (m *EventsResponse) String() string

func (*EventsResponse) Unmarshal

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

func (*EventsResponse) XXX_DiscardUnknown

func (m *EventsResponse) XXX_DiscardUnknown()

func (*EventsResponse) XXX_Marshal

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

func (*EventsResponse) XXX_Merge

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

func (*EventsResponse) XXX_Size

func (m *EventsResponse) XXX_Size() int

func (*EventsResponse) XXX_Unmarshal

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

type EvictRequest

type EvictRequest struct {
	CandidateID uint64 `protobuf:"varint,2,opt,name=candidate_id,json=candidateId,proto3" json:"candidate_id,omitempty"`
}

func (*EvictRequest) Descriptor

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

func (*EvictRequest) GetCandidateID

func (m *EvictRequest) GetCandidateID() uint64

func (*EvictRequest) Marshal

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

func (*EvictRequest) MarshalTo

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

func (*EvictRequest) MarshalToSizedBuffer

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

func (*EvictRequest) ProtoMessage

func (*EvictRequest) ProtoMessage()

func (*EvictRequest) Reset

func (m *EvictRequest) Reset()

func (*EvictRequest) Size

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

func (*EvictRequest) String

func (m *EvictRequest) String() string

func (*EvictRequest) Unmarshal

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

func (*EvictRequest) XXX_DiscardUnknown

func (m *EvictRequest) XXX_DiscardUnknown()

func (*EvictRequest) XXX_Marshal

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

func (*EvictRequest) XXX_Merge

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

func (*EvictRequest) XXX_Size

func (m *EvictRequest) XXX_Size() int

func (*EvictRequest) XXX_Unmarshal

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

type EvictResponse

type EvictResponse struct {
	Term Term `protobuf:"bytes,2,opt,name=term,proto3" json:"term"`
}

func (*EvictResponse) Descriptor

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

func (*EvictResponse) GetTerm

func (m *EvictResponse) GetTerm() Term

func (*EvictResponse) Marshal

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

func (*EvictResponse) MarshalTo

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

func (*EvictResponse) MarshalToSizedBuffer

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

func (*EvictResponse) ProtoMessage

func (*EvictResponse) ProtoMessage()

func (*EvictResponse) Reset

func (m *EvictResponse) Reset()

func (*EvictResponse) Size

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

func (*EvictResponse) String

func (m *EvictResponse) String() string

func (*EvictResponse) Unmarshal

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

func (*EvictResponse) XXX_DiscardUnknown

func (m *EvictResponse) XXX_DiscardUnknown()

func (*EvictResponse) XXX_Marshal

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

func (*EvictResponse) XXX_Merge

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

func (*EvictResponse) XXX_Size

func (m *EvictResponse) XXX_Size() int

func (*EvictResponse) XXX_Unmarshal

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

type GetTermRequest

type GetTermRequest struct {
}

func (*GetTermRequest) Descriptor

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

func (*GetTermRequest) Marshal

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

func (*GetTermRequest) MarshalTo

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

func (*GetTermRequest) MarshalToSizedBuffer

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

func (*GetTermRequest) ProtoMessage

func (*GetTermRequest) ProtoMessage()

func (*GetTermRequest) Reset

func (m *GetTermRequest) Reset()

func (*GetTermRequest) Size

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

func (*GetTermRequest) String

func (m *GetTermRequest) String() string

func (*GetTermRequest) Unmarshal

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

func (*GetTermRequest) XXX_DiscardUnknown

func (m *GetTermRequest) XXX_DiscardUnknown()

func (*GetTermRequest) XXX_Marshal

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

func (*GetTermRequest) XXX_Merge

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

func (*GetTermRequest) XXX_Size

func (m *GetTermRequest) XXX_Size() int

func (*GetTermRequest) XXX_Unmarshal

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

type GetTermResponse

type GetTermResponse struct {
	Term Term `protobuf:"bytes,2,opt,name=term,proto3" json:"term"`
}

func (*GetTermResponse) Descriptor

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

func (*GetTermResponse) GetTerm

func (m *GetTermResponse) GetTerm() Term

func (*GetTermResponse) Marshal

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

func (*GetTermResponse) MarshalTo

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

func (*GetTermResponse) MarshalToSizedBuffer

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

func (*GetTermResponse) ProtoMessage

func (*GetTermResponse) ProtoMessage()

func (*GetTermResponse) Reset

func (m *GetTermResponse) Reset()

func (*GetTermResponse) Size

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

func (*GetTermResponse) String

func (m *GetTermResponse) String() string

func (*GetTermResponse) Unmarshal

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

func (*GetTermResponse) XXX_DiscardUnknown

func (m *GetTermResponse) XXX_DiscardUnknown()

func (*GetTermResponse) XXX_Marshal

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

func (*GetTermResponse) XXX_Merge

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

func (*GetTermResponse) XXX_Size

func (m *GetTermResponse) XXX_Size() int

func (*GetTermResponse) XXX_Unmarshal

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

type LeaderElectionClient

type LeaderElectionClient interface {
	// Enter enters the leader election
	Enter(ctx context.Context, in *EnterRequest, opts ...grpc.CallOption) (*EnterResponse, error)
	// Withdraw withdraws a candidate from the leader election
	Withdraw(ctx context.Context, in *WithdrawRequest, opts ...grpc.CallOption) (*WithdrawResponse, error)
	// Anoint anoints a candidate leader
	Anoint(ctx context.Context, in *AnointRequest, opts ...grpc.CallOption) (*AnointResponse, error)
	// Promote promotes a candidate
	Promote(ctx context.Context, in *PromoteRequest, opts ...grpc.CallOption) (*PromoteResponse, error)
	// Evict evicts a candidate from the election
	Evict(ctx context.Context, in *EvictRequest, opts ...grpc.CallOption) (*EvictResponse, error)
	// GetTerm gets the current leadership term
	GetTerm(ctx context.Context, in *GetTermRequest, opts ...grpc.CallOption) (*GetTermResponse, error)
	// Events listens for leadership events
	Events(ctx context.Context, in *EventsRequest, opts ...grpc.CallOption) (LeaderElection_EventsClient, error)
}

LeaderElectionClient is the client API for LeaderElection service.

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

func NewLeaderElectionClient

func NewLeaderElectionClient(cc *grpc.ClientConn) LeaderElectionClient

type LeaderElectionManagerClient added in v0.7.0

type LeaderElectionManagerClient interface {
	OpenSession(ctx context.Context, in *OpenSessionRequest, opts ...grpc.CallOption) (*OpenSessionResponse, error)
	CloseSession(ctx context.Context, in *CloseSessionRequest, opts ...grpc.CallOption) (*CloseSessionResponse, error)
}

LeaderElectionManagerClient is the client API for LeaderElectionManager service.

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

func NewLeaderElectionManagerClient added in v0.7.0

func NewLeaderElectionManagerClient(cc *grpc.ClientConn) LeaderElectionManagerClient

type LeaderElectionManagerServer added in v0.7.0

type LeaderElectionManagerServer interface {
	OpenSession(context.Context, *OpenSessionRequest) (*OpenSessionResponse, error)
	CloseSession(context.Context, *CloseSessionRequest) (*CloseSessionResponse, error)
}

LeaderElectionManagerServer is the server API for LeaderElectionManager service.

type LeaderElectionServer

type LeaderElectionServer interface {
	// Enter enters the leader election
	Enter(context.Context, *EnterRequest) (*EnterResponse, error)
	// Withdraw withdraws a candidate from the leader election
	Withdraw(context.Context, *WithdrawRequest) (*WithdrawResponse, error)
	// Anoint anoints a candidate leader
	Anoint(context.Context, *AnointRequest) (*AnointResponse, error)
	// Promote promotes a candidate
	Promote(context.Context, *PromoteRequest) (*PromoteResponse, error)
	// Evict evicts a candidate from the election
	Evict(context.Context, *EvictRequest) (*EvictResponse, error)
	// GetTerm gets the current leadership term
	GetTerm(context.Context, *GetTermRequest) (*GetTermResponse, error)
	// Events listens for leadership events
	Events(*EventsRequest, LeaderElection_EventsServer) error
}

LeaderElectionServer is the server API for LeaderElection service.

type LeaderElectionSessionOptions

type LeaderElectionSessionOptions struct {
}

func (*LeaderElectionSessionOptions) Descriptor

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

func (*LeaderElectionSessionOptions) Marshal

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

func (*LeaderElectionSessionOptions) MarshalTo

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

func (*LeaderElectionSessionOptions) MarshalToSizedBuffer

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

func (*LeaderElectionSessionOptions) ProtoMessage

func (*LeaderElectionSessionOptions) ProtoMessage()

func (*LeaderElectionSessionOptions) Reset

func (m *LeaderElectionSessionOptions) Reset()

func (*LeaderElectionSessionOptions) Size

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

func (*LeaderElectionSessionOptions) String

func (*LeaderElectionSessionOptions) Unmarshal

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

func (*LeaderElectionSessionOptions) XXX_DiscardUnknown

func (m *LeaderElectionSessionOptions) XXX_DiscardUnknown()

func (*LeaderElectionSessionOptions) XXX_Marshal

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

func (*LeaderElectionSessionOptions) XXX_Merge

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

func (*LeaderElectionSessionOptions) XXX_Size

func (m *LeaderElectionSessionOptions) XXX_Size() int

func (*LeaderElectionSessionOptions) XXX_Unmarshal

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

type LeaderElection_EventsClient

type LeaderElection_EventsClient interface {
	Recv() (*EventsResponse, error)
	grpc.ClientStream
}

type LeaderElection_EventsServer

type LeaderElection_EventsServer interface {
	Send(*EventsResponse) error
	grpc.ServerStream
}

type OpenSessionRequest

type OpenSessionRequest struct {
	PrimitiveID github_com_atomix_atomix_api_go_atomix_primitive_v1.ID `` /* 158-byte string literal not displayed */
	Options     LeaderElectionSessionOptions                           `protobuf:"bytes,2,opt,name=options,proto3" json:"options"`
}

func (*OpenSessionRequest) Descriptor

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

func (*OpenSessionRequest) GetOptions

func (*OpenSessionRequest) GetPrimitiveID

func (*OpenSessionRequest) Marshal

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

func (*OpenSessionRequest) MarshalTo

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

func (*OpenSessionRequest) MarshalToSizedBuffer

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

func (*OpenSessionRequest) ProtoMessage

func (*OpenSessionRequest) ProtoMessage()

func (*OpenSessionRequest) Reset

func (m *OpenSessionRequest) Reset()

func (*OpenSessionRequest) Size

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

func (*OpenSessionRequest) String

func (m *OpenSessionRequest) String() string

func (*OpenSessionRequest) Unmarshal

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

func (*OpenSessionRequest) XXX_DiscardUnknown

func (m *OpenSessionRequest) XXX_DiscardUnknown()

func (*OpenSessionRequest) XXX_Marshal

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

func (*OpenSessionRequest) XXX_Merge

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

func (*OpenSessionRequest) XXX_Size

func (m *OpenSessionRequest) XXX_Size() int

func (*OpenSessionRequest) XXX_Unmarshal

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

type OpenSessionResponse

type OpenSessionResponse struct {
	SessionID github_com_atomix_atomix_api_go_atomix_primitive_v1.SessionID `` /* 160-byte string literal not displayed */
}

func (*OpenSessionResponse) Descriptor

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

func (*OpenSessionResponse) Marshal

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

func (*OpenSessionResponse) MarshalTo

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

func (*OpenSessionResponse) MarshalToSizedBuffer

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

func (*OpenSessionResponse) ProtoMessage

func (*OpenSessionResponse) ProtoMessage()

func (*OpenSessionResponse) Reset

func (m *OpenSessionResponse) Reset()

func (*OpenSessionResponse) Size

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

func (*OpenSessionResponse) String

func (m *OpenSessionResponse) String() string

func (*OpenSessionResponse) Unmarshal

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

func (*OpenSessionResponse) XXX_DiscardUnknown

func (m *OpenSessionResponse) XXX_DiscardUnknown()

func (*OpenSessionResponse) XXX_Marshal

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

func (*OpenSessionResponse) XXX_Merge

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

func (*OpenSessionResponse) XXX_Size

func (m *OpenSessionResponse) XXX_Size() int

func (*OpenSessionResponse) XXX_Unmarshal

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

type PromoteRequest

type PromoteRequest struct {
	CandidateID uint64 `protobuf:"varint,2,opt,name=candidate_id,json=candidateId,proto3" json:"candidate_id,omitempty"`
}

func (*PromoteRequest) Descriptor

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

func (*PromoteRequest) GetCandidateID

func (m *PromoteRequest) GetCandidateID() uint64

func (*PromoteRequest) Marshal

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

func (*PromoteRequest) MarshalTo

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

func (*PromoteRequest) MarshalToSizedBuffer

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

func (*PromoteRequest) ProtoMessage

func (*PromoteRequest) ProtoMessage()

func (*PromoteRequest) Reset

func (m *PromoteRequest) Reset()

func (*PromoteRequest) Size

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

func (*PromoteRequest) String

func (m *PromoteRequest) String() string

func (*PromoteRequest) Unmarshal

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

func (*PromoteRequest) XXX_DiscardUnknown

func (m *PromoteRequest) XXX_DiscardUnknown()

func (*PromoteRequest) XXX_Marshal

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

func (*PromoteRequest) XXX_Merge

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

func (*PromoteRequest) XXX_Size

func (m *PromoteRequest) XXX_Size() int

func (*PromoteRequest) XXX_Unmarshal

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

type PromoteResponse

type PromoteResponse struct {
	Term Term `protobuf:"bytes,2,opt,name=term,proto3" json:"term"`
}

func (*PromoteResponse) Descriptor

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

func (*PromoteResponse) GetTerm

func (m *PromoteResponse) GetTerm() Term

func (*PromoteResponse) Marshal

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

func (*PromoteResponse) MarshalTo

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

func (*PromoteResponse) MarshalToSizedBuffer

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

func (*PromoteResponse) ProtoMessage

func (*PromoteResponse) ProtoMessage()

func (*PromoteResponse) Reset

func (m *PromoteResponse) Reset()

func (*PromoteResponse) Size

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

func (*PromoteResponse) String

func (m *PromoteResponse) String() string

func (*PromoteResponse) Unmarshal

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

func (*PromoteResponse) XXX_DiscardUnknown

func (m *PromoteResponse) XXX_DiscardUnknown()

func (*PromoteResponse) XXX_Marshal

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

func (*PromoteResponse) XXX_Merge

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

func (*PromoteResponse) XXX_Size

func (m *PromoteResponse) XXX_Size() int

func (*PromoteResponse) XXX_Unmarshal

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

type Term

type Term struct {
	v1.ObjectMeta `protobuf:"bytes,1,opt,name=meta,proto3,embedded=meta" json:"meta"`
	Leader        uint64   `protobuf:"varint,2,opt,name=leader,proto3" json:"leader,omitempty"`
	Candidates    []uint64 `protobuf:"varint,3,rep,packed,name=candidates,proto3" json:"candidates,omitempty"`
}

func (*Term) Descriptor

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

func (*Term) GetCandidates

func (m *Term) GetCandidates() []uint64

func (*Term) GetLeader

func (m *Term) GetLeader() uint64

func (*Term) Marshal

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

func (*Term) MarshalTo

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

func (*Term) MarshalToSizedBuffer

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

func (*Term) ProtoMessage

func (*Term) ProtoMessage()

func (*Term) Reset

func (m *Term) Reset()

func (*Term) Size

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

func (*Term) String

func (m *Term) String() string

func (*Term) Unmarshal

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

func (*Term) XXX_DiscardUnknown

func (m *Term) XXX_DiscardUnknown()

func (*Term) XXX_Marshal

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

func (*Term) XXX_Merge

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

func (*Term) XXX_Size

func (m *Term) XXX_Size() int

func (*Term) XXX_Unmarshal

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

type UnimplementedLeaderElectionManagerServer added in v0.7.0

type UnimplementedLeaderElectionManagerServer struct {
}

UnimplementedLeaderElectionManagerServer can be embedded to have forward compatible implementations.

func (*UnimplementedLeaderElectionManagerServer) CloseSession added in v0.7.0

func (*UnimplementedLeaderElectionManagerServer) OpenSession added in v0.7.0

type UnimplementedLeaderElectionServer

type UnimplementedLeaderElectionServer struct {
}

UnimplementedLeaderElectionServer can be embedded to have forward compatible implementations.

func (*UnimplementedLeaderElectionServer) Anoint

func (*UnimplementedLeaderElectionServer) Enter

func (*UnimplementedLeaderElectionServer) Events

func (*UnimplementedLeaderElectionServer) Evict

func (*UnimplementedLeaderElectionServer) GetTerm

func (*UnimplementedLeaderElectionServer) Promote

func (*UnimplementedLeaderElectionServer) Withdraw

type WithdrawRequest

type WithdrawRequest struct {
	CandidateID uint64 `protobuf:"varint,2,opt,name=candidate_id,json=candidateId,proto3" json:"candidate_id,omitempty"`
}

func (*WithdrawRequest) Descriptor

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

func (*WithdrawRequest) GetCandidateID

func (m *WithdrawRequest) GetCandidateID() uint64

func (*WithdrawRequest) Marshal

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

func (*WithdrawRequest) MarshalTo

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

func (*WithdrawRequest) MarshalToSizedBuffer

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

func (*WithdrawRequest) ProtoMessage

func (*WithdrawRequest) ProtoMessage()

func (*WithdrawRequest) Reset

func (m *WithdrawRequest) Reset()

func (*WithdrawRequest) Size

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

func (*WithdrawRequest) String

func (m *WithdrawRequest) String() string

func (*WithdrawRequest) Unmarshal

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

func (*WithdrawRequest) XXX_DiscardUnknown

func (m *WithdrawRequest) XXX_DiscardUnknown()

func (*WithdrawRequest) XXX_Marshal

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

func (*WithdrawRequest) XXX_Merge

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

func (*WithdrawRequest) XXX_Size

func (m *WithdrawRequest) XXX_Size() int

func (*WithdrawRequest) XXX_Unmarshal

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

type WithdrawResponse

type WithdrawResponse struct {
	Term Term `protobuf:"bytes,2,opt,name=term,proto3" json:"term"`
}

func (*WithdrawResponse) Descriptor

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

func (*WithdrawResponse) GetTerm

func (m *WithdrawResponse) GetTerm() Term

func (*WithdrawResponse) Marshal

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

func (*WithdrawResponse) MarshalTo

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

func (*WithdrawResponse) MarshalToSizedBuffer

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

func (*WithdrawResponse) ProtoMessage

func (*WithdrawResponse) ProtoMessage()

func (*WithdrawResponse) Reset

func (m *WithdrawResponse) Reset()

func (*WithdrawResponse) Size

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

func (*WithdrawResponse) String

func (m *WithdrawResponse) String() string

func (*WithdrawResponse) Unmarshal

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

func (*WithdrawResponse) XXX_DiscardUnknown

func (m *WithdrawResponse) XXX_DiscardUnknown()

func (*WithdrawResponse) XXX_Marshal

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

func (*WithdrawResponse) XXX_Merge

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

func (*WithdrawResponse) XXX_Size

func (m *WithdrawResponse) XXX_Size() int

func (*WithdrawResponse) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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