proto

package
v0.0.0-...-eacaf95 Latest Latest
Warning

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

Go to latest
Published: May 24, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PublishStatusCode_name = map[int32]string{
		0: "Unknown",
		1: "Ok",
		2: "Failed",
	}
	PublishStatusCode_value = map[string]int32{
		"Unknown": 0,
		"Ok":      1,
		"Failed":  2,
	}
)

Enum value maps for PublishStatusCode.

View Source
var File_topic_proto protoreflect.FileDescriptor
View Source
var Topic_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Topic",
	HandlerType: (*TopicServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Publish",
			Handler:    _Topic_Publish_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "PublishStream",
			Handler:       _Topic_PublishStream_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "StreamFile",
			Handler:       _Topic_StreamFile_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "topic.proto",
}

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

Functions

func RegisterTopicServer

func RegisterTopicServer(s grpc.ServiceRegistrar, srv TopicServer)

Types

type AcknowledgementResponse

type AcknowledgementResponse struct {
	Message string            `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"`
	Code    PublishStatusCode `protobuf:"varint,2,opt,name=Code,proto3,enum=proto.PublishStatusCode" json:"Code,omitempty"`
	// contains filtered or unexported fields
}

func (*AcknowledgementResponse) Descriptor deprecated

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

Deprecated: Use AcknowledgementResponse.ProtoReflect.Descriptor instead.

func (*AcknowledgementResponse) GetCode

func (*AcknowledgementResponse) GetMessage

func (x *AcknowledgementResponse) GetMessage() string

func (*AcknowledgementResponse) ProtoMessage

func (*AcknowledgementResponse) ProtoMessage()

func (*AcknowledgementResponse) ProtoReflect

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

func (*AcknowledgementResponse) Reset

func (x *AcknowledgementResponse) Reset()

func (*AcknowledgementResponse) String

func (x *AcknowledgementResponse) String() string

type PublishRequest

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

func (*PublishRequest) Descriptor deprecated

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

Deprecated: Use PublishRequest.ProtoReflect.Descriptor instead.

func (*PublishRequest) GetContent

func (x *PublishRequest) GetContent() string

func (*PublishRequest) ProtoMessage

func (*PublishRequest) ProtoMessage()

func (*PublishRequest) ProtoReflect

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

func (*PublishRequest) Reset

func (x *PublishRequest) Reset()

func (*PublishRequest) String

func (x *PublishRequest) String() string

type PublishResponse

type PublishResponse struct {
	Message string            `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"`
	Code    PublishStatusCode `protobuf:"varint,2,opt,name=Code,proto3,enum=proto.PublishStatusCode" json:"Code,omitempty"`
	// contains filtered or unexported fields
}

func (*PublishResponse) Descriptor deprecated

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

Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead.

func (*PublishResponse) GetCode

func (x *PublishResponse) GetCode() PublishStatusCode

func (*PublishResponse) GetMessage

func (x *PublishResponse) GetMessage() string

func (*PublishResponse) ProtoMessage

func (*PublishResponse) ProtoMessage()

func (*PublishResponse) ProtoReflect

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

func (*PublishResponse) Reset

func (x *PublishResponse) Reset()

func (*PublishResponse) String

func (x *PublishResponse) String() string

type PublishStatusCode

type PublishStatusCode int32
const (
	PublishStatusCode_Unknown PublishStatusCode = 0
	PublishStatusCode_Ok      PublishStatusCode = 1
	PublishStatusCode_Failed  PublishStatusCode = 2
)

func (PublishStatusCode) Descriptor

func (PublishStatusCode) Enum

func (PublishStatusCode) EnumDescriptor deprecated

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

Deprecated: Use PublishStatusCode.Descriptor instead.

func (PublishStatusCode) Number

func (PublishStatusCode) String

func (x PublishStatusCode) String() string

func (PublishStatusCode) Type

type PublishStreamRequest

type PublishStreamRequest struct {
	Content []byte `protobuf:"bytes,1,opt,name=Content,proto3" json:"Content,omitempty"`
	// contains filtered or unexported fields
}

func (*PublishStreamRequest) Descriptor deprecated

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

Deprecated: Use PublishStreamRequest.ProtoReflect.Descriptor instead.

func (*PublishStreamRequest) GetContent

func (x *PublishStreamRequest) GetContent() []byte

func (*PublishStreamRequest) ProtoMessage

func (*PublishStreamRequest) ProtoMessage()

func (*PublishStreamRequest) ProtoReflect

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

func (*PublishStreamRequest) Reset

func (x *PublishStreamRequest) Reset()

func (*PublishStreamRequest) String

func (x *PublishStreamRequest) String() string

type TopicClient

type TopicClient interface {
	Publish(ctx context.Context, in *PublishRequest, opts ...grpc.CallOption) (*PublishResponse, error)
	PublishStream(ctx context.Context, opts ...grpc.CallOption) (Topic_PublishStreamClient, error)
	StreamFile(ctx context.Context, opts ...grpc.CallOption) (Topic_StreamFileClient, error)
}

TopicClient is the client API for Topic 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 NewTopicClient

func NewTopicClient(cc grpc.ClientConnInterface) TopicClient

type TopicServer

type TopicServer interface {
	Publish(context.Context, *PublishRequest) (*PublishResponse, error)
	PublishStream(Topic_PublishStreamServer) error
	StreamFile(Topic_StreamFileServer) error
}

TopicServer is the server API for Topic service. All implementations should embed UnimplementedTopicServer for forward compatibility

type Topic_PublishStreamClient

type Topic_PublishStreamClient interface {
	Send(*PublishStreamRequest) error
	CloseAndRecv() (*AcknowledgementResponse, error)
	grpc.ClientStream
}

type Topic_PublishStreamServer

type Topic_PublishStreamServer interface {
	SendAndClose(*AcknowledgementResponse) error
	Recv() (*PublishStreamRequest, error)
	grpc.ServerStream
}

type Topic_StreamFileClient

type Topic_StreamFileClient interface {
	Send(*PublishStreamRequest) error
	CloseAndRecv() (*AcknowledgementResponse, error)
	grpc.ClientStream
}

type Topic_StreamFileServer

type Topic_StreamFileServer interface {
	SendAndClose(*AcknowledgementResponse) error
	Recv() (*PublishStreamRequest, error)
	grpc.ServerStream
}

type UnimplementedTopicServer

type UnimplementedTopicServer struct {
}

UnimplementedTopicServer should be embedded to have forward compatible implementations.

func (UnimplementedTopicServer) Publish

func (UnimplementedTopicServer) PublishStream

func (UnimplementedTopicServer) StreamFile

type UnsafeTopicServer

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

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

Jump to

Keyboard shortcuts

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