v1

package
v0.0.0-...-3ec0304 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2021 License: Apache-2.0 Imports: 17 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_mathv1_proto protoreflect.FileDescriptor

Functions

func RegisterMathHandler

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

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

func RegisterMathHandlerClient

func RegisterMathHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MathClient) error

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

func RegisterMathHandlerFromEndpoint

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

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

func RegisterMathHandlerServer

func RegisterMathHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MathServer) error

RegisterMathHandlerServer registers the http handlers for service Math to "mux". UnaryRPC :call MathServer 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 RegisterMathHandlerFromEndpoint instead.

func RegisterMathServer

func RegisterMathServer(s *grpc.Server, srv MathServer)

Types

type GetFactorialMsg

type GetFactorialMsg struct {
	Input int64 `protobuf:"varint,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*GetFactorialMsg) Descriptor deprecated

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

Deprecated: Use GetFactorialMsg.ProtoReflect.Descriptor instead.

func (*GetFactorialMsg) GetInput

func (x *GetFactorialMsg) GetInput() int64

func (*GetFactorialMsg) ProtoMessage

func (*GetFactorialMsg) ProtoMessage()

func (*GetFactorialMsg) ProtoReflect

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

func (*GetFactorialMsg) Reset

func (x *GetFactorialMsg) Reset()

func (*GetFactorialMsg) String

func (x *GetFactorialMsg) String() string

type GetFactorialReply

type GetFactorialReply struct {
	Result int64 `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GetFactorialReply) Descriptor deprecated

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

Deprecated: Use GetFactorialReply.ProtoReflect.Descriptor instead.

func (*GetFactorialReply) GetResult

func (x *GetFactorialReply) GetResult() int64

func (*GetFactorialReply) ProtoMessage

func (*GetFactorialReply) ProtoMessage()

func (*GetFactorialReply) ProtoReflect

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

func (*GetFactorialReply) Reset

func (x *GetFactorialReply) Reset()

func (*GetFactorialReply) String

func (x *GetFactorialReply) String() string

type GetSquareMsg

type GetSquareMsg struct {
	Input float32 `protobuf:"fixed32,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSquareMsg) Descriptor deprecated

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

Deprecated: Use GetSquareMsg.ProtoReflect.Descriptor instead.

func (*GetSquareMsg) GetInput

func (x *GetSquareMsg) GetInput() float32

func (*GetSquareMsg) ProtoMessage

func (*GetSquareMsg) ProtoMessage()

func (*GetSquareMsg) ProtoReflect

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

func (*GetSquareMsg) Reset

func (x *GetSquareMsg) Reset()

func (*GetSquareMsg) String

func (x *GetSquareMsg) String() string

type GetSquareReply

type GetSquareReply struct {
	Result float32 `protobuf:"fixed32,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSquareReply) Descriptor deprecated

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

Deprecated: Use GetSquareReply.ProtoReflect.Descriptor instead.

func (*GetSquareReply) GetResult

func (x *GetSquareReply) GetResult() float32

func (*GetSquareReply) ProtoMessage

func (*GetSquareReply) ProtoMessage()

func (*GetSquareReply) ProtoReflect

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

func (*GetSquareReply) Reset

func (x *GetSquareReply) Reset()

func (*GetSquareReply) String

func (x *GetSquareReply) String() string

type GetSquareRootMsg

type GetSquareRootMsg struct {
	Input float32 `protobuf:"fixed32,1,opt,name=input,proto3" json:"input,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSquareRootMsg) Descriptor deprecated

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

Deprecated: Use GetSquareRootMsg.ProtoReflect.Descriptor instead.

func (*GetSquareRootMsg) GetInput

func (x *GetSquareRootMsg) GetInput() float32

func (*GetSquareRootMsg) ProtoMessage

func (*GetSquareRootMsg) ProtoMessage()

func (*GetSquareRootMsg) ProtoReflect

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

func (*GetSquareRootMsg) Reset

func (x *GetSquareRootMsg) Reset()

func (*GetSquareRootMsg) String

func (x *GetSquareRootMsg) String() string

type GetSquareRootReply

type GetSquareRootReply struct {
	Result float32 `protobuf:"fixed32,1,opt,name=result,proto3" json:"result,omitempty"`
	// contains filtered or unexported fields
}

func (*GetSquareRootReply) Descriptor deprecated

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

Deprecated: Use GetSquareRootReply.ProtoReflect.Descriptor instead.

func (*GetSquareRootReply) GetResult

func (x *GetSquareRootReply) GetResult() float32

func (*GetSquareRootReply) ProtoMessage

func (*GetSquareRootReply) ProtoMessage()

func (*GetSquareRootReply) ProtoReflect

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

func (*GetSquareRootReply) Reset

func (x *GetSquareRootReply) Reset()

func (*GetSquareRootReply) String

func (x *GetSquareRootReply) String() string

type MathClient

type MathClient interface {
	// Will return version information about api server
	GetSquare(ctx context.Context, in *GetSquareMsg, opts ...grpc.CallOption) (*GetSquareReply, error)
	GetSquareRoot(ctx context.Context, in *GetSquareRootMsg, opts ...grpc.CallOption) (*GetSquareRootReply, error)
	GetFactorial(ctx context.Context, in *GetFactorialMsg, opts ...grpc.CallOption) (*GetFactorialReply, error)
}

MathClient is the client API for Math service.

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

func NewMathClient

func NewMathClient(cc grpc.ClientConnInterface) MathClient

type MathServer

type MathServer interface {
	// Will return version information about api server
	GetSquare(context.Context, *GetSquareMsg) (*GetSquareReply, error)
	GetSquareRoot(context.Context, *GetSquareRootMsg) (*GetSquareRootReply, error)
	GetFactorial(context.Context, *GetFactorialMsg) (*GetFactorialReply, error)
}

MathServer is the server API for Math service.

type UnimplementedMathServer

type UnimplementedMathServer struct {
}

UnimplementedMathServer can be embedded to have forward compatible implementations.

func (*UnimplementedMathServer) GetFactorial

func (*UnimplementedMathServer) GetSquare

func (*UnimplementedMathServer) GetSquareRoot

Jump to

Keyboard shortcuts

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