protobuf

package
v0.0.0-...-7920cea Latest Latest
Warning

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

Go to latest
Published: May 15, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package protobuf is a generated protocol buffer package.

It is generated from these files:

kvs.proto

It has these top-level messages:

KeyValuePair
Key
Namespace
Response
CountResponse
ShowKeysResponse
ShowDataResponse
ShowNamespacesResponse
NamespaceResponse

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterKVSServer

func RegisterKVSServer(s *grpc.Server, srv KVSServer)

Types

type CountResponse

type CountResponse struct {
	Count int32 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}

func (*CountResponse) Descriptor

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

func (*CountResponse) GetCount

func (m *CountResponse) GetCount() int32

func (*CountResponse) ProtoMessage

func (*CountResponse) ProtoMessage()

func (*CountResponse) Reset

func (m *CountResponse) Reset()

func (*CountResponse) String

func (m *CountResponse) String() string

type KVSClient

type KVSClient interface {
	// Inserts a key-value pair into a namespace, if not present
	Set(ctx context.Context, in *KeyValuePair, opts ...grpc.CallOption) (*Response, error)
	// Updates a key-value pair in a namespace, if present
	Update(ctx context.Context, in *KeyValuePair, opts ...grpc.CallOption) (*Response, error)
	// Checks if a key is in a namespace
	Has(ctx context.Context, in *Key, opts ...grpc.CallOption) (*Response, error)
	// Removes a key in a namespace, if present
	Unset(ctx context.Context, in *Key, opts ...grpc.CallOption) (*KeyValuePair, error)
	// Retrieves an element from a namespace under given key
	Get(ctx context.Context, in *Key, opts ...grpc.CallOption) (*KeyValuePair, error)
	// Returns the total number of key-value pairs in a namespace
	Count(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*CountResponse, error)
	// Retrieve all keys in a namespace
	ShowKeys(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ShowKeysResponse, error)
	// Retrieve all key-value pairs in a namespace
	ShowData(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ShowDataResponse, error)
	// Retrieve all namespaces in the key-value store that belongs to the user
	// NOTE: No token needed
	ShowNamespaces(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*ShowNamespacesResponse, error)
	// Changes the current namespace, returns a token that must be used for
	// subsequent requests
	// NOTE: No token needed
	UseNamespace(ctx context.Context, in *Namespace, opts ...grpc.CallOption) (*NamespaceResponse, error)
}

func NewKVSClient

func NewKVSClient(cc *grpc.ClientConn) KVSClient

type KVSServer

type KVSServer interface {
	// Inserts a key-value pair into a namespace, if not present
	Set(context.Context, *KeyValuePair) (*Response, error)
	// Updates a key-value pair in a namespace, if present
	Update(context.Context, *KeyValuePair) (*Response, error)
	// Checks if a key is in a namespace
	Has(context.Context, *Key) (*Response, error)
	// Removes a key in a namespace, if present
	Unset(context.Context, *Key) (*KeyValuePair, error)
	// Retrieves an element from a namespace under given key
	Get(context.Context, *Key) (*KeyValuePair, error)
	// Returns the total number of key-value pairs in a namespace
	Count(context.Context, *google_protobuf.Empty) (*CountResponse, error)
	// Retrieve all keys in a namespace
	ShowKeys(context.Context, *google_protobuf.Empty) (*ShowKeysResponse, error)
	// Retrieve all key-value pairs in a namespace
	ShowData(context.Context, *google_protobuf.Empty) (*ShowDataResponse, error)
	// Retrieve all namespaces in the key-value store that belongs to the user
	// NOTE: No token needed
	ShowNamespaces(context.Context, *google_protobuf.Empty) (*ShowNamespacesResponse, error)
	// Changes the current namespace, returns a token that must be used for
	// subsequent requests
	// NOTE: No token needed
	UseNamespace(context.Context, *Namespace) (*NamespaceResponse, error)
}

type Key

type Key struct {
	Key string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
}

func (*Key) Descriptor

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

func (*Key) GetKey

func (m *Key) GetKey() string

