etcdserverpb

package
v2.1.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package etcdserverpb is a generated protocol buffer package.

It is generated from these files:

etcdserver.proto
rpc.proto

It has these top-level messages:

Request
Metadata

Index

Constants

This section is empty.

Variables

View Source
var Compare_CompareType_name = map[int32]string{
	0: "EQUAL",
	1: "GREATER",
	2: "LESS",
}
View Source
var Compare_CompareType_value = map[string]int32{
	"EQUAL":   0,
	"GREATER": 1,
	"LESS":    2,
}

Functions

func RegisterEtcdServer

func RegisterEtcdServer(s *grpc.Server, srv EtcdServer)

Types

type CompactionRequest

type CompactionRequest struct {
	Index int64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
}

func (*CompactionRequest) Marshal

func (m *CompactionRequest) Marshal() (data []byte, err error)

func (*CompactionRequest) MarshalTo

func (m *CompactionRequest) MarshalTo(data []byte) (n int, err error)

func (*CompactionRequest) ProtoMessage

func (*CompactionRequest) ProtoMessage()

func (*CompactionRequest) Reset

func (m *CompactionRequest) Reset()

func (*CompactionRequest) Size

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

func (*CompactionRequest) String

func (m *CompactionRequest) String() string

func (*CompactionRequest) Unmarshal

func (m *CompactionRequest) Unmarshal(data []byte) error

type CompactionResponse

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

func (*CompactionResponse) GetHeader

func (m *CompactionResponse) GetHeader() *ResponseHeader

func (*CompactionResponse) Marshal

func (m *CompactionResponse) Marshal() (data []byte, err error)

func (*CompactionResponse) MarshalTo

func (m *CompactionResponse) MarshalTo(data []byte) (n int, err error)

func (*CompactionResponse) ProtoMessage

func (*CompactionResponse) ProtoMessage()

func (*CompactionResponse) Reset

func (m *CompactionResponse) Reset()

func (*CompactionResponse) Size

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

func (*CompactionResponse) String

func (m *CompactionResponse) String() string

func (*CompactionResponse) Unmarshal

func (m *CompactionResponse) Unmarshal(data []byte) error

type Compare

