pb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AnswerStatus_name = map[int32]string{
		0: "CORRECT",
		1: "INCORRECT",
		2: "REJECTED",
	}
	AnswerStatus_value = map[string]int32{
		"CORRECT":   0,
		"INCORRECT": 1,
		"REJECTED":  2,
	}
)

Enum value maps for AnswerStatus.

View Source
var ChatService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "cdab.chat.ChatService",
	HandlerType: (*ChatServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PostMessage",
			Handler:    _ChatService_PostMessage_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ClientConnect",
			Handler:       _ChatService_ClientConnect_Handler,
			ServerStreams: true,
		},
		{
			StreamName:    "Quiz",
			Handler:       _ChatService_Quiz_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "cdab-chat.proto",
}

ChatService_ServiceDesc is the grpc.ServiceDesc for ChatService 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_cdab_chat_proto protoreflect.FileDescriptor
View Source
var File_common_proto protoreflect.FileDescriptor

Functions

func RegisterChatServiceServer

func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)

Types

type Answer

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

func (*Answer) Descriptor deprecated

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

Deprecated: Use Answer.ProtoReflect.Descriptor instead.

func (*Answer) GetAnswer

func (x *Answer) GetAnswer() string

func (*Answer) ProtoMessage

func (*Answer) ProtoMessage()

func (*Answer) ProtoReflect

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

func (*Answer) Reset

func (x *Answer) Reset()

func (*Answer) String

func (x *Answer) String() string

type AnswerStatus

type AnswerStatus int32
const (
	AnswerStatus_CORRECT   AnswerStatus = 0
	AnswerStatus_INCORRECT AnswerStatus = 1
	AnswerStatus_REJECTED  AnswerStatus = 2
)

func (AnswerStatus) Descriptor

func (AnswerStatus) Enum

func (x AnswerStatus) Enum() *AnswerStatus

func (AnswerStatus) EnumDescriptor deprecated

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

Deprecated: Use AnswerStatus.Descriptor instead.

func (AnswerStatus) Number

func (AnswerStatus) String

func (x AnswerStatus) String() string

func (AnswerStatus) Type

type AnswerStatusResponse

type AnswerStatusResponse struct {
	Status AnswerStatus `protobuf:"varint,1,opt,name=status,proto3,enum=cdab.chat.AnswerStatus" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*AnswerStatusResponse) Descriptor deprecated

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

Deprecated: Use AnswerStatusResponse.ProtoReflect.Descriptor instead.

func (*AnswerStatusResponse) GetStatus

func (x *AnswerStatusResponse) GetStatus() AnswerStatus

func (*AnswerStatusResponse) ProtoMessage

func (*AnswerStatusResponse) ProtoMessage()

func (*AnswerStatusResponse) ProtoReflect

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

func (*AnswerStatusResponse) Reset

func (x *AnswerStatusResponse) Reset()

func (*AnswerStatusResponse) String

func (x *AnswerStatusResponse) String() string

type Author

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

func (*Author) Descriptor deprecated

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

Deprecated: Use Author.ProtoReflect.Descriptor instead.

func (*Author) GetName

func (x *Author) GetName() string

func (*Author) ProtoMessage

func (*Author) ProtoMessage()

func (*Author) ProtoReflect

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

func (*Author) Reset

func (x *Author) Reset()

func (*Author) String

func (x *Author) String() string

type ChatMessage

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

func (*ChatMessage) Descriptor deprecated

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

Deprecated: Use ChatMessage.ProtoReflect.Descriptor instead.

func (*ChatMessage) GetMessage

func (x *ChatMessage) GetMessage() 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 ChatServiceClient

type ChatServiceClient interface {
	// *
	// ClientConnect is called when a client connects to the server. It returns a stream of messages
	ClientConnect(ctx context.Context, in *ConnectionRequest, opts ...grpc.CallOption) (ChatService_ClientConnectClient, error)
	// *
	// PostMessage is used for broadcasting a message in a chat-room.
	// It returns the Id of the message
	PostMessage(ctx context.Context, in *PostMessageRequest, opts ...grpc.CallOption) (*PostMessageResponse, error)
	// *
	// Quiz is a bidirectional stream for handling quiz requests. It sends new  questions and
	// the result of an answer. It listens to answers from the client.
	Quiz(ctx context.Context, opts ...grpc.CallOption) (ChatService_QuizClient, error)
}

ChatServiceClient is the client API for ChatService 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 ChatServiceServer

type ChatServiceServer interface {
	// *
	// ClientConnect is called when a client connects to the server. It returns a stream of messages
	ClientConnect(*ConnectionRequest, ChatService_ClientConnectServer) error
	// *
	// PostMessage is used for broadcasting a message in a chat-room.
	// It returns the Id of the message
	PostMessage(context.Context, *PostMessageRequest) (*PostMessageResponse, error)
	// *
	// Quiz is a bidirectional stream for handling quiz requests. It sends new  questions and
	// the result of an answer. It listens to answers from the client.
	Quiz(ChatService_QuizServer) error
	// contains filtered or unexported methods
}

ChatServiceServer is the server API for ChatService service. All implementations must embed UnimplementedChatServiceServer for forward compatibility

type ChatService_ClientConnectClient

type ChatService_ClientConnectClient interface {
	Recv() (*ConnectionResponse, error)
	grpc.ClientStream
}

type ChatService_ClientConnectServer

type ChatService_ClientConnectServer interface {
	Send(*ConnectionResponse) error
	grpc.ServerStream
}

type ChatService_QuizClient

type ChatService_QuizClient interface {
	Send(*QuizRequest) error
	Recv() (*QuizResponse, error)
	grpc.ClientStream
}

type ChatService_QuizServer

type ChatService_QuizServer interface {
	Send(*QuizResponse) error
	Recv() (*QuizRequest, error)
	grpc.ServerStream
}

type ConnectionRequest

type ConnectionRequest struct {

	// The name of the chat-room.
	Room string `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"`
	// contains filtered or unexported fields
}

