vortex

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Overview

Package vortex is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	Vortex_Do_FullMethodName = "/vortexproto.vortex.v1.Vortex/Do"
)

Variables

View Source
var File_vortex_v1_vortex_proto protoreflect.FileDescriptor
View Source
var Vortex_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "vortexproto.vortex.v1.Vortex",
	HandlerType: (*VortexServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Do",
			Handler:    _Vortex_Do_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "vortex/v1/vortex.proto",
}

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

Functions

func RegisterVortexHandler

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

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

func RegisterVortexHandlerClient

func RegisterVortexHandlerClient(ctx context.Context, mux *runtime.ServeMux, client VortexClient) error

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

func RegisterVortexHandlerFromEndpoint

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

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

func RegisterVortexHandlerServer

func RegisterVortexHandlerServer(ctx context.Context, mux *runtime.ServeMux, server VortexServer) error

RegisterVortexHandlerServer registers the http handlers for service Vortex to "mux". UnaryRPC :call VortexServer 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 RegisterVortexHandlerFromEndpoint instead.

func RegisterVortexServer

func RegisterVortexServer(s grpc.ServiceRegistrar, srv VortexServer)

Types

type ClientOptions

type ClientOptions struct {
	Conn *conn.GrpcClientConn
}

ClientOptions represents the optional options to NewClient.

type DoRequest added in v0.1.4

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

Request message for the Do rpc.

func (*DoRequest) Descriptor deprecated added in v0.1.4

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

Deprecated: Use DoRequest.ProtoReflect.Descriptor instead.

func (*DoRequest) GetData added in v0.1.4

func (x *DoRequest) GetData() string

func (*DoRequest) ProtoMessage added in v0.1.4

func (*DoRequest) ProtoMessage()

func (*DoRequest) ProtoReflect added in v0.1.4

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

func (*DoRequest) Reset added in v0.1.4

func (x *DoRequest) Reset()

func (*DoRequest) String added in v0.1.4

func (x *DoRequest) String() string

type DoResponse added in v0.1.4

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

Request message for the Do rpc.

func (*DoResponse) Descriptor deprecated added in v0.1.4

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

Deprecated: Use DoResponse.ProtoReflect.Descriptor instead.

func (*DoResponse) GetData added in v0.1.4

func (x *DoResponse) GetData() string

func (*DoResponse) ProtoMessage added in v0.1.4

func (*DoResponse) ProtoMessage()

func (*DoResponse) ProtoReflect added in v0.1.4

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

func (*DoResponse) Reset added in v0.1.4

func (x *DoResponse) Reset()

func (*DoResponse) String added in v0.1.4

func (x *DoResponse) String() string

type GrpcClient

type GrpcClient struct {
	VortexClient
	// contains filtered or unexported fields
}

func NewClient

func NewClient(ctx context.Context, opts ...*ClientOptions) (*GrpcClient, error)

NewClient returns a client connection to the 'vortex' service.

func (*GrpcClient) Close

func (c *GrpcClient) Close()

type UnimplementedVortexServer

type UnimplementedVortexServer struct {
}

UnimplementedVortexServer must be embedded to have forward compatible implementations.

func (UnimplementedVortexServer) Do added in v0.1.4

type UnsafeVortexServer

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

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

type VortexClient

type VortexClient interface {
	// Testing endpoint.
	Do(ctx context.Context, in *DoRequest, opts ...grpc.CallOption) (*DoResponse, error)
}

VortexClient is the client API for Vortex 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.

Vortex service definition.

func NewVortexClient

func NewVortexClient(cc grpc.ClientConnInterface) VortexClient

type VortexServer

type VortexServer interface {
	// Testing endpoint.
	Do(context.Context, *DoRequest) (*DoResponse, error)
	// contains filtered or unexported methods
}

VortexServer is the server API for Vortex service. All implementations must embed UnimplementedVortexServer for forward compatibility

Vortex service definition.

Jump to

Keyboard shortcuts

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