pb

package
v0.0.0-...-93d0a78 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ChatMessageType_name = map[int32]string{
		0: "JOIN",
		1: "SEND",
	}
	ChatMessageType_value = map[string]int32{
		"JOIN": 0,
		"SEND": 1,
	}
)

Enum value maps for ChatMessageType.

View Source
var Chat_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pb.Chat",
	HandlerType: (*ChatServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetRooms",
			Handler:    _Chat_GetRooms_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Chat",
			Handler:       _Chat_Chat_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "pb/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)

View Source
var File_pb_chat_proto protoreflect.FileDescriptor

Functions

func RegisterChatServer

func RegisterChatServer(s grpc.ServiceRegistrar, srv ChatServer)

Types

type ChatClient

type ChatClient interface {
	GetRooms(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*Rooms, error)
	Chat(ctx context.Context, opts ...grpc.CallOption) (Chat_ChatClient, 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 {
	Type     ChatMessageType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.ChatMessageType" json:"type,omitempty"`
	RoomName string          `protobuf:"bytes,2,opt,name=roomName,proto3" json:"roomName,omitempty"`
	UserName string          `protobuf:"bytes,3,opt,name=userName,proto3" json:"userName,omitempty"`
	Text     string          `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

func (*ChatMessage) Descriptor deprecated

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

Deprecated: Use ChatMessage.ProtoReflect.Descriptor instead.

func (*ChatMessage) GetRoomName

func (x *ChatMessage) GetRoomName() string

func (*ChatMessage) GetText

func (x *ChatMessage) GetText() string

func (*ChatMessage) GetType

func (x *ChatMessage) GetType() ChatMessageType

func (*ChatMessage) GetUserName

func (x *ChatMessage) GetUserName() 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 ChatMessageType

type ChatMessageType int32
const (
	ChatMessageType_JOIN ChatMessageType = 0
	ChatMessageType_SEND ChatMessageType = 1
)

func (ChatMessageType) Descriptor

func (ChatMessageType) Enum

func (x ChatMessageType) Enum() *ChatMessageType

func (ChatMessageType) EnumDescriptor deprecated

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

Deprecated: Use ChatMessageType.Descriptor instead.

func (ChatMessageType) Number

func (ChatMessageType) String

func (x ChatMessageType) String() string

func (ChatMessageType) Type

type ChatServer

type ChatServer interface {
	GetRooms(context.Context, *empty.Empty) (*Rooms, error)
	Chat(Chat_ChatServer) error
	// contains filtered or unexported methods
}

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

type Chat_ChatClient

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

type Chat_ChatServer

type Chat_ChatServer interface {
	Send(*ChatMessage) error
	Recv() (*ChatMessage, error)
	grpc.ServerStream
}

type Room

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

func (*Room) Descriptor deprecated

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

Deprecated: Use Room.ProtoReflect.Descriptor instead.

func (*Room) GetName

func (x *Room) GetName() string

func (*Room) ProtoMessage

func (*Room) ProtoMessage()

func (*Room) ProtoReflect

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

func (*Room) Reset

func (x *Room) Reset()

func (*Room) String

func (x *Room) String() string

type Rooms

type Rooms struct {
	Rooms []*Room `protobuf:"bytes,1,rep,name=rooms,proto3" json:"rooms,omitempty"`
	// contains filtered or unexported fields
}

func (*Rooms) Descriptor deprecated

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

Deprecated: Use Rooms.ProtoReflect.Descriptor instead.

func (*Rooms) GetRooms

func (x *Rooms) GetRooms() []*Room

func (*Rooms) ProtoMessage

func (*Rooms) ProtoMessage()

func (*Rooms) ProtoReflect

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

func (*Rooms) Reset

func (x *Rooms) Reset()

func (*Rooms) String

func (x *Rooms) String() string

type UnimplementedChatServer

type UnimplementedChatServer struct {
}

UnimplementedChatServer must be embedded to have forward compatible implementations.

func (UnimplementedChatServer) Chat

func (UnimplementedChatServer) GetRooms

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.

Jump to

Keyboard shortcuts

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