leader

package
v0.3.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthLatch        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowLatch          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupLatch = fmt.Errorf("proto: unexpected end of group")
)
View Source
var EventResponse_Type_name = map[int32]string{
	0: "CHANGED",
}
View Source
var EventResponse_Type_value = map[string]int32{
	"CHANGED": 0,
}

Functions

func RegisterLeaderLatchServiceServer

func RegisterLeaderLatchServiceServer(s *grpc.Server, srv LeaderLatchServiceServer)

Types

type CloseRequest

type CloseRequest struct {
	Header *headers.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Delete bool                   `protobuf:"varint,2,opt,name=delete,proto3" json:"delete,omitempty"`
}

func (*CloseRequest) Descriptor

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

func (*CloseRequest) GetDelete

func (m *CloseRequest) GetDelete() bool

func (*CloseRequest) GetHeader

func (m *CloseRequest) GetHeader() *headers.RequestHeader

func (*CloseRequest) Marshal

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

func (*CloseRequest) MarshalTo

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

func (*CloseRequest) MarshalToSizedBuffer

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

func (*CloseRequest) ProtoMessage

func (*CloseRequest) ProtoMessage()

func (*CloseRequest) Reset

func (m *CloseRequest) Reset()

func (*CloseRequest) Size

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

func (*CloseRequest) String

func (m *CloseRequest) String() string

func (*CloseRequest) Unmarshal

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

func (*CloseRequest) XXX_DiscardUnknown

func (m *CloseRequest) XXX_DiscardUnknown()

func (*CloseRequest) XXX_Marshal

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

func (*CloseRequest) XXX_Merge

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

func (*CloseRequest) XXX_Size

func (m *CloseRequest) XXX_Size() int

func (*CloseRequest) XXX_Unmarshal

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

type CloseResponse

type CloseResponse struct {
	Header *headers.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
}

func (*CloseResponse) Descriptor

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

func (*CloseResponse) GetHeader

func (m *CloseResponse) GetHeader() *headers.ResponseHeader

func (*CloseResponse) Marshal

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

func (*CloseResponse) MarshalTo

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

func (*CloseResponse) MarshalToSizedBuffer

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

func (*CloseResponse) ProtoMessage

func (*CloseResponse) ProtoMessage()

func (*CloseResponse) Reset

func (m *CloseResponse) Reset()

func (*CloseResponse) Size

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

func (*CloseResponse) String

func (m *CloseResponse) String() string

func (*CloseResponse) Unmarshal

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

func (*CloseResponse) XXX_DiscardUnknown

func (m *CloseResponse) XXX_DiscardUnknown()

func (*CloseResponse) XXX_Marshal

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

func (*CloseResponse) XXX_Merge

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

func (*CloseResponse) XXX_Size

func (m *CloseResponse) XXX_Size() int

func (*CloseResponse) XXX_Unmarshal

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

type CreateRequest

type CreateRequest struct {
	Header *headers.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
}

func (*CreateRequest) Descriptor

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

func (*CreateRequest) GetHeader

func (m *CreateRequest) GetHeader() *headers.RequestHeader

func (*CreateRequest) Marshal

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

func (*CreateRequest) MarshalTo

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

func (*CreateRequest) MarshalToSizedBuffer

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

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) Reset

func (m *CreateRequest) Reset()

func (*CreateRequest) Size

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

func (*CreateRequest) String

func (m *CreateRequest) String() string

func (*CreateRequest) Unmarshal

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

func (*CreateRequest) XXX_DiscardUnknown

func (m *CreateRequest) XXX_DiscardUnknown()

func (*CreateRequest) XXX_Marshal

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

func (*CreateRequest) XXX_Merge

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

func (*CreateRequest) XXX_Size

func (m *CreateRequest) XXX_Size() int

func (*CreateRequest) XXX_Unmarshal

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

type CreateResponse

type CreateResponse struct {
	Header *headers.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
}

func (*CreateResponse) Descriptor

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

