rpc

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package rpc is a generated protocol buffer package.

It is generated from these files:

rpc.proto

It has these top-level messages:

Version
Message

Package rpc is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterGRPCHandler added in v0.4.3

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

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

func RegisterGRPCHandlerClient added in v0.4.3

func RegisterGRPCHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GRPCClient) error

RegisterGRPCHandler registers the http handlers for service GRPC to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "GRPCClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "GRPCClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "GRPCClient" to call the correct interceptors.

func RegisterGRPCHandlerFromEndpoint added in v0.4.3

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

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

func RegisterGRPCServer added in v0.4.3

func RegisterGRPCServer(s *grpc.Server, srv GRPCServer)

Types

type GRPCClient added in v0.4.3

type GRPCClient interface {
	GetVersion(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (*Version, error)
	ServerStream(ctx context.Context, in *google_protobuf.Empty, opts ...grpc.CallOption) (GRPC_ServerStreamClient, error)
}

func NewGRPCClient added in v0.4.3

func NewGRPCClient(cc *grpc.ClientConn) GRPCClient

type GRPCServer added in v0.4.3

type GRPCServer interface {
	GetVersion(context.Context, *google_protobuf.Empty) (*Version, error)
	ServerStream(*google_protobuf.Empty, GRPC_ServerStreamServer) error
}

type GRPC_ServerStreamClient added in v0.4.3

type GRPC_ServerStreamClient interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type GRPC_ServerStreamServer added in v0.4.3

type GRPC_ServerStreamServer interface {
	Send(*Message) error
	grpc.ServerStream
}

type Message

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

func (*Message) Descriptor

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

func (*Message) GetMessage

func (m *Message) GetMessage() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) Reset

func (m *Message) Reset()

func (*Message) String

func (m *Message) String() string

type Version

type Version struct {
	SemVer    string `protobuf:"bytes,1,opt,name=sem_ver,json=semVer" json:"sem_ver,omitempty"`
	GitCommit string `protobuf:"bytes,2,opt,name=git_commit,json=gitCommit" json:"git_commit,omitempty"`
}

func (*Version) Descriptor

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

func (*Version) GetGitCommit

func (m *Version) GetGitCommit() string

func (*Version) GetSemVer

func (m *Version) GetSemVer() string

func (*Version) ProtoMessage

func (*Version) ProtoMessage()

func (*Version) Reset

func (m *Version) Reset()

func (*Version) String

func (m *Version) String() string

Jump to

Keyboard shortcuts

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