Requests a connection to a chat room.

func (*ConnectionRequest) Descriptor deprecated

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

Deprecated: Use ConnectionRequest.ProtoReflect.Descriptor instead.

func (*ConnectionRequest) GetRoom

func (x *ConnectionRequest) GetRoom() string

func (*ConnectionRequest) ProtoMessage

func (*ConnectionRequest) ProtoMessage()

func (*ConnectionRequest) ProtoReflect

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

func (*ConnectionRequest) Reset

func (x *ConnectionRequest) Reset()

func (*ConnectionRequest) String

func (x *ConnectionRequest) String() string

type ConnectionResponse

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

Response to a connection request.

func (*ConnectionResponse) Descriptor deprecated

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

Deprecated: Use ConnectionResponse.ProtoReflect.Descriptor instead.

func (*ConnectionResponse) GetMessage

func (x *ConnectionResponse) GetMessage() *IncomingChatMessage

func (*ConnectionResponse) ProtoMessage

func (*ConnectionResponse) ProtoMessage()

func (*ConnectionResponse) ProtoReflect

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

func (*ConnectionResponse) Reset

func (x *ConnectionResponse) Reset()

func (*ConnectionResponse) String

func (x *ConnectionResponse) String() string

type IncomingChatMessage

type IncomingChatMessage struct {
	Id         string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Timestamp  uint64       `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	Message    *ChatMessage `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	FromAuthor *Author      `protobuf:"bytes,4,opt,name=fromAuthor,proto3" json:"fromAuthor,omitempty"`
	// contains filtered or unexported fields
}

func (*IncomingChatMessage) Descriptor deprecated

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

Deprecated: Use IncomingChatMessage.ProtoReflect.Descriptor instead.

func (*IncomingChatMessage) GetFromAuthor

func (x *IncomingChatMessage) GetFromAuthor() *Author

func (*IncomingChatMessage) GetId

func (x *IncomingChatMessage) GetId() string

func (*IncomingChatMessage) GetMessage

func (x *IncomingChatMessage) GetMessage() *ChatMessage

func (*IncomingChatMessage) GetTimestamp

func (x *IncomingChatMessage) GetTimestamp() uint64

func (*IncomingChatMessage) ProtoMessage

func (*IncomingChatMessage) ProtoMessage()

func (*IncomingChatMessage) ProtoReflect

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

func (*IncomingChatMessage) Reset

func (x *IncomingChatMessage) Reset()

func (*IncomingChatMessage) String

func (x *IncomingChatMessage) String() string

type PostMessageRequest

