Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrChatNameIsEmpty modelError = "'name' can't be empty" ErrChatNameIsNull modelError = "'name' can't be null" ErrChatUserIsNull modelError = "'user' can't be null" ErrChatUsersIsNull modelError = "'users' can't be null" ErrChatUsersIsEmpty modelError = "'users' can't be empty" ErrChatUsersIDsAreNull modelError = "'users' can't contain null(s)" ErrChatAlreadyExists modelError = "The chat with this name already exists" ErrChatSomeUsersDontExist modelError = "Some users don't exist" )
View Source
const ( ErrNoSuchEndpointExists modelError = "No such endpoint exists" ErrNoSuchHTTPMethod modelError = "Wrong http method" )
View Source
const ( ErrMessageChatDoesntExist modelError = "The chat with the provided id doesn't exist" ErrMessageUserDoesntExist modelError = "The user with the provided id doesn't exist" ErrMessageUserIsNotInChat modelError = "The user is not in the chat" ErrMessageChatIsNull modelError = "'chat' can't be null" ErrMessageAuthorIsNull modelError = "'author' can't be null" ErrMessageTextIsNull modelError = "'text' can't be null" ErrMessageTextIsEmpty modelError = "'text' can't be empty" )
View Source
const ( ErrUserNameIsEmpty modelError = "'username' can't be empty" ErrUserNameIsNull modelError = "'username' can't be null" ErrUserAlreadyExists modelError = "User with this name already exists" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChatQueryParams ¶
type ChatService ¶
type ChatService interface { ChatDB }
func NewChatService ¶
func NewChatService(db *gorm.DB) ChatService
type MessageService ¶
type MessageService interface { MessageDB }
func NewMessageService ¶
func NewMessageService(db *gorm.DB) MessageService
type Services ¶
type Services struct { User UserService Chat ChatService Message MessageService // contains filtered or unexported fields }
func NewServices ¶
func NewServices(cfgs ...ServicesConfig) (*Services, error)
func (*Services) CloseStorage ¶
func (s *Services) CloseStorage()
type ServicesConfig ¶
func WithChat ¶
func WithChat() ServicesConfig
func WithGorm ¶
func WithGorm(dialect, connectionInfo string, num int, interval uint) ServicesConfig
func WithLogMode ¶
func WithLogMode(mode bool) ServicesConfig
func WithMessage ¶
func WithMessage() ServicesConfig
func WithSetSchema ¶
func WithSetSchema(mode bool) ServicesConfig
func WithUser ¶
func WithUser() ServicesConfig
type UserService ¶
type UserService interface { UserDB }
func NewUserService ¶
func NewUserService(db *gorm.DB) UserService
Click to show internal directories.
Click to hide internal directories.