Documentation ¶
Index ¶
- Variables
- func NewAuthService(webUserService WebUserService, logger *logger.Logger) *authService
- func NewChannelService(store *store.Store, logger *logger.Logger, messageService MessageService) *channelService
- func NewMessageService(store *store.Store, logger *logger.Logger, replyService ReplyService) *messageService
- func NewReplyService(store *store.Store, logger *logger.Logger) *replyService
- func NewSavedService(store *store.Store, logger *logger.Logger, messageService MessageService) *savedService
- func NewUserService(store *store.Store, logger *logger.Logger, message MessageService) *userService
- func NewWebUserService(store *store.Store, logger *logger.Logger) *webUserService
- type AuthService
- type ChannelService
- type LoadChannelOutput
- type LoadChannelsOutput
- type LoadHomeOutput
- type LoadMessageOutput
- type LoadSavedMessagesOutput
- type LoadUserOutput
- type Manager
- type MessageService
- type ReplyService
- type SavedService
- type UserService
- type WebUserService
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrChannelsNotFound = errors.New("channels not found") ErrChannelNotFound = errors.New("channel not found") ErrChannelExists = errors.New("channel is exist") ErrChannelStatisticNotFound = errors.New("channel statistic not found") )
View Source
var ( ErrMessagesCountNotFound = errors.New("message count not found") ErrMessagesNotFound = errors.New("messages not found") ErrMessageNotFound = errors.New("messages not found") ErrMessageExists = errors.New("message is exist") )
View Source
var ( ErrSavedMessagesNotFound = errors.New("saved messages not found") ErrSavedMessageNotFound = errors.New("saved message not found") )
View Source
var ( ErrIncorrectPassword = errors.New("incorrect password") ErrWebUserIsExist = errors.New("web user is exist") )
View Source
var ErrRepliesNotFound = errors.New("replies not found")
View Source
var ErrUserNotFound = errors.New("user not found")
View Source
var ErrWebUserNotFound = errors.New("web user not found")
Functions ¶
func NewAuthService ¶
func NewAuthService(webUserService WebUserService, logger *logger.Logger) *authService
func NewChannelService ¶
func NewChannelService(store *store.Store, logger *logger.Logger, messageService MessageService) *channelService
func NewMessageService ¶
func NewMessageService(store *store.Store, logger *logger.Logger, replyService ReplyService) *messageService
func NewReplyService ¶
func NewSavedService ¶
func NewSavedService(store *store.Store, logger *logger.Logger, messageService MessageService) *savedService
func NewUserService ¶
func NewUserService(store *store.Store, logger *logger.Logger, message MessageService) *userService
Types ¶
type AuthService ¶
type ChannelService ¶
type ChannelService interface { CreateChannel(channel *model.DBChannel) error GetChannels() ([]model.Channel, error) GetChannelsByPage(page int) ([]model.Channel, error) GetChannelByName(name string) (*model.Channel, error) GetChannelStats(channelID int) (*model.Stat, error) ProcessChannelPage(channelName string, page int) (*LoadChannelOutput, error) ProcessChannelsPage(page int) (*LoadChannelsOutput, error) }
type LoadChannelOutput ¶
type LoadChannelOutput struct { Channel model.Channel Messages []model.FullMessage MessagesCount int }
type LoadChannelsOutput ¶
type LoadHomeOutput ¶
type LoadHomeOutput struct { Messages []model.FullMessage MessagesCount int }
type LoadMessageOutput ¶
type LoadMessageOutput struct {
Message *model.FullMessage
}
type LoadSavedMessagesOutput ¶
type LoadSavedMessagesOutput struct { SavedMessages []model.FullMessage SavedMessagesCount int }
type LoadUserOutput ¶
type LoadUserOutput struct { TgUser *model.User Messages []model.FullMessage MessagesCount int }
type Manager ¶
type Manager struct { Channel ChannelService Message MessageService Reply ReplyService User UserService WebUser WebUserService Saved SavedService Auth AuthService }
type MessageService ¶
type MessageService interface { CreateMessage(message *model.DBMessage) (int, error) GetMessagesCount() (int, error) GetMessagesCountByChannelID(ID int) (int, error) GetFullMessagesByChannelIDAndPage(ID, page int) ([]model.FullMessage, error) GetFullMessagesByUserID(ID int) ([]model.FullMessage, error) GetFullMessageByMessageID(id int) (*model.FullMessage, error) ProcessMessagePage(messageID int) (*LoadMessageOutput, error) ProcessHomePage(page int) (*LoadHomeOutput, error) }
type ReplyService ¶
type SavedService ¶
type UserService ¶
Click to show internal directories.
Click to hide internal directories.