v1

package
v0.0.0-...-b142ba6 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterPingHandler

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

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

func RegisterPingHandlerClient

func RegisterPingHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingClient) error

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

func RegisterPingHandlerFromEndpoint

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

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

func RegisterPingServer

func RegisterPingServer(s *grpc.Server, srv PingServer)

Types

type PingClient

type PingClient interface {
	Say(ctx context.Context, in *PingMessage, opts ...grpc.CallOption) (*PingMessage, error)
}

PingClient is the client API for Ping service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewPingClient

func NewPingClient(cc *grpc.ClientConn) PingClient

type PingMessage

type PingMessage struct {
	Greeting             string   `protobuf:"bytes,1,opt,name=greeting,proto3" json:"greeting,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PingMessage) Descriptor

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

func (*PingMessage) GetGreeting

func (m *PingMessage) GetGreeting() string

func (*PingMessage) ProtoMessage

func (*PingMessage) ProtoMessage()

func (*PingMessage) Reset

func (m *PingMessage) Reset()

func (*PingMessage) String

func (m *PingMessage) String() string

func (*PingMessage) XXX_DiscardUnknown

func (m *PingMessage) XXX_DiscardUnknown()

func (*PingMessage) XXX_Marshal

func (m *PingMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*PingMessage) XXX_Merge

func (m *PingMessage) XXX_Merge(src proto.Message)

func (*PingMessage) XXX_Size

func (m *PingMessage) XXX_Size() int

func (*PingMessage) XXX_Unmarshal

func (m *PingMessage) XXX_Unmarshal(b []byte) error

type PingServer

type PingServer interface {
	Say(context.Context, *PingMessage) (*PingMessage, error)
}

PingServer is the server API for Ping service.

Jump to

Keyboard shortcuts

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