proto

package
v0.0.0-...-e2d9e70 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Chat_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.Chat",
	HandlerType: (*ChatServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Broadcast",
			Handler:    _Chat_Broadcast_Handler,
		},
		{
			MethodName: "Publish",
			Handler:    _Chat_Publish_Handler,
		},
		{
			MethodName: "Leave",
			Handler:    _Chat_Leave_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Join",
			Handler:       _Chat_Join_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "chat.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)

Functions

func RegisterChatServer

func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)

Types

type ChatClient

type ChatClient interface {
	Broadcast(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Empty, error)
	Join(ctx context.Context, in *User, opts ...grpc.CallOption) (Chat_JoinClient, error)
	Publish(ctx context.Context, in *Message, opts ...grpc.CallOption) (*Empty, error)
	Leave(ctx context.Context, in *Id, opts ...grpc.CallOption) (*Empty, 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 ChatServer

type ChatServer interface {
	Broadcast(context.Context, *Message) (*Empty, error)
	Join(*User, Chat_JoinServer) error
	Publish(context.Context, *Message) (*Empty, error)
	Leave(context.Context, *Id) (*Empty, error)
	// contains filtered or unexported methods
}

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

type Chat_JoinClient

type Chat_JoinClient interface {
	Recv() (*Message, error)
	grpc.ClientStream
}

type Chat_JoinServer

type Chat_JoinServer interface {
	Send(*Message) error
	grpc.ServerStream
}

type Empty

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

func (*Empty) Descriptor deprecated

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

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

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type Id

type Id struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Lamport uint64 `protobuf:"varint,2,opt,name=lamport,proto3" json:"lamport,omitempty"`
	// contains filtered or unexported fields
}

func (*Id) Descriptor deprecated

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

Deprecated: Use Id.ProtoReflect.Descriptor instead.

func (*Id) GetId

func (x *Id) GetId() string

func (*Id) GetLamport

func (x *Id) GetLamport() uint64

func (*Id) ProtoMessage

func (*Id) ProtoMessage()

func (*Id) ProtoReflect

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

func (*Id) Reset

func (x *Id) Reset()

func (*Id) String

func (x *Id) String() string

type Message

type Message struct {
	Id      string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Text    string `protobuf:"bytes,2,opt,name=text,proto3" json:"text,omitempty"`
	Lamport uint64 `protobuf:"varint,3,opt,name=lamport,proto3" json:"lamport,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetId

func (x *Message) GetId() string

func (*Message) GetLamport

func (x *Message) GetLamport() uint64

func (*Message) GetText

func (x *Message) GetText() string

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

type UnimplementedChatServer

type UnimplementedChatServer struct {
}

UnimplementedChatServer must be embedded to have forward compatible implementations.

func (UnimplementedChatServer) Broadcast

func (UnimplementedChatServer) Join

func (UnimplementedChatServer) Leave

func (UnimplementedChatServer) Publish

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 User

type User struct {
	Id     string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Name   string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Active bool   `protobuf:"varint,3,opt,name=active,proto3" json:"active,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetActive

func (x *User) GetActive() bool

func (*User) GetId

func (x *User) GetId() string

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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