ping

package
v0.0.0-...-16dbe3d Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2023 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 Empty

type Empty struct {
	// contains filtered or unexported fields
}

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

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

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

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)
	Now(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Time, error)
	DBSelect(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*MessageOutput, error)
	KMSSign(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)
	Now(context.Context, *Empty) (*Time, error)
	DBSelect(context.Context, *Empty) (*MessageOutput, error)
	KMSSign(context.Context, *MessageInput) (*MessageOutput, error)
}

PingServiceServer is the server API for PingService service.

type Time

type Time struct {
	T uint64 `protobuf:"varint,1,opt,name=t,proto3" json:"t,omitempty"`
	// contains filtered or unexported fields
}

func (*Time) Descriptor deprecated

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

Deprecated: Use Time.ProtoReflect.Descriptor instead.

func (*Time) GetT

func (x *Time) GetT() uint64

func (*Time) ProtoMessage

func (*Time) ProtoMessage()

func (*Time) ProtoReflect

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

func (*Time) Reset

func (x *Time) Reset()

func (*Time) String

func (x *Time) String() string

type UnimplementedPingServiceServer

type UnimplementedPingServiceServer struct {
}

UnimplementedPingServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedPingServiceServer) DBSelect

func (*UnimplementedPingServiceServer) Echo

func (*UnimplementedPingServiceServer) KMSSign

func (*UnimplementedPingServiceServer) Now

Jump to

Keyboard shortcuts

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