type PostMessageRequest struct {
	Room    string       `protobuf:"bytes,1,opt,name=room,proto3" json:"room,omitempty"`
	Author  *Author      `protobuf:"bytes,2,opt,name=author,proto3" json:"author,omitempty"`
	Message *ChatMessage `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*PostMessageRequest) Descriptor deprecated

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

Deprecated: Use PostMessageRequest.ProtoReflect.Descriptor instead.

func (*PostMessageRequest) GetAuthor

func (x *PostMessageRequest) GetAuthor() *Author

func (*PostMessageRequest) GetMessage

func (x *PostMessageRequest) GetMessage() *ChatMessage

func (*PostMessageRequest) GetRoom

func (x *PostMessageRequest) GetRoom() string

func (*PostMessageRequest) ProtoMessage

func (*PostMessageRequest) ProtoMessage()

func (*PostMessageRequest) ProtoReflect

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

func (*PostMessageRequest) Reset

func (x *PostMessageRequest) Reset()

func (*PostMessageRequest) String

func (x *PostMessageRequest) String() string

type PostMessageResponse

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

func (*PostMessageResponse) Descriptor deprecated

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

Deprecated: Use PostMessageResponse.ProtoReflect.Descriptor instead.

func (*PostMessageResponse) GetId

func (x *PostMessageResponse) GetId() string

func (*PostMessageResponse) ProtoMessage

func (*PostMessageResponse) ProtoMessage()

func (*PostMessageResponse) ProtoReflect

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

func (*PostMessageResponse) Reset

func (x *PostMessageResponse) Reset()

func (*PostMessageResponse) String

func (x *PostMessageResponse) String() string

type Question

type Question struct {
	Text    string   `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
	Answers []string `protobuf:"bytes,2,rep,name=answers,proto3" json:"answers,omitempty"`
	// contains filtered or unexported fields
}

func (*Question) Descriptor deprecated

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

Deprecated: Use Question.ProtoReflect.Descriptor instead.

func (*Question) GetAnswers

func (x *Question) GetAnswers() []string

func (*Question) GetText

func (x *Question) GetText() string

func (*Question) ProtoMessage

func (*Question) ProtoMessage()

func (*Question) ProtoReflect

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

func (*Question) Reset

func (x *Question) Reset()

func (*Question) String

func (x *Question) String() string

type QuizRequest

type QuizRequest struct {
	Author *Author `protobuf:"bytes,1,opt,name=author,proto3" json:"author,omitempty"`
	Answer *Answer `protobuf:"bytes,2,opt,name=answer,proto3" json:"answer,omitempty"`
	// contains filtered or unexported fields
}

func (*QuizRequest) Descriptor deprecated

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

Deprecated: Use QuizRequest.ProtoReflect.Descriptor instead.

func (*QuizRequest) GetAnswer

func (x *QuizRequest) GetAnswer() *Answer

func (*QuizRequest) GetAuthor

func (x *QuizRequest) GetAuthor() *Author

func (*QuizRequest) ProtoMessage

func (*QuizRequest) ProtoMessage()

func (*QuizRequest) ProtoReflect

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

func (*QuizRequest) Reset

func (x *QuizRequest) Reset()

func (*QuizRequest) String

func (x *QuizRequest) String() string

type QuizResponse

type QuizResponse struct {

	// Types that are assignable to Response:
	//
	//	*QuizResponse_Question
	//	*QuizResponse_Status
	Response isQuizResponse_Response `protobuf_oneof:"response"`
	// contains filtered or unexported fields
}

func (*QuizResponse) Descriptor deprecated

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

Deprecated: Use QuizResponse.ProtoReflect.Descriptor instead.

func (*QuizResponse) GetQuestion

func (x *QuizResponse) GetQuestion() *Question

func (*QuizResponse) GetResponse

func (m *QuizResponse) GetResponse() isQuizResponse_Response

func (*QuizResponse) GetStatus

func (x *QuizResponse) GetStatus() *AnswerStatusResponse

func (*QuizResponse) ProtoMessage

func (*QuizResponse) ProtoMessage()

func (*QuizResponse) ProtoReflect

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

func (*QuizResponse) Reset

func (x *QuizResponse) Reset()

func (*QuizResponse) String

func (x *QuizResponse) String() string

type QuizResponse_Question

type QuizResponse_Question struct {
	Question *Question `protobuf:"bytes,1,opt,name=question,proto3,oneof"`
}

type QuizResponse_Status

type QuizResponse_Status struct {
	Status *AnswerStatusResponse `protobuf:"bytes,2,opt,name=status,proto3,oneof"`
}

type UnimplementedChatServiceServer

type UnimplementedChatServiceServer struct {
}

UnimplementedChatServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedChatServiceServer) ClientConnect

func (UnimplementedChatServiceServer) PostMessage

func (UnimplementedChatServiceServer) Quiz

type UnsafeChatServiceServer

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

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

Jump to

Keyboard shortcuts

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