type Compare struct {
	Type Compare_CompareType `protobuf:"varint,1,opt,name=type,proto3,enum=etcdserverpb.Compare_CompareType" json:"type,omitempty"`
	// key path
	Key []byte `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
	// version of the given key
	Version int64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
	// create index of the given key
	CreateIndex int64 `protobuf:"varint,4,opt,name=create_index,proto3" json:"create_index,omitempty"`
	// last modified index of the given key
	ModIndex int64 `protobuf:"varint,5,opt,name=mod_index,proto3" json:"mod_index,omitempty"`
	// value of the given key
	Value []byte `protobuf:"bytes,6,opt,name=value,proto3" json:"value,omitempty"`
}

func (*Compare) Marshal

func (m *Compare) Marshal() (data []byte, err error)

func (*Compare) MarshalTo

func (m *Compare) MarshalTo(data []byte) (n int, err error)

func (*Compare) ProtoMessage

func (*Compare) ProtoMessage()

func (*Compare) Reset

func (m *Compare) Reset()

func (*Compare) Size

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

func (*Compare) String

func (m *Compare) String() string

func (*Compare) Unmarshal

func (m *Compare) Unmarshal(data []byte) error

type Compare_CompareType

type Compare_CompareType int32
const (
	Compare_EQUAL   Compare_CompareType = 0
	Compare_GREATER Compare_CompareType = 1
	Compare_LESS    Compare_CompareType = 2
)

func (Compare_CompareType) String

func (x Compare_CompareType) String() string

type DeleteRangeRequest

type DeleteRangeRequest struct {
	// if the range_end is not given, the request deletes the key.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// if the range_end is given, it deletes the keys in range [key, range_end).
	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
}

func (*DeleteRangeRequest) Marshal

func (m *DeleteRangeRequest) Marshal() (data []byte, err error)

func (*DeleteRangeRequest) MarshalTo

func (m *DeleteRangeRequest) MarshalTo(data []byte) (n int, err error)

func (*DeleteRangeRequest) ProtoMessage

func (*DeleteRangeRequest) ProtoMessage()

func (*DeleteRangeRequest) Reset

func (m *DeleteRangeRequest) Reset()

func (*DeleteRangeRequest) Size

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

func (*DeleteRangeRequest) String

func (m *DeleteRangeRequest) String() string

func (*DeleteRangeRequest) Unmarshal

func (m *DeleteRangeRequest) Unmarshal(data []byte) error

type DeleteRangeResponse

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

func (*DeleteRangeResponse) GetHeader

func (m *DeleteRangeResponse) GetHeader() *ResponseHeader

func (*DeleteRangeResponse) Marshal

func (m *DeleteRangeResponse) Marshal() (data []byte, err error)

func (*DeleteRangeResponse) MarshalTo

func (m *DeleteRangeResponse) MarshalTo(data []byte) (n int, err error)

func (*DeleteRangeResponse) ProtoMessage

func (*DeleteRangeResponse) ProtoMessage()

func (*DeleteRangeResponse) Reset

func (m *DeleteRangeResponse) Reset()

func (*DeleteRangeResponse) Size

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

func (*DeleteRangeResponse) String

func (m *DeleteRangeResponse) String() string

func (*DeleteRangeResponse) Unmarshal

func (m *DeleteRangeResponse) Unmarshal(data []byte) error

type EtcdClient

type EtcdClient interface {
	// Range gets the keys in the range from the store.
	Range(ctx context.Context, in *RangeRequest, opts ...grpc.CallOption) (*RangeResponse, error)
	// Put puts the given key into the store.
	// A put request increases the index of the store,
	// and generates one event in the event history.
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*PutResponse, error)
	// Delete deletes the given range from the store.
	// A delete request increase the index of the store,
	// and generates one event in the event history.
	DeleteRange(ctx context.Context, in *DeleteRangeRequest, opts ...grpc.CallOption) (*DeleteRangeResponse, error)
	// Tnx processes all the requests in one transaction.
	// A tnx request increases the index of the store,
	// and generates events with the same index in the event history.
	Tnx(ctx context.Context, in *TnxRequest, opts ...grpc.CallOption) (*TnxResponse, error)
	// Compact compacts the event history in etcd. User should compact the
	// event history periodically, or it will grow infinitely.
	Compact(ctx context.Context, in *CompactionRequest, opts ...grpc.CallOption) (*CompactionResponse, error)
}

func NewEtcdClient

func NewEtcdClient(cc *grpc.ClientConn) EtcdClient

type EtcdServer

type EtcdServer interface {
	// Range gets the keys in the range from the store.
	Range(context.Context, *RangeRequest) (*RangeResponse, error)
	// Put puts the given key into the store.
	// A put request increases the index of the store,
	// and generates one event in the event history.
	Put(context.Context, *PutRequest) (*PutResponse, error)
	// Delete deletes the given range from the store.
	// A delete request increase the index of the store,
	// and generates one event in the event history.
	DeleteRange(context.Context, *DeleteRangeRequest) (*DeleteRangeResponse, error)
	// Tnx processes all the requests in one transaction.
	// A tnx request increases the index of the store,
	// and generates events with the same index in the event history.
	Tnx(context.Context, *TnxRequest) (*TnxResponse, error)
	// Compact compacts the event history in etcd. User should compact the
	// event history periodically, or it will grow infinitely.
	Compact(context.Context, *CompactionRequest) (*CompactionResponse, error)
}

type Metadata

type Metadata struct {
	NodeID           uint64 `protobuf:"varint,1,opt" json:"NodeID"`
	ClusterID        uint64 `protobuf:"varint,2,opt" json:"ClusterID"`
	XXX_unrecognized []byte `json:"-"`
}

func (*Metadata) Marshal

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

func (*Metadata) MarshalTo

func (m *Metadata) MarshalTo(data []byte) (n int, err 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

type PutRequest

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

func (*PutRequest) Marshal

func (m *PutRequest) Marshal() (data []byte, err error)

func (*PutRequest) MarshalTo

func (m *PutRequest) MarshalTo(data []byte) (n int, err error)

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) Reset

func (m *PutRequest) Reset()

func (*PutRequest) Size

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

func (*PutRequest) String

func (m *PutRequest) String() string

func (*PutRequest) Unmarshal

func (m *PutRequest) Unmarshal(data []byte) error

type PutResponse

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

func (*PutResponse) GetHeader

func (m *PutResponse) GetHeader() *ResponseHeader

func (*PutResponse) Marshal

func (m *PutResponse) Marshal() (data []byte, err error)

func (*PutResponse) MarshalTo

func (m *PutResponse) MarshalTo(data []byte) (n int, err error)

func (*PutResponse) ProtoMessage

func (*PutResponse) ProtoMessage()

func (*PutResponse) Reset

func (m *PutResponse) Reset()

func (*PutResponse) Size

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

func (*PutResponse) String

func (m *PutResponse) String() string

func (*PutResponse) Unmarshal

func (m *PutResponse) Unmarshal(data []byte) error

type RangeRequest

type RangeRequest struct {
	// if the range_end is not given, the request returns the key.
	Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// if the range_end is given, it gets the keys in range [key, range_end).
	RangeEnd []byte `protobuf:"bytes,2,opt,name=range_end,proto3" json:"range_end,omitempty"`
	// limit the number of keys returned.
	Limit int64 `protobuf:"varint,3,opt,name=limit,proto3" json:"limit,omitempty"`
	// the response will be consistent with previous request with same token if the token is
	// given and is vaild.
	ConsistentToken []byte `protobuf:"bytes,4,opt,name=consistent_token,proto3" json:"consistent_token,omitempty"`
}

func (*RangeRequest) Marshal

func (m *RangeRequest) Marshal() (data []byte, err error)

func (*RangeRequest) MarshalTo

func (m *RangeRequest) MarshalTo(data []byte) (n int, err error)

func (*RangeRequest) ProtoMessage

func (*RangeRequest) ProtoMessage()

func (*RangeRequest) Reset

func (m *RangeRequest) Reset()

func (*RangeRequest) Size

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

func (*RangeRequest) String

func (m *RangeRequest) String() string

func (*RangeRequest) Unmarshal

func (m *RangeRequest) Unmarshal(data []byte) error

type RangeResponse

type RangeResponse struct {
	Header          *ResponseHeader       `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
	Kvs             []*storagepb.KeyValue `protobuf:"bytes,2,rep,name=kvs" json:"kvs,omitempty"`
	ConsistentToken []byte                `protobuf:"bytes,3,opt,name=consistent_token,proto3" json:"consistent_token,omitempty"`
}

