Search and commands

↑ ↓ to select · Enter to open · Esc to close

Type to search packages.

echo

v0.1.8
github.com/takama/grpc/contracts/echo

Documentation

pkg.go.dev ↗

Table of contents

↓ to select · Enter to jump· Shift+Enter for source

29 matches

Top ↑

Package echo is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Variables

File_echo_echo_proto

var File_echo_echo_proto protoreflect.FileDescriptor

Functions

RegisterEchoHandler

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

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

RegisterEchoHandlerClient

func RegisterEchoHandlerClient(ctx context.Context, mux *runtime.ServeMux, client EchoClient) error

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

RegisterEchoHandlerFromEndpoint

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

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

RegisterEchoHandlerServer

func RegisterEchoHandlerServer(ctx context.Context, mux *runtime.ServeMux, server EchoServer) error

RegisterEchoHandlerServer registers the http handlers for service Echo to "mux". UnaryRPC :call EchoServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

RegisterEchoServer

func RegisterEchoServer(s *grpc.Server, srv EchoServer)

Types

EchoClient

type EchoClient interface {
	Ping(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
	Reverse(ctx context.Context, in *Request, opts ...grpc.CallOption) (*Response, error)
}

EchoClient is the client API for Echo service.

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

NewEchoClient

func NewEchoClient(cc grpc.ClientConnInterface) EchoClient

EchoServer

type EchoServer interface {
	Ping(context.Context, *Request) (*Response, error)
	Reverse(context.Context, *Request) (*Response, error)
}

EchoServer is the server API for Echo service.

Request

type Request struct {

	// Content of the request.
	Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

A Request message.

Request.Descriptor

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

Deprecated: Use Request.ProtoReflect.Descriptor instead.

Request.GetContent

func (x *Request) GetContent() string

Request.ProtoMessage

func (*Request) ProtoMessage()

Request.ProtoReflect

func (x *Request) ProtoReflect() protoreflect.Message

Request.Reset

func (x *Request) Reset()

Request.String

func (x *Request) String() string

Response

type Response struct {

	// Content of the response.
	Content string `protobuf:"bytes,1,opt,name=content,proto3" json:"content,omitempty"`
	// contains filtered or unexported fields
}

A Response message.

Response.Descriptor

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

Deprecated: Use Response.ProtoReflect.Descriptor instead.

Response.GetContent

func (x *Response) GetContent() string

Response.ProtoMessage

func (*Response) ProtoMessage()

Response.ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

Response.Reset

func (x *Response) Reset()

Response.String

func (x *Response) String() string

UnimplementedEchoServer

type UnimplementedEchoServer struct {
}

UnimplementedEchoServer can be embedded to have forward compatible implementations.

UnimplementedEchoServer.Ping

func (*UnimplementedEchoServer) Ping(context.Context, *Request) (*Response, error)

UnimplementedEchoServer.Reverse

func (*UnimplementedEchoServer) Reverse(context.Context, *Request) (*Response, error)

Dependency graph