func (*Key) ProtoMessage

func (*Key) ProtoMessage()

func (*Key) Reset

func (m *Key) Reset()

func (*Key) String

func (m *Key) String() string

type KeyValuePair

type KeyValuePair struct {
	Key   string `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

func (*KeyValuePair) Descriptor

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

func (*KeyValuePair) GetKey

func (m *KeyValuePair) GetKey() string

func (*KeyValuePair) GetValue

func (m *KeyValuePair) GetValue() string

func (*KeyValuePair) ProtoMessage

func (*KeyValuePair) ProtoMessage()

func (*KeyValuePair) Reset

func (m *KeyValuePair) Reset()

func (*KeyValuePair) String

func (m *KeyValuePair) String() string

type Namespace

type Namespace struct {
	Namespace string `protobuf:"bytes,1,opt,name=namespace" json:"namespace,omitempty"`
}

func (*Namespace) Descriptor

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

func (*Namespace) GetNamespace

func (m *Namespace) GetNamespace() string

func (*Namespace) ProtoMessage

func (*Namespace) ProtoMessage()

func (*Namespace) Reset

func (m *Namespace) Reset()

func (*Namespace) String

func (m *Namespace) String() string

type NamespaceResponse

type NamespaceResponse struct {
	Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"`
}

func (*NamespaceResponse) Descriptor

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

func (*NamespaceResponse) GetToken

func (m *NamespaceResponse) GetToken() string

func (*NamespaceResponse) ProtoMessage

func (*NamespaceResponse) ProtoMessage()

func (*NamespaceResponse) Reset

func (m *NamespaceResponse) Reset()

func (*NamespaceResponse) String

func (m *NamespaceResponse) String() string

type Response

type Response struct {
	Success bool   `protobuf:"varint,1,opt,name=success" json:"success,omitempty"`
	Value   string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

func (*Response) Descriptor

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

func (*Response) GetSuccess

func (m *Response) GetSuccess() bool

func (*Response) GetValue

func (m *Response) GetValue() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) Reset

func (m *Response) Reset()

func (*Response) String

func (m *Response) String() string

type ShowDataResponse

type ShowDataResponse struct {
	Data []*KeyValuePair `protobuf:"bytes,1,rep,name=data" json:"data,omitempty"`
}

func (*ShowDataResponse) Descriptor

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

func (*ShowDataResponse) GetData

func (m *ShowDataResponse) GetData() []*KeyValuePair

func (*ShowDataResponse) ProtoMessage

func (*ShowDataResponse) ProtoMessage()

func (*ShowDataResponse) Reset

func (m *ShowDataResponse) Reset()

func (*ShowDataResponse) String

func (m *ShowDataResponse) String() string

type ShowKeysResponse

type ShowKeysResponse struct {
	Keys []string `protobuf:"bytes,1,rep,name=keys" json:"keys,omitempty"`
}

func (*ShowKeysResponse) Descriptor

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

func (*ShowKeysResponse) GetKeys

func (m *ShowKeysResponse) GetKeys() []string

func (*ShowKeysResponse) ProtoMessage

func (*ShowKeysResponse) ProtoMessage()

func (*ShowKeysResponse) Reset

func (m *ShowKeysResponse) Reset()

func (*ShowKeysResponse) String

func (m *ShowKeysResponse) String() string

type ShowNamespacesResponse

type ShowNamespacesResponse struct {
	Namespaces []string `protobuf:"bytes,1,rep,name=namespaces" json:"namespaces,omitempty"`
}

func (*ShowNamespacesResponse) Descriptor

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

func (*ShowNamespacesResponse) GetNamespaces

func (m *ShowNamespacesResponse) GetNamespaces() []string

func (*ShowNamespacesResponse) ProtoMessage

func (*ShowNamespacesResponse) ProtoMessage()

func (*ShowNamespacesResponse) Reset

func (m *ShowNamespacesResponse) Reset()

func (*ShowNamespacesResponse) String

func (m *ShowNamespacesResponse) String() string

Jump to

Keyboard shortcuts

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