func (*RangeResponse) GetHeader

func (m *RangeResponse) GetHeader() *ResponseHeader

func (*RangeResponse) GetKvs

func (m *RangeResponse) GetKvs() []*storagepb.KeyValue

func (*RangeResponse) Marshal

func (m *RangeResponse) Marshal() (data []byte, err error)

func (*RangeResponse) MarshalTo

func (m *RangeResponse) MarshalTo(data []byte) (n int, err error)

func (*RangeResponse) ProtoMessage

func (*RangeResponse) ProtoMessage()

func (*RangeResponse) Reset

func (m *RangeResponse) Reset()

func (*RangeResponse) Size

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

func (*RangeResponse) String

func (m *RangeResponse) String() string

func (*RangeResponse) Unmarshal

func (m *RangeResponse) Unmarshal(data []byte) error

type Request

type Request struct {
	ID               uint64 `protobuf:"varint,1,opt" json:"ID"`
	Method           string `protobuf:"bytes,2,opt" json:"Method"`
	Path             string `protobuf:"bytes,3,opt" json:"Path"`
	Val              string `protobuf:"bytes,4,opt" json:"Val"`
	Dir              bool   `protobuf:"varint,5,opt" json:"Dir"`
	PrevValue        string `protobuf:"bytes,6,opt" json:"PrevValue"`
	PrevIndex        uint64 `protobuf:"varint,7,opt" json:"PrevIndex"`
	PrevExist        *bool  `protobuf:"varint,8,opt" json:"PrevExist,omitempty"`
	Expiration       int64  `protobuf:"varint,9,opt" json:"Expiration"`
	Wait             bool   `protobuf:"varint,10,opt" json:"Wait"`
	Since            uint64 `protobuf:"varint,11,opt" json:"Since"`
	Recursive        bool   `protobuf:"varint,12,opt" json:"Recursive"`
	Sorted           bool   `protobuf:"varint,13,opt" json:"Sorted"`
	Quorum           bool   `protobuf:"varint,14,opt" json:"Quorum"`
	Time             int64  `protobuf:"varint,15,opt" json:"Time"`
	Stream           bool   `protobuf:"varint,16,opt" json:"Stream"`
	XXX_unrecognized []byte `json:"-"`
}