func (*CreateResponse) GetHeader

func (m *CreateResponse) GetHeader() *headers.ResponseHeader

func (*CreateResponse) Marshal

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

func (*CreateResponse) MarshalTo

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

func (*CreateResponse) MarshalToSizedBuffer

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

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) Reset

func (m *CreateResponse) Reset()

func (*CreateResponse) Size

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

func (*CreateResponse) String

func (m *CreateResponse) String() string

func (*CreateResponse) Unmarshal

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

func (*CreateResponse) XXX_DiscardUnknown

func (m *CreateResponse) XXX_DiscardUnknown()

func (*CreateResponse) XXX_Marshal

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

func (*CreateResponse) XXX_Merge

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

func (*CreateResponse) XXX_Size

func (m *CreateResponse) XXX_Size() int

func (*CreateResponse) XXX_Unmarshal

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

type EventRequest

type EventRequest struct {
	Header *headers.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
}

func (*EventRequest) Descriptor

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

func (*EventRequest) GetHeader

func (m *EventRequest) GetHeader() *headers.RequestHeader

func (*EventRequest) Marshal

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

func (*EventRequest) MarshalTo

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

func (*EventRequest) MarshalToSizedBuffer

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

func (*EventRequest) ProtoMessage

func (*EventRequest) ProtoMessage()

func (*EventRequest) Reset

func (m *EventRequest) Reset()

func (*EventRequest) Size

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

func (*EventRequest) String

func (m *EventRequest) String() string

func (*EventRequest) Unmarshal

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

func (*EventRequest) XXX_DiscardUnknown

func (m *EventRequest) XXX_DiscardUnknown()

func (*EventRequest) XXX_Marshal

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

func (*EventRequest) XXX_Merge

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

func (*EventRequest) XXX_Size

func (m *EventRequest) XXX_Size() int

func (*EventRequest) XXX_Unmarshal

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

type EventResponse

type EventResponse struct {
	Header *headers.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Type   EventResponse_Type      `protobuf:"varint,2,opt,name=type,proto3,enum=atomix.leader.EventResponse_Type" json:"type,omitempty"`
	Latch  *Latch                  `protobuf:"bytes,3,opt,name=latch,proto3" json:"latch,omitempty"`
}

func (*EventResponse) Descriptor

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

func (*EventResponse) GetHeader

func (m *EventResponse) GetHeader() *headers.ResponseHeader

func (*EventResponse) GetLatch

func (m *EventResponse) GetLatch() *Latch

func (*EventResponse) GetType

func (m *EventResponse) GetType() EventResponse_Type

func (*EventResponse) Marshal

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

func (*EventResponse) MarshalTo

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

func (*EventResponse) MarshalToSizedBuffer

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

func (*EventResponse) ProtoMessage

func (*EventResponse) ProtoMessage()

func (*EventResponse) Reset

func (m *EventResponse) Reset()

func (*EventResponse) Size

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

func (*EventResponse) String

func (m *EventResponse) String() string

func (*EventResponse) Unmarshal

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

func (*EventResponse) XXX_DiscardUnknown

func (m *EventResponse) XXX_DiscardUnknown()

func (*EventResponse) XXX_Marshal

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

func (*EventResponse) XXX_Merge

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

func (*EventResponse) XXX_Size

func (m *EventResponse) XXX_Size() int

func (*EventResponse) XXX_Unmarshal

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

type EventResponse_Type

type EventResponse_Type int32
const (
	EventResponse_CHANGED EventResponse_Type = 0
)

func (EventResponse_Type) EnumDescriptor

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

func (EventResponse_Type) String

func (x EventResponse_Type) String() string

type GetRequest

type GetRequest struct {
	Header *headers.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
}

func (*GetRequest) Descriptor

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

func (*GetRequest) GetHeader

func (m *GetRequest) GetHeader() *headers.RequestHeader

func (*GetRequest) Marshal

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

func (*GetRequest) MarshalTo

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

