proto

package
v0.0.0-...-be28c4c Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Template_Increment_FullMethodName = "/proto.Template/Increment"
	Template_SayHi_FullMethodName     = "/proto.Template/SayHi"
)
View Source
const (
	Chat_SendMessage_FullMethodName          = "/proto.Chat/SendMessage"
	Chat_ReceiveMessageStream_FullMethodName = "/proto.Chat/ReceiveMessageStream"
)

Variables

View Source
var Chat_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Chat",
	HandlerType: (*ChatServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "SendMessage",
			Handler:    _Chat_SendMessage_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ReceiveMessageStream",
			Handler:       _Chat_ReceiveMessageStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/template.proto",
}

Chat_ServiceDesc is the grpc.ServiceDesc for Chat 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_proto_template_proto protoreflect.FileDescriptor
View Source
var Template_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Template",
	HandlerType: (*TemplateServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Increment",
			Handler:    _Template_Increment_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "SayHi",
			Handler:       _Template_SayHi_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "proto/template.proto",
}

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

Functions

func RegisterChatServer

func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)

func RegisterTemplateServer

func RegisterTemplateServer(s grpc.ServiceRegistrar, srv TemplateServer)

Types

type Ack

type Ack struct {
	NewValue int64 `protobuf:"varint,1,opt,name=newValue,proto3" json:"newValue,omitempty"`
	// gave it a status for the chat system
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*Ack) Descriptor deprecated

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

Deprecated: Use Ack.ProtoReflect.Descriptor instead.

func (*Ack) GetNewValue

func (x *Ack) GetNewValue() int64

func (*Ack) GetStatus

func (x *Ack) GetStatus() string

func (*Ack) ProtoMessage

func (*Ack) ProtoMessage()

func (*Ack) ProtoReflect

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

func (*Ack) Reset

func (x *Ack) Reset()

func (*Ack) String

func (x *Ack) String() string

type Amount

