chat

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_proto_chat_proto protoreflect.FileDescriptor

Functions

func NewChatEndpoints

func NewChatEndpoints() []*api.Endpoint

func RegisterChatHandler

func RegisterChatHandler(s server.Server, hdlr ChatHandler, opts ...server.HandlerOption) error

Types

type ChatService

func NewChatService

func NewChatService(name string, c client.Client) ChatService

type Chat_JoinService

type Chat_JoinService interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Recv() (*JoinResponse, error)
}

type Chat_JoinStream

type Chat_JoinStream interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*JoinResponse) error
}

type CreateRequest

type CreateRequest struct {

	// name of the group
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// chat description
	Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"`
	// optional list of user ids
	UserIds []string `protobuf:"bytes,3,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"`
	// whether its a private group
	Private bool `protobuf:"varint,4,opt,name=private,proto3" json:"private,omitempty"`
	// contains filtered or unexported fields
}

Create a new chat group

func (*CreateRequest) Descriptor deprecated

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

Deprecated: Use CreateRequest.ProtoReflect.Descriptor instead.

func (*CreateRequest) GetDescription

func (x *CreateRequest) GetDescription() string

func (*CreateRequest) GetName

func (x *CreateRequest) GetName() string

func (*CreateRequest) GetPrivate

func (x *CreateRequest) GetPrivate() bool

func (*CreateRequest) GetUserIds

func (x *CreateRequest) GetUserIds() []string

func (*CreateRequest) ProtoMessage

func (*CreateRequest) ProtoMessage()

func (*CreateRequest) ProtoReflect

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

func (*CreateRequest) Reset

func (x *CreateRequest) Reset()

func (*CreateRequest) String

func (x *CreateRequest) String() string

type CreateResponse

type CreateResponse struct {

	// the unique chat group
	Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateResponse) Descriptor deprecated

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

Deprecated: Use CreateResponse.ProtoReflect.Descriptor instead.

func (*CreateResponse) GetGroup added in v1.1.0

func (x *CreateResponse) GetGroup() *Group

func (*CreateResponse) ProtoMessage

func (*CreateResponse) ProtoMessage()

func (*CreateResponse) ProtoReflect

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

func (*CreateResponse) Reset

func (x *CreateResponse) Reset()

func (*CreateResponse) String

func (x *CreateResponse) String() string

type DeleteRequest