func (*Request) Marshal

func (m *Request) Marshal() (data []byte, err error)

func (*Request) MarshalTo

func (m *Request) MarshalTo(data []byte) (n int, err error)

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) Reset

func (m *Request) Reset()

func (*Request) Size

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

func (*Request) String

func (m *Request) String() string

func (*Request) Unmarshal

func (m *Request) Unmarshal(data []byte) error

type RequestUnion

type RequestUnion struct {
	RequestRange       *RangeRequest       `protobuf:"bytes,1,opt,name=request_range" json:"request_range,omitempty"`
	RequestPut         *PutRequest         `protobuf:"bytes,2,opt,name=request_put" json:"request_put,omitempty"`
	RequestDeleteRange *DeleteRangeRequest `protobuf:"bytes,3,opt,name=request_delete_range" json:"request_delete_range,omitempty"`
}

func (*RequestUnion) GetRequestDeleteRange

func (m *RequestUnion) GetRequestDeleteRange() *DeleteRangeRequest

func (*RequestUnion) GetRequestPut

func (m *RequestUnion) GetRequestPut() *PutRequest

func (*RequestUnion) GetRequestRange

func (m *RequestUnion) GetRequestRange() *RangeRequest

func (*RequestUnion) Marshal

func (m *RequestUnion) Marshal() (data []byte, err error)

func (*RequestUnion) MarshalTo

func (m *RequestUnion) MarshalTo(data []byte) (n int, err error)

func (*RequestUnion) ProtoMessage

func (*RequestUnion) ProtoMessage()

func (*RequestUnion) Reset

func (m *RequestUnion) Reset()

func (*RequestUnion) Size

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

func (*RequestUnion) String

func (m *RequestUnion) String() string

func (*RequestUnion) Unmarshal

func (m *RequestUnion) Unmarshal(data []byte) error

type ResponseHeader

type ResponseHeader struct {
	// an error type message?
	Error     string `protobuf:"bytes,1,opt,name=error,proto3" json:"error,omitempty"`
	ClusterId uint64 `protobuf:"varint,2,opt,name=cluster_id,proto3" json:"cluster_id,omitempty"`
	MemberId  uint64 `protobuf:"varint,3,opt,name=member_id,proto3" json:"member_id,omitempty"`
	// index of the store when the request was applied.
	Index int64 `protobuf:"varint,4,opt,name=index,proto3" json:"index,omitempty"`
	// term of raft when the request was applied.
	RaftTerm uint64 `protobuf:"varint,5,opt,name=raft_term,proto3" json:"raft_term,omitempty"`
}

func (*ResponseHeader) Marshal

func (m *ResponseHeader) Marshal() (data []byte, err error)

func (*ResponseHeader) MarshalTo

func (m *ResponseHeader) MarshalTo(data []byte) (n int, err error)

func (*ResponseHeader) ProtoMessage

func (*ResponseHeader) ProtoMessage()

func (*ResponseHeader) Reset

func (m *ResponseHeader) Reset()

func (*ResponseHeader) Size

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

func (*ResponseHeader) String

func (m *ResponseHeader) String() string

func (*ResponseHeader) Unmarshal

func (m *ResponseHeader) Unmarshal(data []byte) error

type ResponseUnion

type ResponseUnion struct {
	ReponseRange        *RangeResponse       `protobuf:"bytes,1,opt,name=reponse_range" json:"reponse_range,omitempty"`
	ResponsePut         *PutResponse         `protobuf:"bytes,2,opt,name=response_put" json:"response_put,omitempty"`
	ResponseDeleteRange *DeleteRangeResponse `protobuf:"bytes,3,opt,name=response_delete_range" json:"response_delete_range,omitempty"`
}

func (*ResponseUnion) GetReponseRange

func (m *ResponseUnion) GetReponseRange() *RangeResponse

func (*ResponseUnion) GetResponseDeleteRange