type Amount struct {
	ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"`
	Value      int64  `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

Amount is a type containing a string and int. They are intialized as the first and second parameter value.

func (*Amount) Descriptor deprecated

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

Deprecated: Use Amount.ProtoReflect.Descriptor instead.

func (*Amount) GetClientName

func (x *Amount) GetClientName() string

func (*Amount) GetValue

func (x *Amount) GetValue() int64

func (*Amount) ProtoMessage

func (*Amount) ProtoMessage()

func (*Amount) ProtoReflect

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

func (*Amount) Reset

func (x *Amount) Reset()

func (*Amount) String

func (x *Amount) String() string

type ChatClient

type ChatClient interface {
	// testing messaging system start
	SendMessage(ctx context.Context, in *ChatMessage, opts ...grpc.CallOption) (*Ack, error)
	ReceiveMessageStream(ctx context.Context, in *ClientName, opts ...grpc.CallOption) (Chat_ReceiveMessageStreamClient, error)
}

ChatClient is the client API for Chat 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 NewChatClient

func NewChatClient(cc grpc.ClientConnInterface) ChatClient

type ChatMessage

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

testing messaging system start

func (*ChatMessage) Descriptor deprecated

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

Deprecated: Use ChatMessage.ProtoReflect.Descriptor instead.

func (*ChatMessage) GetClientName

func (x *ChatMessage) GetClientName() string

func (*ChatMessage) GetContent

func (x *ChatMessage) GetContent() string

func (*ChatMessage) ProtoMessage

func (*ChatMessage) ProtoMessage()

func (*ChatMessage) ProtoReflect

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

func (*ChatMessage) Reset

func (x *ChatMessage) Reset()

func (*ChatMessage) String

func (x *ChatMessage) String() string

type ChatServer

type ChatServer interface {
	// testing messaging system start
	SendMessage(context.Context, *ChatMessage) (*Ack, error)
	ReceiveMessageStream(*ClientName, Chat_ReceiveMessageStreamServer) error
	// contains filtered or unexported methods
}

ChatServer is the server API for Chat service. All implementations must embed UnimplementedChatServer for forward compatibility

type Chat_ReceiveMessageStreamClient

type Chat_ReceiveMessageStreamClient interface {
	Recv() (*ChatMessage, error)
	grpc.ClientStream
}

type Chat_ReceiveMessageStreamServer

type Chat_ReceiveMessageStreamServer interface {
	Send(*ChatMessage) error
	grpc.ServerStream
}

type ClientName

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

func (*ClientName) Descriptor deprecated

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

Deprecated: Use ClientName.ProtoReflect.Descriptor instead.

func (*ClientName) GetClientName

func (x *ClientName) GetClientName() string

func (*ClientName) ProtoMessage

func (*ClientName) ProtoMessage()

func (*ClientName) ProtoReflect

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

func (*ClientName) Reset

func (x *ClientName) Reset()

func (*ClientName) String

func (x *ClientName) String() string

type Farewell

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

func (*Farewell) Descriptor deprecated

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

Deprecated: Use Farewell.ProtoReflect.Descriptor instead.

func (*Farewell) GetMessage

func (x *Farewell) GetMessage() string

func (*Farewell) ProtoMessage

func (*Farewell) ProtoMessage()

func (*Farewell) ProtoReflect

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

func (*Farewell) Reset

func (x *Farewell) Reset()

func (*Farewell) String

func (x *Farewell) String() string

type Greeding

type Greeding struct {
	ClientName string `protobuf:"bytes,1,opt,name=clientName,proto3" json:"clientName,omitempty"`
	Message    string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*Greeding) Descriptor deprecated

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

Deprecated: Use Greeding.ProtoReflect.Descriptor instead.

func (*Greeding) GetClientName

func (x *Greeding) GetClientName() string

func (*Greeding) GetMessage

func (x *Greeding) GetMessage() string

func (*Greeding) ProtoMessage

func (*Greeding) ProtoMessage()

func (*Greeding) ProtoReflect

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

func (*Greeding) Reset

func (x *Greeding) Reset()

func (*Greeding) String

func (x *Greeding) String() string

type TemplateClient

type TemplateClient interface {
	// one message is sent and one is recieved
	Increment(ctx context.Context, in *Amount, opts ...grpc.CallOption) (*Ack, error)
	// many messages are sent and one is recieved
	SayHi(ctx context.Context, opts ...grpc.CallOption) (Template_SayHiClient, error)
}

TemplateClient is the client API for Template 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 NewTemplateClient

func NewTemplateClient(cc grpc.ClientConnInterface) TemplateClient

type TemplateServer

type TemplateServer interface {
	// one message is sent and one is recieved
	Increment(context.Context, *Amount) (*Ack, error)
	// many messages are sent and one is recieved
	SayHi(Template_SayHiServer) error
	// contains filtered or unexported methods
}

TemplateServer is the server API for Template service. All implementations must embed UnimplementedTemplateServer for forward compatibility

type Template_SayHiClient

type Template_SayHiClient interface {
	Send(*Greeding) error
	CloseAndRecv() (*Farewell, error)
	grpc.ClientStream
}

type Template_SayHiServer

type Template_SayHiServer interface {
	SendAndClose(*Farewell) error
	Recv() (*Greeding, error)
	grpc.ServerStream
}

type UnimplementedChatServer

type UnimplementedChatServer struct {
}

UnimplementedChatServer must be embedded to have forward compatible implementations.

func (UnimplementedChatServer) ReceiveMessageStream

func (UnimplementedChatServer) SendMessage

type UnimplementedTemplateServer

type UnimplementedTemplateServer struct {
}

UnimplementedTemplateServer must be embedded to have forward compatible implementations.

func (UnimplementedTemplateServer) Increment

func (UnimplementedTemplateServer) SayHi

type UnsafeChatServer

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

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

type UnsafeTemplateServer

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

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

Jump to

Keyboard shortcuts

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