Documentation ¶
Overview ¶
Package textclassificationv1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterTextClassificationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterTextClassificationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterTextClassificationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterTextClassificationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, ...) error
- func RegisterTextClassificationServiceServer(s grpc.ServiceRegistrar, srv TextClassificationServiceServer)
- type ClassifyRequest
- type ClassifyResponse
- func (*ClassifyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *ClassifyResponse) GetLabels() []string
- func (x *ClassifyResponse) GetScores() []float64
- func (*ClassifyResponse) ProtoMessage()
- func (x *ClassifyResponse) ProtoReflect() protoreflect.Message
- func (x *ClassifyResponse) Reset()
- func (x *ClassifyResponse) String() string
- type TextClassificationServiceClient
- type TextClassificationServiceServer
- type UnimplementedTextClassificationServiceServer
- type UnsafeTextClassificationServiceServer
Constants ¶
const (
TextClassificationService_Classify_FullMethodName = "/textclassification.v1.TextClassificationService/Classify"
)
Variables ¶
var File_textclassification_v1_textclassification_proto protoreflect.FileDescriptor
var TextClassificationService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "textclassification.v1.TextClassificationService", HandlerType: (*TextClassificationServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Classify", Handler: _TextClassificationService_Classify_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "textclassification/v1/textclassification.proto", }
TextClassificationService_ServiceDesc is the grpc.ServiceDesc for TextClassificationService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterTextClassificationServiceHandler ¶
func RegisterTextClassificationServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterTextClassificationServiceHandler registers the http handlers for service TextClassificationService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterTextClassificationServiceHandlerClient ¶
func RegisterTextClassificationServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client TextClassificationServiceClient) error
RegisterTextClassificationServiceHandlerClient registers the http handlers for service TextClassificationService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "TextClassificationServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "TextClassificationServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "TextClassificationServiceClient" to call the correct interceptors.
func RegisterTextClassificationServiceHandlerFromEndpoint ¶
func RegisterTextClassificationServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterTextClassificationServiceHandlerFromEndpoint is same as RegisterTextClassificationServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterTextClassificationServiceHandlerServer ¶
func RegisterTextClassificationServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server TextClassificationServiceServer) error
RegisterTextClassificationServiceHandlerServer registers the http handlers for service TextClassificationService to "mux". UnaryRPC :call TextClassificationServiceServer 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 RegisterTextClassificationServiceHandlerFromEndpoint instead.
func RegisterTextClassificationServiceServer ¶
func RegisterTextClassificationServiceServer(s grpc.ServiceRegistrar, srv TextClassificationServiceServer)
Types ¶
type ClassifyRequest ¶
type ClassifyRequest struct { Input string `protobuf:"bytes,1,opt,name=input,proto3" json:"input,omitempty"` // contains filtered or unexported fields }
func (*ClassifyRequest) Descriptor
deprecated
func (*ClassifyRequest) Descriptor() ([]byte, []int)
Deprecated: Use ClassifyRequest.ProtoReflect.Descriptor instead.
func (*ClassifyRequest) GetInput ¶
func (x *ClassifyRequest) GetInput() string
func (*ClassifyRequest) ProtoMessage ¶
func (*ClassifyRequest) ProtoMessage()
func (*ClassifyRequest) ProtoReflect ¶
func (x *ClassifyRequest) ProtoReflect() protoreflect.Message
func (*ClassifyRequest) Reset ¶
func (x *ClassifyRequest) Reset()
func (*ClassifyRequest) String ¶
func (x *ClassifyRequest) String() string
type ClassifyResponse ¶
type ClassifyResponse struct { Labels []string `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels,omitempty"` Scores []float64 `protobuf:"fixed64,2,rep,packed,name=scores,proto3" json:"scores,omitempty"` // contains filtered or unexported fields }
func (*ClassifyResponse) Descriptor
deprecated
func (*ClassifyResponse) Descriptor() ([]byte, []int)
Deprecated: Use ClassifyResponse.ProtoReflect.Descriptor instead.
func (*ClassifyResponse) GetLabels ¶
func (x *ClassifyResponse) GetLabels() []string
func (*ClassifyResponse) GetScores ¶
func (x *ClassifyResponse) GetScores() []float64
func (*ClassifyResponse) ProtoMessage ¶
func (*ClassifyResponse) ProtoMessage()
func (*ClassifyResponse) ProtoReflect ¶
func (x *ClassifyResponse) ProtoReflect() protoreflect.Message
func (*ClassifyResponse) Reset ¶
func (x *ClassifyResponse) Reset()
func (*ClassifyResponse) String ¶
func (x *ClassifyResponse) String() string
type TextClassificationServiceClient ¶
type TextClassificationServiceClient interface {
Classify(ctx context.Context, in *ClassifyRequest, opts ...grpc.CallOption) (*ClassifyResponse, error)
}
TextClassificationServiceClient is the client API for TextClassificationService 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 NewTextClassificationServiceClient ¶
func NewTextClassificationServiceClient(cc grpc.ClientConnInterface) TextClassificationServiceClient
type TextClassificationServiceServer ¶
type TextClassificationServiceServer interface { Classify(context.Context, *ClassifyRequest) (*ClassifyResponse, error) // contains filtered or unexported methods }
TextClassificationServiceServer is the server API for TextClassificationService service. All implementations must embed UnimplementedTextClassificationServiceServer for forward compatibility
type UnimplementedTextClassificationServiceServer ¶
type UnimplementedTextClassificationServiceServer struct { }
UnimplementedTextClassificationServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedTextClassificationServiceServer) Classify ¶
func (UnimplementedTextClassificationServiceServer) Classify(context.Context, *ClassifyRequest) (*ClassifyResponse, error)
type UnsafeTextClassificationServiceServer ¶
type UnsafeTextClassificationServiceServer interface {
// contains filtered or unexported methods
}
UnsafeTextClassificationServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to TextClassificationServiceServer will result in compilation errors.