func (*GetRequest) MarshalToSizedBuffer

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

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) Reset

func (m *GetRequest) Reset()

func (*GetRequest) Size

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

func (*GetRequest) String

func (m *GetRequest) String() string

func (*GetRequest) Unmarshal

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

func (*GetRequest) XXX_DiscardUnknown

func (m *GetRequest) XXX_DiscardUnknown()

func (*GetRequest) XXX_Marshal

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

func (*GetRequest) XXX_Merge

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

func (*GetRequest) XXX_Size

func (m *GetRequest) XXX_Size() int

func (*GetRequest) XXX_Unmarshal

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

type GetResponse

type GetResponse struct {
	Header *headers.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Latch  *Latch                  `protobuf:"bytes,2,opt,name=latch,proto3" json:"latch,omitempty"`
}

func (*GetResponse) Descriptor

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

func (*GetResponse) GetHeader

func (m *GetResponse) GetHeader() *headers.ResponseHeader

func (*GetResponse) GetLatch

func (m *GetResponse) GetLatch() *Latch

func (*GetResponse) Marshal

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

func (*GetResponse) MarshalTo

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

func (*GetResponse) MarshalToSizedBuffer

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

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) Reset

func (m *GetResponse) Reset()

func (*GetResponse) Size

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

func (*GetResponse) String

func (m *GetResponse) String() string

func (*GetResponse) Unmarshal

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

func (*GetResponse) XXX_DiscardUnknown

func (m *GetResponse) XXX_DiscardUnknown()

func (*GetResponse) XXX_Marshal

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

func (*GetResponse) XXX_Merge

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

func (*GetResponse) XXX_Size

func (m *GetResponse) XXX_Size() int

func (*GetResponse) XXX_Unmarshal

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

type Latch

type Latch struct {
	ID           uint64   `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Leader       string   `protobuf:"bytes,2,opt,name=leader,proto3" json:"leader,omitempty"`
	Participants []string `protobuf:"bytes,3,rep,name=participants,proto3" json:"participants,omitempty"`
}

func (*Latch) Descriptor

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

func (*Latch) GetID

func (m *Latch) GetID() uint64

func (*Latch) GetLeader

func (m *Latch) GetLeader() string

func (*Latch) GetParticipants

func (m *Latch) GetParticipants() []string

func (*Latch) Marshal

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

func (*Latch) MarshalTo

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

func (*Latch) MarshalToSizedBuffer

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

func (*Latch) ProtoMessage

func (*Latch) ProtoMessage()

func (*Latch) Reset

func (m *Latch) Reset()

func (*Latch) Size

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

func (*Latch) String

func (m *Latch) String() string

func (*Latch) Unmarshal

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

func (*Latch) XXX_DiscardUnknown

func (m *Latch) XXX_DiscardUnknown()

func (*Latch) XXX_Marshal

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

func (*Latch) XXX_Merge

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

func (*Latch) XXX_Size

func (m *Latch) XXX_Size() int

func (*Latch) XXX_Unmarshal

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

type LatchRequest

type LatchRequest struct {
	Header        *headers.RequestHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	ParticipantID string                 `protobuf:"bytes,2,opt,name=participant_id,json=participantId,proto3" json:"participant_id,omitempty"`
}

func (*LatchRequest) Descriptor

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

func (*LatchRequest) GetHeader

func (m *LatchRequest) GetHeader() *headers.RequestHeader

func (*LatchRequest) GetParticipantID

func (m *LatchRequest) GetParticipantID() string

func (*LatchRequest) Marshal

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

func (*LatchRequest) MarshalTo

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

func (*LatchRequest) MarshalToSizedBuffer

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

func (*LatchRequest) ProtoMessage

func (*LatchRequest) ProtoMessage()

func (*LatchRequest) Reset

func (m *LatchRequest) Reset()

func (*LatchRequest) Size

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

func (*LatchRequest) String

func (m *LatchRequest) String() string

func (*LatchRequest) Unmarshal

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

func (*LatchRequest) XXX_DiscardUnknown

func (m *LatchRequest) XXX_DiscardUnknown()

func (*LatchRequest) XXX_Marshal

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

func (*LatchRequest) XXX_Merge

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

func (*LatchRequest) XXX_Size

func (m *LatchRequest) XXX_Size() int

func (*LatchRequest) XXX_Unmarshal

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

type LatchResponse

type LatchResponse struct {
	Header *headers.ResponseHeader `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
	Latch  *Latch                  `protobuf:"bytes,2,opt,name=latch,proto3" json:"latch,omitempty"`
}

