v1

package
v0.0.0-...-8fb510d Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 16 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

View Source
var File_your_service_v1_your_service_proto protoreflect.FileDescriptor

Functions

func RegisterYourServiceHandler

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

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

func RegisterYourServiceHandlerClient

func RegisterYourServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client YourServiceClient) error

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

func RegisterYourServiceHandlerFromEndpoint

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

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

func RegisterYourServiceHandlerServer

func RegisterYourServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server YourServiceServer) error

RegisterYourServiceHandlerServer registers the http handlers for service YourService to "mux". UnaryRPC :call YourServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterYourServiceHandlerFromEndpoint instead.

func RegisterYourServiceServer

func RegisterYourServiceServer(s grpc.ServiceRegistrar, srv YourServiceServer)

Types

type StringMessage

type StringMessage struct {
	Value string `protobuf:"bytes,1,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*StringMessage) Descriptor deprecated

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

Deprecated: Use StringMessage.ProtoReflect.Descriptor instead.

func (*StringMessage) GetValue

func (x *StringMessage) GetValue() string

func (*StringMessage) ProtoMessage

func (*StringMessage) ProtoMessage()

func (*StringMessage) ProtoReflect

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

func (*StringMessage) Reset

func (x *StringMessage) Reset()

func (*StringMessage) String

func (x *StringMessage) String() string

type UnimplementedYourServiceServer

type UnimplementedYourServiceServer struct {
}

UnimplementedYourServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedYourServiceServer) Echo

type UnsafeYourServiceServer

type UnsafeYourServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeYourServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to YourServiceServer will result in compilation errors.

type YourServiceClient

type YourServiceClient interface {
	Echo(ctx context.Context, in *StringMessage, opts ...grpc.CallOption) (*StringMessage, error)
}

YourServiceClient is the client API for YourService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type YourServiceServer

type YourServiceServer interface {
	Echo(context.Context, *StringMessage) (*StringMessage, error)
	// contains filtered or unexported methods
}

YourServiceServer is the server API for YourService service. All implementations must embed UnimplementedYourServiceServer for forward compatibility

Jump to

Keyboard shortcuts

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