grpc

package
v0.0.0-...-560d035 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package grpc is a generated protocol buffer package.

It is generated from these files:

items.proto

It has these top-level messages:

Empty
StoreGetRequest
StoreGetResponse
StorePutRequest
StoreDeleteRequest

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterStoreServer

func RegisterStoreServer(s *grpc1.Server, srv StoreServer)

func UnaryStoreExtractor

func UnaryStoreExtractor(stores *types.StoreRepository) grpc.UnaryServerInterceptor

Types

type Empty

type Empty struct {
}

func (*Empty) Descriptor

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

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) Reset

func (m *Empty) Reset()

func (*Empty) String

func (m *Empty) String() string

type Service

type Service struct{}

@todo The GET/PUT req/res cycle is suboptimal under the hood currently. Put Messages get marshalled in the client, unmarshalled on the server, then stored. Get Messages get marshalled on the server, and unmarshalled in the client. Ideally we could skip the Put unmarshalling and Get marshalling on the server, limit messages to just the raw payload (passing keys as metadata instead), and store the already marshalled payloads directly, to skip double encoding. Note that this would require a custom codec and ideally just for the ItemsStore, so the protos would need to be split accordingly and the service would likely not be able to use most of the auto generated defs.

func (*Service) Delete

func (s *Service) Delete(ctx context.Context, in *StoreDeleteRequest) (*Empty, error)

func (*Service) Get

func (*Service) Put

func (s *Service) Put(ctx context.Context, in *StorePutRequest) (*Empty, error)

type StoreClient

type StoreClient interface {
	Get(ctx context.Context, in *StoreGetRequest, opts ...grpc1.CallOption) (*StoreGetResponse, error)
	Put(ctx context.Context, in *StorePutRequest, opts ...grpc1.CallOption) (*Empty, error)
	Delete(ctx context.Context, in *StoreDeleteRequest, opts ...grpc1.CallOption) (*Empty, error)
}

func NewStoreClient

func NewStoreClient(cc *grpc1.ClientConn) StoreClient

type StoreDeleteRequest

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

func (*StoreDeleteRequest) Descriptor

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

func (*StoreDeleteRequest) GetKey

func (m *StoreDeleteRequest) GetKey() string

func (*StoreDeleteRequest) ProtoMessage

func (*StoreDeleteRequest) ProtoMessage()

func (*StoreDeleteRequest) Reset

func (m *StoreDeleteRequest) Reset()

func (*StoreDeleteRequest) String

func (m *StoreDeleteRequest) String() string

type StoreGetRequest

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

func (*StoreGetRequest) Descriptor

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

func (*StoreGetRequest) GetKey

func (m *StoreGetRequest) GetKey() string

func (*StoreGetRequest) ProtoMessage

func (*StoreGetRequest) ProtoMessage()

func (*StoreGetRequest) Reset

func (m *StoreGetRequest) Reset()

func (*StoreGetRequest) String

func (m *StoreGetRequest) String() string

type StoreGetResponse

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

func (*StoreGetResponse) Descriptor

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

func (*StoreGetResponse) GetValue

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

func (*StoreGetResponse) ProtoMessage

func (*StoreGetResponse) ProtoMessage()

func (*StoreGetResponse) Reset

func (m *StoreGetResponse) Reset()

func (*StoreGetResponse) String

func (m *StoreGetResponse) String() string

type StorePutRequest

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

func (*StorePutRequest) Descriptor

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

func (*StorePutRequest) GetKey

func (m *StorePutRequest) GetKey() string

func (*StorePutRequest) GetValue

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

func (*StorePutRequest) ProtoMessage

func (*StorePutRequest) ProtoMessage()

func (*StorePutRequest) Reset

func (m *StorePutRequest) Reset()

func (*StorePutRequest) String

func (m *StorePutRequest) String() string

Jump to

Keyboard shortcuts

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