echo

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Corpus_name = map[int32]string{
		0: "UNIVERSAL",
		1: "WEB",
		2: "IMAGES",
		3: "LOCAL",
		4: "NEWS",
		5: "PRODUCTS",
		6: "VIDEO",
	}
	Corpus_value = map[string]int32{
		"UNIVERSAL": 0,
		"WEB":       1,
		"IMAGES":    2,
		"LOCAL":     3,
		"NEWS":      4,
		"PRODUCTS":  5,
		"VIDEO":     6,
	}
)

Enum value maps for Corpus.

View Source
var EchoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "echo.EchoService",
	HandlerType: (*EchoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Echo",
			Handler:    _EchoService_Echo_Handler,
		},
		{
			MethodName: "EchoBody",
			Handler:    _EchoService_EchoBody_Handler,
		},
		{
			MethodName: "EchoResponseBody",
			Handler:    _EchoService_EchoResponseBody_Handler,
		},
		{
			MethodName: "EchoDelete",
			Handler:    _EchoService_EchoDelete_Handler,
		},
		{
			MethodName: "EchoPatch",
			Handler:    _EchoService_EchoPatch_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "echo_service.proto",
}

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

View Source
var File_echo_service_proto protoreflect.FileDescriptor
View Source
var File_stream_proto protoreflect.FileDescriptor
View Source
var StreamService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "echo.StreamService",
	HandlerType: (*StreamServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Download",
			Handler:       _StreamService_Download_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "stream.proto",
}

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

Functions

func RegisterEchoServiceHTTPServer

func RegisterEchoServiceHTTPServer(s *http.Server, srv EchoServiceHTTPServer)

func RegisterEchoServiceServer

func RegisterEchoServiceServer(s grpc.ServiceRegistrar, srv EchoServiceServer)

func RegisterStreamServiceServer

func RegisterStreamServiceServer(s grpc.ServiceRegistrar, srv StreamServiceServer)

Types

type Corpus

type Corpus int32
const (
	Corpus_UNIVERSAL Corpus = 0
	Corpus_WEB       Corpus = 1
	Corpus_IMAGES    Corpus = 2
	Corpus_LOCAL     Corpus = 3
	Corpus_NEWS      Corpus = 4
	Corpus_PRODUCTS  Corpus = 5
	Corpus_VIDEO     Corpus = 6
)

func (Corpus) Descriptor

func (Corpus) Descriptor() protoreflect.EnumDescriptor

func (Corpus) Enum

func (x Corpus) Enum() *Corpus

func (Corpus) EnumDescriptor deprecated

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

Deprecated: Use Corpus.Descriptor instead.

func (Corpus) Number

func (x Corpus) Number() protoreflect.EnumNumber

func (Corpus) String

func (x Corpus) String() string

func (Corpus) Type

func (Corpus) Type() protoreflect.EnumType

type DynamicMessage

type DynamicMessage struct {
	StructField *structpb.Struct `protobuf:"bytes,1,opt,name=struct_field,json=structField,proto3" json:"struct_field,omitempty"`
	ValueField  *structpb.Value  `protobuf:"bytes,2,opt,name=value_field,json=valueField,proto3" json:"value_field,omitempty"`
	// contains filtered or unexported fields
}

DynamicMessage represents a message which can have its structure built dynamically using Struct and Values.

func (*DynamicMessage) Descriptor deprecated

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

Deprecated: Use DynamicMessage.ProtoReflect.Descriptor instead.

func (*DynamicMessage) GetStructField

func (x *DynamicMessage) GetStructField() *structpb.Struct

func (*DynamicMessage) GetValueField

func (x *DynamicMessage) GetValueField() *structpb.Value

func (*DynamicMessage) ProtoMessage

func (*DynamicMessage) ProtoMessage()

func (*DynamicMessage) ProtoReflect

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

func (*DynamicMessage) Reset

func (x *DynamicMessage) Reset()

func (*DynamicMessage) String

func (x *DynamicMessage) String() string

type DynamicMessageUpdate

type DynamicMessageUpdate struct {
	Body       *DynamicMessage        `protobuf:"bytes,1,opt,name=body,proto3" json:"body,omitempty"`
	UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
	// contains filtered or unexported fields
}

func (*DynamicMessageUpdate) Descriptor deprecated

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

Deprecated: Use DynamicMessageUpdate.ProtoReflect.Descriptor instead.

func (*DynamicMessageUpdate) GetBody

func (x *DynamicMessageUpdate) GetBody() *DynamicMessage

func (*DynamicMessageUpdate) GetUpdateMask

func (x *DynamicMessageUpdate) GetUpdateMask() *fieldmaskpb.FieldMask

func (*DynamicMessageUpdate) ProtoMessage

