Documentation ¶
Index ¶
- type ChannelController
- func (cc *ChannelController) GetAllChannels(ctx context.Context) []entity.Channel
- func (cc *ChannelController) GetChannelID(ctx context.Context, name string) (string, error)
- func (cc *ChannelController) GetUserChannels(ctx context.Context, userID string) ([]entity.UserChannel, error)
- func (cc *ChannelController) SetUserChannels(ctx context.Context, userID string, chans []entity.Channel) error
- type MessageController
- type UserController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelController ¶
type ChannelController struct {
// contains filtered or unexported fields
}
ChannelController is the controller for channels
func NewChannelController ¶
func NewChannelController(db *client.DBClient) *ChannelController
NewChannelController creates a new ChannelController
func (*ChannelController) GetAllChannels ¶
func (cc *ChannelController) GetAllChannels(ctx context.Context) []entity.Channel
GetAllChannels returns all channels, both enabled and disabled
func (*ChannelController) GetChannelID ¶
GetChannelID returns the channel ID given a channel name
func (*ChannelController) GetUserChannels ¶
func (cc *ChannelController) GetUserChannels(ctx context.Context, userID string) ([]entity.UserChannel, error)
GetUserChannels returns the user channels
func (*ChannelController) SetUserChannels ¶
func (cc *ChannelController) SetUserChannels(ctx context.Context, userID string, chans []entity.Channel) error
SetUserChannels adds or updates the user channel
type MessageController ¶
type MessageController struct {
// contains filtered or unexported fields
}
MessageController is the controller for messages
func NewMessageController ¶
func NewMessageController(db *client.DBClient) *MessageController
NewMessageController creates a new MessageController
func (*MessageController) AddMessage ¶
AddMessage adds a message to the database
func (*MessageController) SetMessageStatus ¶
func (mc *MessageController) SetMessageStatus(ctx context.Context, messageID string, status int) error
SetMessageStatus updates the state of a message
type UserController ¶
type UserController struct {
// contains filtered or unexported fields
}
UserController is the controller for users
func NewUserController ¶
func NewUserController(db *client.DBClient) *UserController
NewUserController creates a new UserController
func (*UserController) GetProfiles ¶
func (uc *UserController) GetProfiles(ctx context.Context, topicID string) ([]entity.Profile, error)
GetProfiles returns a list of profiles subscribed to a given topic