ping

package
Version: v0.0.0-...-c48478a Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package ping is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

Functions

func RegisterPingServiceHandler

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

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

func RegisterPingServiceHandlerClient

func RegisterPingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PingServiceClient) error

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

func RegisterPingServiceHandlerFromEndpoint

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

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

func RegisterPingServiceHandlerServer

func RegisterPingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PingServiceServer) error

RegisterPingServiceHandlerServer registers the http handlers for service PingService to "mux". UnaryRPC :call PingServiceServer 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 RegisterPingServiceHandlerFromEndpoint instead.

func RegisterPingServiceServer

func RegisterPingServiceServer(s *grpc.Server, srv PingServiceServer)

Types

type MessageInput

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

func (*MessageInput) Descriptor deprecated

This method has been deprecated.
func (*MessageInput) Descriptor() ([]byte, []int)

Deprecated: Use MessageInput.ProtoReflect.Descriptor instead.

func (*MessageInput) GetMsg

func (x *MessageInput) GetMsg() string

func (*MessageInput) ProtoMessage

func (*MessageInput) ProtoMessage()

func (*MessageInput) ProtoReflect

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

func (*MessageInput) Reset

func (x *MessageInput) Reset()

func (*MessageInput) String

func (x *MessageInput) String() string

type MessageOutput

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

func (*MessageOutput) Descriptor deprecated

This method has been deprecated.
func (*MessageOutput) Descriptor() ([]byte, []int)

Deprecated: Use MessageOutput.ProtoReflect.Descriptor instead.

func (*MessageOutput) GetMsg

func (x *MessageOutput) GetMsg() string

func (*MessageOutput) ProtoMessage

func (*MessageOutput) ProtoMessage()

func (*MessageOutput) ProtoReflect

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

func (*MessageOutput) Reset

func (x *MessageOutput) Reset()

func (*MessageOutput) String

func (x *MessageOutput) String() string

type PingServiceClient

type PingServiceClient interface {
	Echo(ctx context.Context, in *MessageInput, opts ...grpc.CallOption) (*MessageOutput, error)
}

PingServiceClient is the client API for PingService service.

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

type PingServiceServer

type PingServiceServer interface {
	Echo(context.Context, *MessageInput) (*MessageOutput, error)
}

PingServiceServer is the server API for PingService service.

type UnimplementedPingServiceServer

type UnimplementedPingServiceServer struct {
}

UnimplementedPingServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedPingServiceServer) Echo

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL