pb

package
v0.0.0-...-7a25296 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package pb is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_api_grpc_proto protoreflect.FileDescriptor
View Source
var Linna_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "linna.api.Linna",
	HandlerType: (*LinnaServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SessionRefresh",
			Handler:    _Linna_SessionRefresh_Handler,
		},
		{
			MethodName: "RpcFunc",
			Handler:    _Linna_RpcFunc_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api_grpc.proto",
}

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

Functions

func RegisterLinnaHandler

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

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

func RegisterLinnaHandlerClient

func RegisterLinnaHandlerClient(ctx context.Context, mux *runtime.ServeMux, client LinnaClient) error

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

func RegisterLinnaHandlerFromEndpoint

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

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

func RegisterLinnaHandlerServer

func RegisterLinnaHandlerServer(ctx context.Context, mux *runtime.ServeMux, server LinnaServer) error

RegisterLinnaHandlerServer registers the http handlers for service Linna to "mux". UnaryRPC :call LinnaServer 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 RegisterLinnaHandlerFromEndpoint instead.

func RegisterLinnaServer

func RegisterLinnaServer(s grpc.ServiceRegistrar, srv LinnaServer)

Types

type LinnaClient

type LinnaClient interface {
	SessionRefresh(ctx context.Context, in *api.SessionRefreshRequest, opts ...grpc.CallOption) (*api.Session, error)
	// Execute a Lua function on the server.
	RpcFunc(ctx context.Context, in *api.Rpc, opts ...grpc.CallOption) (*api.Rpc, error)
}

LinnaClient is the client API for Linna 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.

func NewLinnaClient

func NewLinnaClient(cc grpc.ClientConnInterface) LinnaClient

type LinnaServer

type LinnaServer interface {
	SessionRefresh(context.Context, *api.SessionRefreshRequest) (*api.Session, error)
	// Execute a Lua function on the server.
	RpcFunc(context.Context, *api.Rpc) (*api.Rpc, error)
	// contains filtered or unexported methods
}

LinnaServer is the server API for Linna service. All implementations must embed UnimplementedLinnaServer for forward compatibility

type UnimplementedLinnaServer

type UnimplementedLinnaServer struct {
}

UnimplementedLinnaServer must be embedded to have forward compatible implementations.

func (UnimplementedLinnaServer) RpcFunc

func (UnimplementedLinnaServer) SessionRefresh

type UnsafeLinnaServer

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

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

Jump to

Keyboard shortcuts

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