func (*DynamicMessageUpdate) ProtoMessage()

func (*DynamicMessageUpdate) ProtoReflect

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

func (*DynamicMessageUpdate) Reset

func (x *DynamicMessageUpdate) Reset()

func (*DynamicMessageUpdate) String

func (x *DynamicMessageUpdate) String() string

type EchoServiceClient

type EchoServiceClient interface {
	// Echo method receives a simple message and returns it.
	//
	// The message posted as the id parameter will also be
	// returned.
	Echo(ctx context.Context, in *SimpleMessage, opts ...grpc.CallOption) (*SimpleMessage, error)
	// EchoBody method receives a simple message and returns it.
	EchoBody(ctx context.Context, in *SimpleMessage, opts ...grpc.CallOption) (*SimpleMessage, error)
	// EchoResponseBody method receives a simple message and returns it.
	EchoResponseBody(ctx context.Context, in *DynamicMessageUpdate, opts ...grpc.CallOption) (*DynamicMessageUpdate, error)
	// EchoDelete method receives a simple message and returns it.
	EchoDelete(ctx context.Context, in *SimpleMessage, opts ...grpc.CallOption) (*SimpleMessage, error)
	// EchoPatch method receives a NonStandardUpdateRequest and returns it.
	EchoPatch(ctx context.Context, in *DynamicMessageUpdate, opts ...grpc.CallOption) (*DynamicMessageUpdate, error)
}

EchoServiceClient is the client API for EchoService 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 EchoServiceHTTPClient

type EchoServiceHTTPClient interface {
	Echo(ctx context.Context, req *SimpleMessage, opts ...http.CallOption) (rsp *SimpleMessage, err error)
	EchoBody(ctx context.Context, req *SimpleMessage, opts ...http.CallOption) (rsp *SimpleMessage, err error)
	EchoDelete(ctx context.Context, req *SimpleMessage, opts ...http.CallOption) (rsp *SimpleMessage, err error)
	EchoPatch(ctx context.Context, req *DynamicMessageUpdate, opts ...http.CallOption) (rsp *DynamicMessageUpdate, err error)
	EchoResponseBody(ctx context.Context, req *DynamicMessageUpdate, opts ...http.CallOption) (rsp *DynamicMessageUpdate, err error)
}

func NewEchoServiceHTTPClient

func NewEchoServiceHTTPClient(client *http.Client) EchoServiceHTTPClient

type EchoServiceHTTPClientImpl

type EchoServiceHTTPClientImpl struct {
	// contains filtered or unexported fields
}

func (*EchoServiceHTTPClientImpl) Echo

func (*EchoServiceHTTPClientImpl) EchoBody

func (*EchoServiceHTTPClientImpl) EchoDelete

func (*EchoServiceHTTPClientImpl) EchoPatch

func (*EchoServiceHTTPClientImpl) EchoResponseBody

type EchoServiceServer

type EchoServiceServer interface {
	// Echo method receives a simple message and returns it.
	//
	// The message posted as the id parameter will also be
	// returned.
	Echo(context.Context, *SimpleMessage) (*SimpleMessage, error)
	// EchoBody method receives a simple message and returns it.
	EchoBody(context.Context, *SimpleMessage) (*SimpleMessage, error)
	// EchoResponseBody method receives a simple message and returns it.
	EchoResponseBody(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error)
	// EchoDelete method receives a simple message and returns it.
	EchoDelete(context.Context, *SimpleMessage) (*SimpleMessage, error)
	// EchoPatch method receives a NonStandardUpdateRequest and returns it.
	EchoPatch(context.Context, *DynamicMessageUpdate) (*DynamicMessageUpdate, error)
	// contains filtered or unexported methods
}

EchoServiceServer is the server API for EchoService service. All implementations must embed UnimplementedEchoServiceServer for forward compatibility

type Embedded

type Embedded struct {

	// Types that are assignable to Mark:
	//	*Embedded_Progress
	//	*Embedded_Note
	Mark isEmbedded_Mark `protobuf_oneof:"mark"`
	// contains filtered or unexported fields
}

Embedded represents a message embedded in SimpleMessage.

func (*Embedded) Descriptor deprecated

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

Deprecated: Use Embedded.ProtoReflect.Descriptor instead.

func (*Embedded) GetMark

func (m *Embedded) GetMark() isEmbedded_Mark

func (*Embedded) GetNote

func (x *Embedded) GetNote() string

func (*Embedded) GetProgress

func (x *Embedded) GetProgress() int64

func (*Embedded) ProtoMessage

func (*Embedded) ProtoMessage()

func (*Embedded) ProtoReflect

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

func (*Embedded) Reset

func (x *Embedded) Reset()

func (*Embedded) String

func (x *Embedded) String() string

type Embedded_Note

