__

package
v0.0.0-...-f1b4dc8 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChatService_ChatInitiate_FullMethodName = "/randomPackage.ChatService/ChatInitiate"
	ChatService_SendMessage_FullMethodName  = "/randomPackage.ChatService/SendMessage"
	ChatService_UserStream_FullMethodName   = "/randomPackage.ChatService/UserStream"
	ChatService_ChatStream_FullMethodName   = "/randomPackage.ChatService/ChatStream"
)

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "UNKOWN",
		1: "ONLINE",
		2: "OFFLINE",
	}
	Status_value = map[string]int32{
		"UNKOWN":  0,
		"ONLINE":  1,
		"OFFLINE": 2,
	}
)

Enum value maps for Status.

View Source
var ChatService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "randomPackage.ChatService",
	HandlerType: (*ChatServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ChatInitiate",
			Handler:    _ChatService_ChatInitiate_Handler,
		},
		{
			MethodName: "SendMessage",
			Handler:    _ChatService_SendMessage_Handler,
		},
		{
			MethodName: "UserStream",
			Handler:    _ChatService_UserStream_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "ChatStream",
			Handler:       _ChatService_ChatStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "random.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_random_proto protoreflect.FileDescriptor

Functions

func RegisterChatServiceServer

func RegisterChatServiceServer(s grpc.ServiceRegistrar, srv ChatServiceServer)

Types

type ChatServiceClient

type ChatServiceClient interface {
	ChatInitiate(ctx context.Context, in *InitiateRequest, opts ...grpc.CallOption) (*InitiateResponse, error)
	SendMessage(ctx context.Context, in *MessageRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UserStream(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (*UserStreamResponse, error)
	ChatStream(ctx context.Context, in *StreamRequest, opts ...grpc.CallOption) (ChatService_ChatStreamClient, 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 {
	ChatInitiate(context.Context, *InitiateRequest) (*InitiateResponse, error)
	SendMessage(context.Context, *MessageRequest) (*emptypb.Empty, error)
	UserStream(context.Context, *StreamRequest) (*UserStreamResponse, error)
	ChatStream(*StreamRequest, ChatService_ChatStreamServer) error
	// contains filtered or unexported methods
}

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

type ChatService_ChatStreamClient

type ChatService_ChatStreamClient interface {
	Recv() (*StreamMessage, error)
	grpc.ClientStream
}

type ChatService_ChatStreamServer

type ChatService_ChatStreamServer interface {
	Send(*StreamMessage) error
	grpc.ServerStream
}

type InitiateRequest

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

func (*InitiateRequest) Descriptor deprecated

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

Deprecated: Use InitiateRequest.ProtoReflect.Descriptor instead.

func (*InitiateRequest) GetAvatarUrl

func (x *InitiateRequest) GetAvatarUrl() string

func (*InitiateRequest) GetName

func (x *InitiateRequest) GetName() string

func (*InitiateRequest) ProtoMessage

func (*InitiateRequest) ProtoMessage()

func (*InitiateRequest) ProtoReflect

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

func (*InitiateRequest) Reset

func (x *InitiateRequest) Reset()

func (*InitiateRequest) String

func (x *InitiateRequest) String() string

type InitiateResponse

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

func (*InitiateResponse) Descriptor deprecated

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

Deprecated: Use InitiateResponse.ProtoReflect.Descriptor instead.

func (*InitiateResponse) GetId

func (x *InitiateResponse) GetId() int32

func (*InitiateResponse) ProtoMessage

func (*InitiateResponse) ProtoMessage()

func (*InitiateResponse) ProtoReflect

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

func (*InitiateResponse) Reset

func (x *InitiateResponse) Reset()

func (*InitiateResponse) String

func (x *InitiateResponse) String() string

type MessageRequest

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

func (*MessageRequest) Descriptor deprecated

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

Deprecated: Use MessageRequest.ProtoReflect.Descriptor instead.

func (*MessageRequest) GetId

func (x *MessageRequest) GetId() int32

func (*MessageRequest) GetMessage

func (x *MessageRequest) GetMessage() string

func (*MessageRequest) ProtoMessage

func (*MessageRequest) ProtoMessage()

func (*MessageRequest) ProtoReflect

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

func (*MessageRequest) Reset

func (x *MessageRequest) Reset()

func (*MessageRequest) String

func (x *MessageRequest) String() string

type Status

type Status int32
const (
	Status_UNKOWN  Status = 0
	Status_ONLINE  Status = 1
	Status_OFFLINE Status = 2
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

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

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type StreamMessage

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

func (*StreamMessage) Descriptor deprecated

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

Deprecated: Use StreamMessage.ProtoReflect.Descriptor instead.

func (*StreamMessage) GetId

func (x *StreamMessage) GetId() int32

func (*StreamMessage) GetMessage

func (x *StreamMessage) GetMessage() string

func (*StreamMessage) ProtoMessage

func (*StreamMessage) ProtoMessage()

func (*StreamMessage) ProtoReflect

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

func (*StreamMessage) Reset

func (x *StreamMessage) Reset()

func (*StreamMessage) String

func (x *StreamMessage) String() string

type StreamRequest

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

func (*StreamRequest) Descriptor deprecated

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

Deprecated: Use StreamRequest.ProtoReflect.Descriptor instead.

func (*StreamRequest) GetId

func (x *StreamRequest) GetId() int32

func (*StreamRequest) ProtoMessage

func (*StreamRequest) ProtoMessage()

func (*StreamRequest) ProtoReflect

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

func (*StreamRequest) Reset

func (x *StreamRequest) Reset()

func (*StreamRequest) String

func (x *StreamRequest) String() string

type UnimplementedChatServiceServer

type UnimplementedChatServiceServer struct {
}

UnimplementedChatServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedChatServiceServer) ChatInitiate

func (UnimplementedChatServiceServer) ChatStream

func (UnimplementedChatServiceServer) SendMessage

func (UnimplementedChatServiceServer) UserStream

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.

type User

type User struct {
	Id        int32  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	Name      string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	Status    string `protobuf:"bytes,3,opt,name=status,proto3" json:"status,omitempty"`
	AvatarURL string `protobuf:"bytes,4,opt,name=avatarURL,proto3" json:"avatarURL,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetAvatarURL

func (x *User) GetAvatarURL() string

func (*User) GetId

func (x *User) GetId() int32

func (*User) GetName

func (x *User) GetName() string

func (*User) GetStatus

func (x *User) GetStatus() 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

type UserStreamResponse

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

func (*UserStreamResponse) Descriptor deprecated

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

Deprecated: Use UserStreamResponse.ProtoReflect.Descriptor instead.

func (*UserStreamResponse) GetUser

func (x *UserStreamResponse) GetUser() []*User

func (*UserStreamResponse) ProtoMessage

func (*UserStreamResponse) ProtoMessage()

func (*UserStreamResponse) ProtoReflect

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

func (*UserStreamResponse) Reset

func (x *UserStreamResponse) Reset()

func (*UserStreamResponse) String

func (x *UserStreamResponse) String() string

Jump to

Keyboard shortcuts

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