proto

package
v0.0.0-...-1be9654 Latest Latest
Warning

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

Go to latest
Published: May 6, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package proto is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	Transformer_name = map[int32]string{
		0: "TRANSFORMER_UNSPECIFIED",
		1: "TRANSFORMER_UPPERCASE",
		2: "TRANSFORMER_LOWERCASE",
	}
	Transformer_value = map[string]int32{
		"TRANSFORMER_UNSPECIFIED": 0,
		"TRANSFORMER_UPPERCASE":   1,
		"TRANSFORMER_LOWERCASE":   2,
	}
)

Enum value maps for Transformer.

View Source
var File_text_tools_proto protoreflect.FileDescriptor
View Source
var TextToolsService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "text_tools.TextToolsService",
	HandlerType: (*TextToolsServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TransformText",
			Handler:    _TextToolsService_TransformText_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "TransformAndSplitText",
			Handler:       _TextToolsService_TransformAndSplitText_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "text_tools.proto",
}

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

Functions

func RegisterTextToolsServiceHandler

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

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

func RegisterTextToolsServiceHandlerClient

func RegisterTextToolsServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TextToolsServiceClient) error

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

func RegisterTextToolsServiceHandlerFromEndpoint

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

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

func RegisterTextToolsServiceHandlerServer

func RegisterTextToolsServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TextToolsServiceServer) error

RegisterTextToolsServiceHandlerServer registers the http handlers for service TextToolsService to "mux". UnaryRPC :call TextToolsServiceServer 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 RegisterTextToolsServiceHandlerFromEndpoint instead.

func RegisterTextToolsServiceServer

func RegisterTextToolsServiceServer(s grpc.ServiceRegistrar, srv TextToolsServiceServer)

Types

type TextToolsServiceClient

type TextToolsServiceClient interface {
	// Unary rpc
	TransformText(ctx context.Context, in *TransformTextRequest, opts ...grpc.CallOption) (*TransformTextResponse, error)
	// BiDi rpc
	TransformAndSplitText(ctx context.Context, opts ...grpc.CallOption) (TextToolsService_TransformAndSplitTextClient, error)
}

TextToolsServiceClient is the client API for TextToolsService 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 TextToolsServiceServer

type TextToolsServiceServer interface {
	// Unary rpc
	TransformText(context.Context, *TransformTextRequest) (*TransformTextResponse, error)
	// BiDi rpc
	TransformAndSplitText(TextToolsService_TransformAndSplitTextServer) error
	// contains filtered or unexported methods
}

TextToolsServiceServer is the server API for TextToolsService service. All implementations must embed UnimplementedTextToolsServiceServer for forward compatibility

type TextToolsService_TransformAndSplitTextClient

type TextToolsService_TransformAndSplitTextClient interface {
	Send(*TransformTextRequest) error
	Recv() (*TransformTextResponse, error)
	grpc.ClientStream
}

type TextToolsService_TransformAndSplitTextServer

type TextToolsService_TransformAndSplitTextServer interface {
	Send(*TransformTextResponse) error
	Recv() (*TransformTextRequest, error)
	grpc.ServerStream
}

type TransformTextRequest

type TransformTextRequest struct {
	Transformer Transformer `protobuf:"varint,1,opt,name=transformer,proto3,enum=text_tools.Transformer" json:"transformer,omitempty"`
	Text        string      `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*TransformTextRequest) Descriptor deprecated

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

Deprecated: Use TransformTextRequest.ProtoReflect.Descriptor instead.

func (*TransformTextRequest) GetText

func (x *TransformTextRequest) GetText() string

func (*TransformTextRequest) GetTransformer

func (x *TransformTextRequest) GetTransformer() Transformer

func (*TransformTextRequest) ProtoMessage

func (*TransformTextRequest) ProtoMessage()

func (*TransformTextRequest) ProtoReflect

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

func (*TransformTextRequest) Reset

func (x *TransformTextRequest) Reset()

func (*TransformTextRequest) String

func (x *TransformTextRequest) String() string

type TransformTextResponse

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

func (*TransformTextResponse) Descriptor deprecated

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

Deprecated: Use TransformTextResponse.ProtoReflect.Descriptor instead.

func (*TransformTextResponse) GetResult

func (x *TransformTextResponse) GetResult() string

func (*TransformTextResponse) ProtoMessage

func (*TransformTextResponse) ProtoMessage()

func (*TransformTextResponse) ProtoReflect

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

func (*TransformTextResponse) Reset

func (x *TransformTextResponse) Reset()

func (*TransformTextResponse) String

func (x *TransformTextResponse) String() string

type Transformer

type Transformer int32
const (
	Transformer_TRANSFORMER_UNSPECIFIED Transformer = 0
	Transformer_TRANSFORMER_UPPERCASE   Transformer = 1
	Transformer_TRANSFORMER_LOWERCASE   Transformer = 2
)

func (Transformer) Descriptor

func (Transformer) Enum

func (x Transformer) Enum() *Transformer

func (Transformer) EnumDescriptor deprecated

func (Transformer) EnumDescriptor() ([]byte, []int)

Deprecated: Use Transformer.Descriptor instead.

func (Transformer) Number

func (x Transformer) Number() protoreflect.EnumNumber

func (Transformer) String

func (x Transformer) String() string

func (Transformer) Type

type UnimplementedTextToolsServiceServer

type UnimplementedTextToolsServiceServer struct {
}

UnimplementedTextToolsServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTextToolsServiceServer) TransformAndSplitText

func (UnimplementedTextToolsServiceServer) TransformText

type UnsafeTextToolsServiceServer

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

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

Jump to

Keyboard shortcuts

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