Documentation ¶
Index ¶
Constants ¶
View Source
const ( USERS_LIMIT = 30 USERS_TABLENAME = "users" )
View Source
const (
JOKES_TABLENAME = "jokes"
)
View Source
const (
STATES_TABLENAME = "states"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateStateDto ¶
type CreateUserDto ¶
type JokeDb ¶
type JokeDb struct { Id uuid.UUID `db:"id"` Name sql.NullString `db:"name"` Text sql.NullString `db:"text"` Author sql.NullString `db:"author"` Explanation sql.NullString `db:"explanation"` }
type JokeDbDto ¶
func JokeDbToJokeDbDto ¶
type JokeRepository ¶
type Repository ¶
type Repository struct { Conn *sqlx.DB UserRepository UserRepository StateRepository StateRepository JokeRepository JokeRepository }
func (*Repository) Close ¶
func (repo *Repository) Close()
type StateRepository ¶
type StateRepository interface { Add(query CreateStateDto) (uuid.UUID, error) Remove(interface{}) Edit(interface{}) GetList(interface{}) }
type UserDb ¶
type UserDb struct { Id uuid.UUID `db:"id"` Name sql.NullString `db:"name"` Login sql.NullString `db:"login"` ChatId types.ChatId `db:"chat_id"` StateId uuid.UUID `db:"state_id"` State StateDbDto `db:"state"` }
type UserDbDto ¶
type UserDbDto struct { Id uuid.UUID Name string Login string ChatId types.ChatId StateId uuid.UUID State StateDbDto }
func UserDbToUserDbDto ¶
type UserListQuery ¶
type UserListQuery struct { Pagination utils.QueryPagination Name string State string }
type UserRepository ¶
type UserRepository interface { Add(query CreateUserDto) (uuid.UUID, error) Remove(interface{}) Edit(interface{}) GetList(query UserListQuery) UsersDbMetaDto GetOne(query UserQuery) (UserDbDto, error) SetNewStateUUID(userUUID uuid.UUID, stateUUID uuid.UUID) error }
type UsersDbMetaDto ¶
type UsersDbMetaDto struct { Data []UserDbDto Meta utils.Pagination }
Click to show internal directories.
Click to hide internal directories.