type DeleteRequest struct {

	// the chat group id to delete
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

Delete a chat group

func (*DeleteRequest) Descriptor deprecated

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

Deprecated: Use DeleteRequest.ProtoReflect.Descriptor instead.

func (*DeleteRequest) GetGroupId added in v1.1.0

func (x *DeleteRequest) GetGroupId() string

func (*DeleteRequest) ProtoMessage

func (*DeleteRequest) ProtoMessage()

func (*DeleteRequest) ProtoReflect

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

func (*DeleteRequest) Reset

func (x *DeleteRequest) Reset()

func (*DeleteRequest) String

func (x *DeleteRequest) String() string

type DeleteResponse

type DeleteResponse struct {
	Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*DeleteResponse) Descriptor deprecated

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

Deprecated: Use DeleteResponse.ProtoReflect.Descriptor instead.

func (*DeleteResponse) GetGroup added in v1.1.0

func (x *DeleteResponse) GetGroup() *Group

func (*DeleteResponse) ProtoMessage

func (*DeleteResponse) ProtoMessage()

func (*DeleteResponse) ProtoReflect

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

func (*DeleteResponse) Reset

func (x *DeleteResponse) Reset()

func (*DeleteResponse) String

func (x *DeleteResponse) String() string

type Group added in v1.1.0

type Group struct {

	// unique group id
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// name of the chat
	Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
	// description of the that
	Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
	// time of creation
	CreatedAt string `protobuf:"bytes,4,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
	// list of users
	UserIds []string `protobuf:"bytes,5,rep,name=user_ids,json=userIds,proto3" json:"user_ids,omitempty"`
	// whether its a private group
	Private bool `protobuf:"varint,6,opt,name=private,proto3" json:"private,omitempty"`
	// contains filtered or unexported fields
}

func (*Group) Descriptor deprecated added in v1.1.0

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

Deprecated: Use Group.ProtoReflect.Descriptor instead.

func (*Group) GetCreatedAt added in v1.1.0

func (x *Group) GetCreatedAt() string

func (*Group) GetDescription added in v1.1.0

func (x *Group) GetDescription() string

func (*Group) GetId added in v1.1.0

func (x *Group) GetId() string

func (*Group) GetName added in v1.1.0

func (x *Group) GetName() string

func (*Group) GetPrivate added in v1.1.0

func (x *Group) GetPrivate() bool

func (*Group) GetUserIds added in v1.1.0

func (x *Group) GetUserIds() []string

func (*Group) ProtoMessage added in v1.1.0

func (*Group) ProtoMessage()

func (*Group) ProtoReflect added in v1.1.0

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

func (*Group) Reset added in v1.1.0

func (x *Group) Reset()

func (*Group) String added in v1.1.0

func (x *Group) String() string

type HistoryRequest

type HistoryRequest struct {

	// the chat group id to get
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// contains filtered or unexported fields
}

List the messages in a chat

func (*HistoryRequest) Descriptor deprecated

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

Deprecated: Use HistoryRequest.ProtoReflect.Descriptor instead.

func (*HistoryRequest) GetGroupId added in v1.1.0

func (x *HistoryRequest) GetGroupId() string

func (*HistoryRequest) ProtoMessage

func (*HistoryRequest) ProtoMessage()

func (*HistoryRequest) ProtoReflect

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

func (*HistoryRequest) Reset

func (x *HistoryRequest) Reset()

func (*HistoryRequest) String

func (x *HistoryRequest) String() string

type HistoryResponse

type HistoryResponse struct {

	// messages in the chat group
	Messages []*Message `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
	// contains filtered or unexported fields
}

HistoryResponse contains the historical messages in a chat

func (*HistoryResponse) Descriptor deprecated

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

Deprecated: Use HistoryResponse.ProtoReflect.Descriptor instead.

func (*HistoryResponse) GetMessages

func (x *HistoryResponse) GetMessages() []*Message

func (*HistoryResponse) ProtoMessage

func (*HistoryResponse) ProtoMessage()

func (*HistoryResponse) ProtoReflect

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

func (*HistoryResponse) Reset

func (x *HistoryResponse) Reset()

func (*HistoryResponse) String

func (x *HistoryResponse) String() string

type InviteRequest

type InviteRequest struct {

	// the group id
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// the user id
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Invite a user to a chat group

func (*InviteRequest) Descriptor deprecated

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

Deprecated: Use InviteRequest.ProtoReflect.Descriptor instead.

func (*InviteRequest) GetGroupId added in v1.1.0

func (x *InviteRequest) GetGroupId() string

func (*InviteRequest) GetUserId

func (x *InviteRequest) GetUserId() string

func (*InviteRequest) ProtoMessage

func (*InviteRequest) ProtoMessage()

func (*InviteRequest) ProtoReflect

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

func (*InviteRequest) Reset

func (x *InviteRequest) Reset()

func (*InviteRequest) String

func (x *InviteRequest) String() string

type InviteResponse

type InviteResponse struct {
	Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*InviteResponse) Descriptor deprecated

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

Deprecated: Use InviteResponse.ProtoReflect.Descriptor instead.

func (*InviteResponse) GetGroup added in v1.1.0

func (x *InviteResponse) GetGroup() *Group

func (*InviteResponse) ProtoMessage

func (*InviteResponse) ProtoMessage()

func (*InviteResponse) ProtoReflect

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

func (*InviteResponse) Reset

func (x *InviteResponse) Reset()

func (*InviteResponse) String

func (x *InviteResponse) String() string

type JoinRequest

type JoinRequest struct {

	// chat group to join
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// user id joining
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Join a chat group

func (*JoinRequest) Descriptor deprecated

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

Deprecated: Use JoinRequest.ProtoReflect.Descriptor instead.

func (*JoinRequest) GetGroupId added in v1.1.0

func (x *JoinRequest) GetGroupId() string

func (*JoinRequest) GetUserId

func (x *JoinRequest) GetUserId() string

func (*JoinRequest) ProtoMessage

func (*JoinRequest) ProtoMessage()

func (*JoinRequest) ProtoReflect

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

func (*JoinRequest) Reset

func (x *JoinRequest) Reset()

func (*JoinRequest) String

func (x *JoinRequest) String() string

type JoinResponse

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

func (*JoinResponse) Descriptor deprecated

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

Deprecated: Use JoinResponse.ProtoReflect.Descriptor instead.

func (*JoinResponse) GetMessage

func (x *JoinResponse) GetMessage() *Message

func (*JoinResponse) ProtoMessage

func (*JoinResponse) ProtoMessage()

func (*JoinResponse) ProtoReflect

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

func (*JoinResponse) Reset

func (x *JoinResponse) Reset()

func (*JoinResponse) String

func (x *JoinResponse) String() string

type KickRequest

type KickRequest struct {

	// the chat group id
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// the user id
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Kick a user from a chat group

func (*KickRequest) Descriptor deprecated

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

Deprecated: Use KickRequest.ProtoReflect.Descriptor instead.

func (*KickRequest) GetGroupId added in v1.1.0

func (x *KickRequest) GetGroupId() string

func (*KickRequest) GetUserId

func (x *KickRequest) GetUserId() string

func (*KickRequest) ProtoMessage

func (*KickRequest) ProtoMessage()

func (*KickRequest) ProtoReflect

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

func (*KickRequest) Reset

func (x *KickRequest) Reset()

func (*KickRequest) String

func (x *KickRequest) String() string

type KickResponse

type KickResponse struct {
	Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*KickResponse) Descriptor deprecated

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

Deprecated: Use KickResponse.ProtoReflect.Descriptor instead.

func (*KickResponse) GetGroup added in v1.1.0

func (x *KickResponse) GetGroup() *Group

func (*KickResponse) ProtoMessage

func (*KickResponse) ProtoMessage()

func (*KickResponse) ProtoReflect

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

func (*KickResponse) Reset

func (x *KickResponse) Reset()

func (*KickResponse) String

func (x *KickResponse) String() string

type LeaveRequest

type LeaveRequest struct {

	// the chat group id
	GroupId string `protobuf:"bytes,1,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// the user id
	UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

Leave a chat group

func (*LeaveRequest) Descriptor deprecated

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

Deprecated: Use LeaveRequest.ProtoReflect.Descriptor instead.

func (*LeaveRequest) GetGroupId added in v1.1.0

func (x *LeaveRequest) GetGroupId() string

func (*LeaveRequest) GetUserId

func (x *LeaveRequest) GetUserId() string

func (*LeaveRequest) ProtoMessage

func (*LeaveRequest) ProtoMessage()

func (*LeaveRequest) ProtoReflect

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

func (*LeaveRequest) Reset

func (x *LeaveRequest) Reset()

func (*LeaveRequest) String

func (x *LeaveRequest) String() string

type LeaveResponse

type LeaveResponse struct {
	Group *Group `protobuf:"bytes,1,opt,name=group,proto3" json:"group,omitempty"`
	// contains filtered or unexported fields
}

func (*LeaveResponse) Descriptor deprecated

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

Deprecated: Use LeaveResponse.ProtoReflect.Descriptor instead.

func (*LeaveResponse) GetGroup added in v1.1.0

func (x *LeaveResponse) GetGroup() *Group

func (*LeaveResponse) ProtoMessage

func (*LeaveResponse) ProtoMessage()

func (*LeaveResponse) ProtoReflect

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

func (*LeaveResponse) Reset

func (x *LeaveResponse) Reset()

func (*LeaveResponse) String

func (x *LeaveResponse) String() string

type ListRequest

type ListRequest struct {

	// optional user id to filter by
	UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// contains filtered or unexported fields
}

List available chats

func (*ListRequest) Descriptor deprecated

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

Deprecated: Use ListRequest.ProtoReflect.Descriptor instead.

func (*ListRequest) GetUserId

func (x *ListRequest) GetUserId() string

func (*ListRequest) ProtoMessage

func (*ListRequest) ProtoMessage()

func (*ListRequest) ProtoReflect

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

func (*ListRequest) Reset

func (x *ListRequest) Reset()

func (*ListRequest) String

func (x *ListRequest) String() string

type ListResponse

type ListResponse struct {
	Groups []*Group `protobuf:"bytes,1,rep,name=groups,proto3" json:"groups,omitempty"`
	// contains filtered or unexported fields
}

func (*ListResponse) Descriptor deprecated

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

Deprecated: Use ListResponse.ProtoReflect.Descriptor instead.

func (*ListResponse) GetGroups added in v1.1.0

func (x *ListResponse) GetGroups() []*Group

func (*ListResponse) ProtoMessage

func (*ListResponse) ProtoMessage()

func (*ListResponse) ProtoReflect

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

func (*ListResponse) Reset

func (x *ListResponse) Reset()

func (*ListResponse) String

func (x *ListResponse) String() string

type Message

type Message struct {

	// id of the message, allocated by the server
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// a client side id, should be validated by the server to make the request retry safe
	Client string `protobuf:"bytes,2,opt,name=client,proto3" json:"client,omitempty"`
	// id of the chat the message is being sent to / from
	GroupId string `protobuf:"bytes,3,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// id of the user who sent the message
	UserId string `protobuf:"bytes,4,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// time the message was sent in RFC3339 format
	SentAt string `protobuf:"bytes,5,opt,name=sent_at,json=sentAt,proto3" json:"sent_at,omitempty"`
	// subject of the message
	Subject string `protobuf:"bytes,6,opt,name=subject,proto3" json:"subject,omitempty"`
	// text of the message
	Text string `protobuf:"bytes,7,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Message sent to a chat

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetClient

func (x *Message) GetClient() string

func (*Message) GetGroupId added in v1.1.0

func (x *Message) GetGroupId() string

func (*Message) GetId

func (x *Message) GetId() string

func (*Message) GetSentAt

func (x *Message) GetSentAt() string

func (*Message) GetSubject

func (x *Message) GetSubject() string

func (*Message) GetText

func (x *Message) GetText() string

func (*Message) GetUserId

func (x *Message) GetUserId() 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 SendRequest

type SendRequest struct {

	// a client side id, should be validated by the server to make the request retry safe
	Client string `protobuf:"bytes,1,opt,name=client,proto3" json:"client,omitempty"`
	// id of the chat group the message is being sent to / from
	GroupId string `protobuf:"bytes,2,opt,name=group_id,json=groupId,proto3" json:"group_id,omitempty"`
	// id of the user who sent the message
	UserId string `protobuf:"bytes,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	// subject of the message
	Subject string `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
	// text of the message
	Text string `protobuf:"bytes,5,opt,name=text,proto3" json:"text,omitempty"`
	// contains filtered or unexported fields
}

Connect to a chat to receive a stream of messages Send a message to a chat

func (*SendRequest) Descriptor deprecated

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

Deprecated: Use SendRequest.ProtoReflect.Descriptor instead.

func (*SendRequest) GetClient

func (x *SendRequest) GetClient() string

func (*SendRequest) GetGroupId added in v1.1.0

func (x *SendRequest) GetGroupId() string

func (*SendRequest) GetSubject

func (x *SendRequest) GetSubject() string

func (*SendRequest) GetText

func (x *SendRequest) GetText() string

func (*SendRequest) GetUserId

func (x *SendRequest) GetUserId() string

func (*SendRequest) ProtoMessage

func (*SendRequest) ProtoMessage()

func (*SendRequest) ProtoReflect

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

func (*SendRequest) Reset

func (x *SendRequest) Reset()

func (*SendRequest) String

func (x *SendRequest) String() string

type SendResponse

type SendResponse struct {

	// the message which was created
	Message *Message `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*SendResponse) Descriptor deprecated

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

Deprecated: Use SendResponse.ProtoReflect.Descriptor instead.

func (*SendResponse) GetMessage

func (x *SendResponse) GetMessage() *Message

func (*SendResponse) ProtoMessage

func (*SendResponse) ProtoMessage()

func (*SendResponse) ProtoReflect

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

func (*SendResponse) Reset

func (x *SendResponse) Reset()

func (*SendResponse) String

func (x *SendResponse) String() string

Jump to

Keyboard shortcuts

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