v1

package
v0.0.0-...-a5cb702 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_trans_proto protoreflect.FileDescriptor

Functions

func RegisterServiceServer

func RegisterServiceServer(s *grpc.Server, srv ServiceServer)

Types

type ServiceClient

type ServiceClient interface {
	TranslateMultiple(ctx context.Context, in *TransRequestParam, opts ...grpc.CallOption) (*TransResponse, error)
	TranslateOne(ctx context.Context, in *TransOneRequestParam, opts ...grpc.CallOption) (*TransOneResponse, error)
}

ServiceClient is the client API for Service service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewServiceClient

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient

type ServiceServer

type ServiceServer interface {
	TranslateMultiple(context.Context, *TransRequestParam) (*TransResponse, error)
	TranslateOne(context.Context, *TransOneRequestParam) (*TransOneResponse, error)
}

ServiceServer is the server API for Service service.

type TransOneRequestParam

type TransOneRequestParam struct {
	Type    string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Content string `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Lang    string `protobuf:"bytes,3,opt,name=lang,proto3" json:"lang,omitempty"`
	// contains filtered or unexported fields
}

单条翻译

func (*TransOneRequestParam) Descriptor deprecated

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

Deprecated: Use TransOneRequestParam.ProtoReflect.Descriptor instead.

func (*TransOneRequestParam) GetContent

func (x *TransOneRequestParam) GetContent() string

func (*TransOneRequestParam) GetLang

func (x *TransOneRequestParam) GetLang() string

func (*TransOneRequestParam) GetType

func (x *TransOneRequestParam) GetType() string

func (*TransOneRequestParam) ProtoMessage

func (*TransOneRequestParam) ProtoMessage()

func (*TransOneRequestParam) ProtoReflect

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

func (*TransOneRequestParam) Reset

func (x *TransOneRequestParam) Reset()

func (*TransOneRequestParam) String

func (x *TransOneRequestParam) String() string

type TransOneResponse

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

func (*TransOneResponse) Descriptor deprecated

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

Deprecated: Use TransOneResponse.ProtoReflect.Descriptor instead.

func (*TransOneResponse) GetContent

func (x *TransOneResponse) GetContent() string

func (*TransOneResponse) ProtoMessage

func (*TransOneResponse) ProtoMessage()

func (*TransOneResponse) ProtoReflect

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

func (*TransOneResponse) Reset

func (x *TransOneResponse) Reset()

func (*TransOneResponse) String

func (x *TransOneResponse) String() string

type TransRequestParam

type TransRequestParam struct {
	Type    string   `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"`
	Content string   `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Lang    []string `protobuf:"bytes,3,rep,name=lang,proto3" json:"lang,omitempty"`
	// contains filtered or unexported fields
}

批量翻译

func (*TransRequestParam) Descriptor deprecated

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

Deprecated: Use TransRequestParam.ProtoReflect.Descriptor instead.

func (*TransRequestParam) GetContent

func (x *TransRequestParam) GetContent() string

func (*TransRequestParam) GetLang

func (x *TransRequestParam) GetLang() []string

func (*TransRequestParam) GetType

func (x *TransRequestParam) GetType() string

func (*TransRequestParam) ProtoMessage

func (*TransRequestParam) ProtoMessage()

func (*TransRequestParam) ProtoReflect

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

func (*TransRequestParam) Reset

func (x *TransRequestParam) Reset()

func (*TransRequestParam) String

func (x *TransRequestParam) String() string

type TransResponse

type TransResponse struct {
	Ret     int64             `protobuf:"varint,1,opt,name=ret,proto3" json:"ret,omitempty"`
	Msg     string            `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	Success map[string]string `` /* 155-byte string literal not displayed */
	Err     map[string]string `` /* 147-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*TransResponse) Descriptor deprecated

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

Deprecated: Use TransResponse.ProtoReflect.Descriptor instead.

func (*TransResponse) GetErr

func (x *TransResponse) GetErr() map[string]string

func (*TransResponse) GetMsg

func (x *TransResponse) GetMsg() string

func (*TransResponse) GetRet

func (x *TransResponse) GetRet() int64

func (*TransResponse) GetSuccess

func (x *TransResponse) GetSuccess() map[string]string

func (*TransResponse) ProtoMessage

func (*TransResponse) ProtoMessage()

func (*TransResponse) ProtoReflect

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

func (*TransResponse) Reset

func (x *TransResponse) Reset()

func (*TransResponse) String

func (x *TransResponse) String() string

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) TranslateMultiple

func (*UnimplementedServiceServer) TranslateOne

Jump to

Keyboard shortcuts

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