pb

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package pb is a generated protocol buffer package.

It is generated from these files:

example/pb/app.proto

It has these top-level messages:

KeyValMessage

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterKeyValHandler

func RegisterKeyValHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterKeyValHandler registers the http handlers for service KeyVal to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterKeyValHandlerFromEndpoint

func RegisterKeyValHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterKeyValHandlerFromEndpoint is same as RegisterKeyValHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterKeyValServer

func RegisterKeyValServer(s *grpc.Server, srv KeyValServer)

Types

type KeyValClient

type KeyValClient interface {
	KeyValCreate(ctx context.Context, in *KeyValMessage, opts ...grpc.CallOption) (*KeyValMessage, error)
	KeyValRead(ctx context.Context, in *KeyValMessage, opts ...grpc.CallOption) (*KeyValMessage, error)
	KeyValUpdate(ctx context.Context, in *KeyValMessage, opts ...grpc.CallOption) (*KeyValMessage, error)
	KeyValDelete(ctx context.Context, in *KeyValMessage, opts ...grpc.CallOption) (*KeyValMessage, error)
}

func NewKeyValClient

func NewKeyValClient(cc *grpc.ClientConn) KeyValClient

type KeyValMessage

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

func (*KeyValMessage) Descriptor

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

func (*KeyValMessage) GetKey

func (m *KeyValMessage) GetKey() string

func (*KeyValMessage) GetValue

func (m *KeyValMessage) GetValue() string

func (*KeyValMessage) ProtoMessage

func (*KeyValMessage) ProtoMessage()

func (*KeyValMessage) Reset

func (m *KeyValMessage) Reset()

func (*KeyValMessage) String

func (m *KeyValMessage) String() string

type KeyValServer

type KeyValServer interface {
	KeyValCreate(context.Context, *KeyValMessage) (*KeyValMessage, error)
	KeyValRead(context.Context, *KeyValMessage) (*KeyValMessage, error)
	KeyValUpdate(context.Context, *KeyValMessage) (*KeyValMessage, error)
	KeyValDelete(context.Context, *KeyValMessage) (*KeyValMessage, error)
}

Jump to

Keyboard shortcuts

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