handin_03

package
v0.0.0-...-5d68caa Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ChittyChat_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.ChittyChat",
	HandlerType: (*ChittyChatServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Join",
			Handler:    _ChittyChat_Join_Handler,
		},
		{
			MethodName: "Message",
			Handler:    _ChittyChat_Message_Handler,
		},
		{
			MethodName: "Leave",
			Handler:    _ChittyChat_Leave_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetContentStream",
			Handler:       _ChittyChat_GetContentStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/template.proto",
}

ChittyChat_ServiceDesc is the grpc.ServiceDesc for ChittyChat 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

Functions

func RegisterChittyChatServer

func RegisterChittyChatServer(s grpc.ServiceRegistrar, srv ChittyChatServer)

Types

type Ack

type Ack struct {

	// Message received
	StatusCode int32 `protobuf:"varint,1,opt,name=StatusCode,proto3" json:"StatusCode,omitempty"`
	// contains filtered or unexported fields
}

func (*Ack) Descriptor deprecated

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

Deprecated: Use Ack.ProtoReflect.Descriptor instead.

func (*Ack) GetStatusCode

func (x *Ack) GetStatusCode() int32

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 BasePacket

type BasePacket struct {
	LamportTimeStamp int64 `protobuf:"varint,1,opt,name=LamportTimeStamp,proto3" json:"LamportTimeStamp,omitempty"`
	Id               int64 `protobuf:"varint,2,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*BasePacket) Descriptor deprecated

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

Deprecated: Use BasePacket.ProtoReflect.Descriptor instead.

func (*BasePacket) GetId

func (x *BasePacket) GetId() int64

func (*BasePacket) GetLamportTimeStamp

func (x *BasePacket) GetLamportTimeStamp() int64

func (*BasePacket) ProtoMessage

func (*BasePacket) ProtoMessage()

func (*BasePacket) ProtoReflect

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

func (*BasePacket) Reset

func (x *BasePacket) Reset()

func (*BasePacket) String

func (x *BasePacket) String() string

type ChittyChatClient

type ChittyChatClient interface {
	Join(ctx context.Context, in *JoinPacket, opts ...grpc.CallOption) (*ClientId, error)
	GetContentStream(ctx context.Context, in *BasePacket, opts ...grpc.CallOption) (ChittyChat_GetContentStreamClient, error)
	Message(ctx context.Context, in *Content, opts ...grpc.CallOption) (*Ack, error)
	Leave(ctx context.Context, in *BasePacket, opts ...grpc.CallOption) (*Ack, error)
}

ChittyChatClient is the client API for ChittyChat 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 NewChittyChatClient

func NewChittyChatClient(cc grpc.ClientConnInterface) ChittyChatClient

type ChittyChatServer

type ChittyChatServer interface {
	Join(context.Context, *JoinPacket) (*ClientId, error)
	GetContentStream(*BasePacket, ChittyChat_GetContentStreamServer) error
	Message(context.Context, *Content) (*Ack, error)
	Leave(context.Context, *BasePacket) (*Ack, error)
	// contains filtered or unexported methods
}

ChittyChatServer is the server API for ChittyChat service. All implementations must embed UnimplementedChittyChatServer for forward compatibility

type ChittyChat_GetContentStreamClient

type ChittyChat_GetContentStreamClient interface {
	Recv() (*Content, error)
	grpc.ClientStream
}

type ChittyChat_GetContentStreamServer

type ChittyChat_GetContentStreamServer interface {
	Send(*Content) error
	grpc.ServerStream
}

type ClientId

type ClientId struct {
	Id  int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Ack *Ack  `protobuf:"bytes,2,opt,name=ack,proto3" json:"ack,omitempty"`
	// contains filtered or unexported fields
}

func (*ClientId) Descriptor deprecated

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

Deprecated: Use ClientId.ProtoReflect.Descriptor instead.

func (*ClientId) GetAck

func (x *ClientId) GetAck() *Ack

func (*ClientId) GetId

func (x *ClientId) GetId() int64

func (*ClientId) ProtoMessage

func (*ClientId) ProtoMessage()

func (*ClientId) ProtoReflect

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

func (*ClientId) Reset

func (x *ClientId) Reset()

func (*ClientId) String

func (x *ClientId) String() string

type Content

type Content struct {
	BasePacket  *BasePacket `protobuf:"bytes,1,opt,name=BasePacket,proto3" json:"BasePacket,omitempty"`
	SenderName  string      `protobuf:"bytes,2,opt,name=senderName,proto3" json:"senderName,omitempty"`
	MessageBody string      `protobuf:"bytes,3,opt,name=MessageBody,proto3" json:"MessageBody,omitempty"`
	// contains filtered or unexported fields
}

func (*Content) Descriptor deprecated

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

Deprecated: Use Content.ProtoReflect.Descriptor instead.

func (*Content) GetBasePacket

func (x *Content) GetBasePacket() *BasePacket

func (*Content) GetMessageBody

func (x *Content) GetMessageBody() string

func (*Content) GetSenderName

func (x *Content) GetSenderName() string

func (*Content) ProtoMessage

func (*Content) ProtoMessage()

func (*Content) ProtoReflect

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

func (*Content) Reset

func (x *Content) Reset()

func (*Content) String

func (x *Content) String() string

type JoinPacket

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

func (*JoinPacket) Descriptor deprecated

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

Deprecated: Use JoinPacket.ProtoReflect.Descriptor instead.

func (*JoinPacket) GetClientName

func (x *JoinPacket) GetClientName() string

func (*JoinPacket) ProtoMessage

func (*JoinPacket) ProtoMessage()

func (*JoinPacket) ProtoReflect

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

func (*JoinPacket) Reset

func (x *JoinPacket) Reset()

func (*JoinPacket) String

func (x *JoinPacket) String() string

type UnimplementedChittyChatServer

type UnimplementedChittyChatServer struct {
}

UnimplementedChittyChatServer must be embedded to have forward compatible implementations.

func (UnimplementedChittyChatServer) GetContentStream

func (UnimplementedChittyChatServer) Join

func (UnimplementedChittyChatServer) Leave

func (UnimplementedChittyChatServer) Message

type UnsafeChittyChatServer

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

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

Jump to

Keyboard shortcuts

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