func (*LatchResponse) Descriptor

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

func (*LatchResponse) GetHeader

func (m *LatchResponse) GetHeader() *headers.ResponseHeader

func (*LatchResponse) GetLatch

func (m *LatchResponse) GetLatch() *Latch

func (*LatchResponse) Marshal

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

func (*LatchResponse) MarshalTo

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

func (*LatchResponse) MarshalToSizedBuffer

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

func (*LatchResponse) ProtoMessage

func (*LatchResponse) ProtoMessage()

func (*LatchResponse) Reset

func (m *LatchResponse) Reset()

func (*LatchResponse) Size

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

func (*LatchResponse) String

func (m *LatchResponse) String() string

func (*LatchResponse) Unmarshal

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

func (*LatchResponse) XXX_DiscardUnknown

func (m *LatchResponse) XXX_DiscardUnknown()

func (*LatchResponse) XXX_Marshal

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

func (*LatchResponse) XXX_Merge

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

func (*LatchResponse) XXX_Size

func (m *LatchResponse) XXX_Size() int

func (*LatchResponse) XXX_Unmarshal

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

type LeaderLatchServiceClient

type LeaderLatchServiceClient interface {
	// Create creates a leader latch
	Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
	// Close closes a leader latch
	Close(ctx context.Context, in *CloseRequest, opts ...grpc.CallOption) (*CloseResponse, error)
	// Latch attempts to acquire the leader latch
	Latch(ctx context.Context, in *LatchRequest, opts ...grpc.CallOption) (*LatchResponse, error)
	// Get gets the current leader
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	// Events listens for leader change events
	Events(ctx context.Context, in *EventRequest, opts ...grpc.CallOption) (LeaderLatchService_EventsClient, error)
}

LeaderLatchServiceClient is the client API for LeaderLatchService service.

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

func NewLeaderLatchServiceClient

func NewLeaderLatchServiceClient(cc *grpc.ClientConn) LeaderLatchServiceClient

type LeaderLatchServiceServer

type LeaderLatchServiceServer interface {
	// Create creates a leader latch
	Create(context.Context, *CreateRequest) (*CreateResponse, error)
	// Close closes a leader latch
	Close(context.Context, *CloseRequest) (*CloseResponse, error)
	// Latch attempts to acquire the leader latch
	Latch(context.Context, *LatchRequest) (*LatchResponse, error)
	// Get gets the current leader
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// Events listens for leader change events
	Events(*EventRequest, LeaderLatchService_EventsServer) error
}

LeaderLatchServiceServer is the server API for LeaderLatchService service.

type LeaderLatchService_EventsClient

type LeaderLatchService_EventsClient interface {
	Recv() (*EventResponse, error)
	grpc.ClientStream
}

type LeaderLatchService_EventsServer

type LeaderLatchService_EventsServer interface {
	Send(*EventResponse) error
	grpc.ServerStream
}

type UnimplementedLeaderLatchServiceServer

type UnimplementedLeaderLatchServiceServer struct {
}

UnimplementedLeaderLatchServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedLeaderLatchServiceServer) Close

func (*UnimplementedLeaderLatchServiceServer) Create

func (*UnimplementedLeaderLatchServiceServer) Events

func (*UnimplementedLeaderLatchServiceServer) Get

func (*UnimplementedLeaderLatchServiceServer) Latch

Jump to

Keyboard shortcuts

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