func (m *ResponseUnion) GetResponseDeleteRange() *DeleteRangeResponse

func (*ResponseUnion) GetResponsePut

func (m *ResponseUnion) GetResponsePut() *PutResponse

func (*ResponseUnion) Marshal

func (m *ResponseUnion) Marshal() (data []byte, err error)

func (*ResponseUnion) MarshalTo

func (m *ResponseUnion) MarshalTo(data []byte) (n int, err error)

func (*ResponseUnion) ProtoMessage

func (*ResponseUnion) ProtoMessage()

func (*ResponseUnion) Reset

func (m *ResponseUnion) Reset()

func (*ResponseUnion) Size

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

func (*ResponseUnion) String

func (m *ResponseUnion) String() string

func (*ResponseUnion) Unmarshal

func (m *ResponseUnion) Unmarshal(data []byte) error

type TnxRequest

type TnxRequest struct {
	Compare []*Compare      `protobuf:"bytes,1,rep,name=compare" json:"compare,omitempty"`
	Success []*RequestUnion `protobuf:"bytes,2,rep,name=success" json:"success,omitempty"`
	Failure []*RequestUnion `protobuf:"bytes,3,rep,name=failure" json:"failure,omitempty"`
}

From google paxosdb paper: Our implementation hinges around a powerful primitive which we call MultiOp. All other database operations except for iteration are implemented as a single call to MultiOp. A MultiOp is applied atomically and consists of three components: 1. A list of tests called guard. Each test in guard checks a single entry in the database. It may check for the absence or presence of a value, or compare with a given value. Two different tests in the guard may apply to the same or different entries in the database. All tests in the guard are applied and MultiOp returns the results. If all tests are true, MultiOp executes t op (see item 2 below), otherwise it executes f op (see item 3 below). 2. A list of database operations called t op. Each operation in the list is either an insert, delete, or lookup operation, and applies to a single database entry. Two different operations in the list may apply to the same or different entries in the database. These operations are executed if guard evaluates to true. 3. A list of database operations called f op. Like t op, but executed if guard evaluates to false.

func (*TnxRequest) GetCompare

func (m *TnxRequest) GetCompare() []*Compare

func (*TnxRequest) GetFailure

func (m *TnxRequest) GetFailure() []*RequestUnion

func (*TnxRequest) GetSuccess

func (m *TnxRequest) GetSuccess() []*RequestUnion

func (*TnxRequest) Marshal

func (m *TnxRequest) Marshal() (data []byte, err error)

func (*TnxRequest) MarshalTo

func (m *TnxRequest) MarshalTo(data []byte) (n int, err error)

func (*TnxRequest) ProtoMessage

func (*TnxRequest) ProtoMessage()

func (*TnxRequest) Reset

func (m *TnxRequest) Reset()

func (*TnxRequest) Size

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

func (*TnxRequest) String

func (m *TnxRequest) String() string

func (*TnxRequest) Unmarshal

func (m *TnxRequest) Unmarshal(data []byte) error

type TnxResponse

type TnxResponse struct {
	Header    *ResponseHeader  `protobuf:"bytes,1,opt,name=header" json:"header,omitempty"`
	Succeeded bool             `protobuf:"varint,2,opt,name=succeeded,proto3" json:"succeeded,omitempty"`
	Responses []*ResponseUnion `protobuf:"bytes,3,rep,name=responses" json:"responses,omitempty"`
}

func (*TnxResponse) GetHeader

func (m *TnxResponse) GetHeader() *ResponseHeader

func (*TnxResponse) GetResponses

func (m *TnxResponse) GetResponses() []*ResponseUnion

func (*TnxResponse) Marshal

func (m *TnxResponse) Marshal() (data []byte, err error)

func (*TnxResponse) MarshalTo

func (m *TnxResponse) MarshalTo(data []byte) (n int, err error)

func (*TnxResponse) ProtoMessage

func (*TnxResponse) ProtoMessage()

func (*TnxResponse) Reset

func (m *TnxResponse) Reset()

func (*TnxResponse) Size

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

func (*TnxResponse) String

func (m *TnxResponse) String() string

func (*TnxResponse) Unmarshal

func (m *TnxResponse) Unmarshal(data []byte) error

Jump to

Keyboard shortcuts

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