type Embedded_Note struct {
	Note string `protobuf:"bytes,2,opt,name=note,proto3,oneof"`
}

type Embedded_Progress

type Embedded_Progress struct {
	Progress int64 `protobuf:"varint,1,opt,name=progress,proto3,oneof"`
}

type SimpleMessage

type SimpleMessage struct {

	// Id represents the message identifier.
	Id  string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Num int64  `protobuf:"varint,2,opt,name=num,json=number,proto3" json:"num,omitempty"`
	// Types that are assignable to Code:
	//	*SimpleMessage_LineNum
	//	*SimpleMessage_Lang
	Code   isSimpleMessage_Code `protobuf_oneof:"code"`
	Status *Embedded            `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"`
	// Types that are assignable to Ext:
	//	*SimpleMessage_En
	//	*SimpleMessage_No
	Ext    isSimpleMessage_Ext `protobuf_oneof:"ext"`
	Corpus Corpus              `protobuf:"varint,8,opt,name=corpus,proto3,enum=echo.Corpus" json:"corpus,omitempty"`
	// contains filtered or unexported fields
}

SimpleMessage represents a simple message sent to the Echo service.

func (*SimpleMessage) Descriptor deprecated

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

Deprecated: Use SimpleMessage.ProtoReflect.Descriptor instead.

func (*SimpleMessage) GetCode

func (m *SimpleMessage) GetCode() isSimpleMessage_Code

func (*SimpleMessage) GetCorpus

func (x *SimpleMessage) GetCorpus() Corpus

func (*SimpleMessage) GetEn

func (x *SimpleMessage) GetEn() int64

func (*SimpleMessage) GetExt

func (m *SimpleMessage) GetExt() isSimpleMessage_Ext

func (*SimpleMessage) GetId

func (x *SimpleMessage) GetId() string

func (*SimpleMessage) GetLang

func (x *SimpleMessage) GetLang() string

func (*SimpleMessage) GetLineNum

func (x *SimpleMessage) GetLineNum() int64

func (*SimpleMessage) GetNo

func (x *SimpleMessage) GetNo() *Embedded

func (*SimpleMessage) GetNum

func (x *SimpleMessage) GetNum() int64

func (*SimpleMessage) GetStatus

func (x *SimpleMessage) GetStatus() *Embedded

func (*SimpleMessage) ProtoMessage

func (*SimpleMessage) ProtoMessage()

func (*SimpleMessage) ProtoReflect

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

func (*SimpleMessage) Reset

func (x *SimpleMessage) Reset()

func (*SimpleMessage) String

func (x *SimpleMessage) String() string

type SimpleMessage_En

type SimpleMessage_En struct {
	En int64 `protobuf:"varint,6,opt,name=en,proto3,oneof"`
}

type SimpleMessage_Lang

type SimpleMessage_Lang struct {
	Lang string `protobuf:"bytes,4,opt,name=lang,proto3,oneof"`
}

type SimpleMessage_LineNum

type SimpleMessage_LineNum struct {
	LineNum int64 `protobuf:"varint,3,opt,name=line_num,json=lineNum,proto3,oneof"`
}

type SimpleMessage_No

type SimpleMessage_No struct {
	No *Embedded `protobuf:"bytes,7,opt,name=no,proto3,oneof"`
}

type StreamServiceClient

type StreamServiceClient interface {
	Download(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (StreamService_DownloadClient, error)
}

StreamServiceClient is the client API for StreamService 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 StreamServiceServer

type StreamServiceServer interface {
	Download(*emptypb.Empty, StreamService_DownloadServer) error
	// contains filtered or unexported methods
}

StreamServiceServer is the server API for StreamService service. All implementations must embed UnimplementedStreamServiceServer for forward compatibility

type StreamService_DownloadClient

type StreamService_DownloadClient interface {
	Recv() (*httpbody.HttpBody, error)
	grpc.ClientStream
}

type StreamService_DownloadServer

type StreamService_DownloadServer interface {
	Send(*httpbody.HttpBody) error
	grpc.ServerStream
}

type UnimplementedEchoServiceServer

type UnimplementedEchoServiceServer struct {
}

UnimplementedEchoServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedEchoServiceServer) Echo

func (UnimplementedEchoServiceServer) EchoBody

func (UnimplementedEchoServiceServer) EchoDelete

func (UnimplementedEchoServiceServer) EchoPatch

func (UnimplementedEchoServiceServer) EchoResponseBody

type UnimplementedStreamServiceServer

type UnimplementedStreamServiceServer struct {
}

UnimplementedStreamServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedStreamServiceServer) Download

type UnsafeEchoServiceServer

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

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

type UnsafeStreamServiceServer

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

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

Jump to

Keyboard shortcuts

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