textencodingv1

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: BSD-2-Clause Imports: 16 Imported by: 0

Documentation

Overview

Package textencodingv1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	TextEncodingService_Encode_FullMethodName = "/textencoding.v1.TextEncodingService/Encode"
)

Variables

View Source
var File_textencoding_v1_textencoding_proto protoreflect.FileDescriptor
View Source
var TextEncodingService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "textencoding.v1.TextEncodingService",
	HandlerType: (*TextEncodingServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Encode",
			Handler:    _TextEncodingService_Encode_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "textencoding/v1/textencoding.proto",
}

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

Functions

func RegisterTextEncodingServiceHandler

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

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

func RegisterTextEncodingServiceHandlerClient

func RegisterTextEncodingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TextEncodingServiceClient) error

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

func RegisterTextEncodingServiceHandlerFromEndpoint

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

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

func RegisterTextEncodingServiceHandlerServer

func RegisterTextEncodingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TextEncodingServiceServer) error

RegisterTextEncodingServiceHandlerServer registers the http handlers for service TextEncodingService to "mux". UnaryRPC :call TextEncodingServiceServer 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 RegisterTextEncodingServiceHandlerFromEndpoint instead.

func RegisterTextEncodingServiceServer

func RegisterTextEncodingServiceServer(s grpc.ServiceRegistrar, srv TextEncodingServiceServer)

Types

type EncodingRequest

type EncodingRequest struct {
	Input           string `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"`
	PoolingStrategy int32  `protobuf:"varint,2,opt,name=pooling_strategy,json=poolingStrategy,proto3" json:"pooling_strategy,omitempty"`
	// contains filtered or unexported fields
}

func (*EncodingRequest) Descriptor deprecated

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

Deprecated: Use EncodingRequest.ProtoReflect.Descriptor instead.

func (*EncodingRequest) GetInput

func (x *EncodingRequest) GetInput() string

func (*EncodingRequest) GetPoolingStrategy

func (x *EncodingRequest) GetPoolingStrategy() int32

func (*EncodingRequest) ProtoMessage

func (*EncodingRequest) ProtoMessage()

func (*EncodingRequest) ProtoReflect

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

func (*EncodingRequest) Reset

func (x *EncodingRequest) Reset()

func (*EncodingRequest) String

func (x *EncodingRequest) String() string

type EncodingResponse

type EncodingResponse struct {
	Vector []float32 `protobuf:"fixed32,1,rep,packed,name=vector,proto3" json:"vector,omitempty"`
	// contains filtered or unexported fields
}

func (*EncodingResponse) Descriptor deprecated

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

Deprecated: Use EncodingResponse.ProtoReflect.Descriptor instead.

func (*EncodingResponse) GetVector

func (x *EncodingResponse) GetVector() []float32

func (*EncodingResponse) ProtoMessage

func (*EncodingResponse) ProtoMessage()

func (*EncodingResponse) ProtoReflect

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

func (*EncodingResponse) Reset

func (x *EncodingResponse) Reset()

func (*EncodingResponse) String

func (x *EncodingResponse) String() string

type TextEncodingServiceClient

type TextEncodingServiceClient interface {
	Encode(ctx context.Context, in *EncodingRequest, opts ...grpc.CallOption) (*EncodingResponse, error)
}

TextEncodingServiceClient is the client API for TextEncodingService 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 TextEncodingServiceServer

type TextEncodingServiceServer interface {
	Encode(context.Context, *EncodingRequest) (*EncodingResponse, error)
	// contains filtered or unexported methods
}

TextEncodingServiceServer is the server API for TextEncodingService service. All implementations must embed UnimplementedTextEncodingServiceServer for forward compatibility

type UnimplementedTextEncodingServiceServer

type UnimplementedTextEncodingServiceServer struct {
}

UnimplementedTextEncodingServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedTextEncodingServiceServer) Encode

type UnsafeTextEncodingServiceServer

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

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

Jump to

Keyboard shortcuts

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