controller

package
v0.0.0-...-40ea64e Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

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

func (cc *ChannelController) GetChannelID(ctx context.Context, name string) (string, error)

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

func (mc *MessageController) AddMessage(ctx context.Context, message *entity.Message) error

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

Jump to

Keyboard shortcuts

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