gw_pb

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MulanPSL-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package gw_pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_google_hollegw_proto protoreflect.FileDescriptor
View Source
var Greetergateway_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "rpc.Greetergateway",
	HandlerType: (*GreetergatewayServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Helloxiao",
			Handler:    _Greetergateway_Helloxiao_Handler,
		},
		{
			MethodName: "Hellochao",
			Handler:    _Greetergateway_Hellochao_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "google/hollegw.proto",
}

Greetergateway_ServiceDesc is the grpc.ServiceDesc for Greetergateway service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterGreetergatewayHandler

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

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

func RegisterGreetergatewayHandlerClient

func RegisterGreetergatewayHandlerClient(ctx context.Context, mux *runtime.ServeMux, client GreetergatewayClient) error

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

func RegisterGreetergatewayHandlerFromEndpoint

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

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

func RegisterGreetergatewayHandlerServer

func RegisterGreetergatewayHandlerServer(ctx context.Context, mux *runtime.ServeMux, server GreetergatewayServer) error

RegisterGreetergatewayHandlerServer registers the http handlers for service Greetergateway to "mux". UnaryRPC :call GreetergatewayServer 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 RegisterGreetergatewayHandlerFromEndpoint instead.

func RegisterGreetergatewayServer

func RegisterGreetergatewayServer(s grpc.ServiceRegistrar, srv GreetergatewayServer)

Types

type GreetergatewayClient

type GreetergatewayClient interface {
	Helloxiao(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloResponse, error)
	Hellochao(ctx context.Context, in *HelloSwap, opts ...grpc.CallOption) (*HelloResponse, error)
}

GreetergatewayClient is the client API for Greetergateway 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 GreetergatewayServer

type GreetergatewayServer interface {
	Helloxiao(context.Context, *HelloRequest) (*HelloResponse, error)
	Hellochao(context.Context, *HelloSwap) (*HelloResponse, error)
	// contains filtered or unexported methods
}

GreetergatewayServer is the server API for Greetergateway service. All implementations must embed UnimplementedGreetergatewayServer for forward compatibility

type HelloRequest

type HelloRequest struct {
	Name []string             `protobuf:"bytes,1,rep,name=name,proto3" json:"name,omitempty"`
	Age  []string             `protobuf:"bytes,2,rep,name=age,proto3" json:"age,omitempty"`
	Time *timestamp.Timestamp `protobuf:"bytes,3,opt,name=Time,proto3" json:"Time,omitempty"` //收集时间
	// contains filtered or unexported fields
}

func (*HelloRequest) Descriptor deprecated

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

Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead.

func (*HelloRequest) GetAge

func (x *HelloRequest) GetAge() []string

func (*HelloRequest) GetName

func (x *HelloRequest) GetName() []string

func (*HelloRequest) GetTime

func (x *HelloRequest) GetTime() *timestamp.Timestamp

func (*HelloRequest) ProtoMessage

func (*HelloRequest) ProtoMessage()

func (*HelloRequest) ProtoReflect

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

func (*HelloRequest) Reset

func (x *HelloRequest) Reset()

func (*HelloRequest) String

func (x *HelloRequest) String() string

type HelloResponse

type HelloResponse struct {
	Greeting []string `protobuf:"bytes,2,rep,name=greeting,proto3" json:"greeting,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloResponse) Descriptor deprecated

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

Deprecated: Use HelloResponse.ProtoReflect.Descriptor instead.

func (*HelloResponse) GetGreeting

func (x *HelloResponse) GetGreeting() []string

func (*HelloResponse) ProtoMessage

func (*HelloResponse) ProtoMessage()

func (*HelloResponse) ProtoReflect

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

func (*HelloResponse) Reset

func (x *HelloResponse) Reset()

func (*HelloResponse) String

func (x *HelloResponse) String() string

type HelloSwap

type HelloSwap struct {
	Request *HelloRequest `protobuf:"bytes,1,opt,name=request,proto3" json:"request,omitempty"`
	// contains filtered or unexported fields
}

func (*HelloSwap) Descriptor deprecated

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

Deprecated: Use HelloSwap.ProtoReflect.Descriptor instead.

func (*HelloSwap) GetRequest

func (x *HelloSwap) GetRequest() *HelloRequest

func (*HelloSwap) ProtoMessage

func (*HelloSwap) ProtoMessage()

func (*HelloSwap) ProtoReflect

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

func (*HelloSwap) Reset

func (x *HelloSwap) Reset()

func (*HelloSwap) String

func (x *HelloSwap) String() string

type UnimplementedGreetergatewayServer

type UnimplementedGreetergatewayServer struct {
}

UnimplementedGreetergatewayServer must be embedded to have forward compatible implementations.

func (UnimplementedGreetergatewayServer) Hellochao

func (UnimplementedGreetergatewayServer) Helloxiao

type UnsafeGreetergatewayServer

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

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

Jump to

Keyboard shortcuts

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