Documentation
¶
Index ¶
- func InitRoute(r fiber.Router)
- type Scope
- type ScopeStruct
- type Token
- type User
- type UserRepository
- type UserRepositoryDB
- func (d UserRepositoryDB) CreateToken(token Token) *exception.AppError
- func (d UserRepositoryDB) DeleteTokenById(id, userId string) *exception.AppError
- func (d UserRepositoryDB) FindTokenById(id string) (Token, *exception.AppError)
- func (d UserRepositoryDB) FindUserByUsername(username string) (User, *exception.AppError)
- func (d UserRepositoryDB) UpdateUser(user User) *exception.AppError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ScopeStruct ¶
type ScopeStruct []Scope
func (*ScopeStruct) Scan ¶
func (sla *ScopeStruct) Scan(value interface{}) error
type Token ¶
type Token struct {
Id string `gorm:"primaryKey" json:"id"`
Name string `json:"name"`
UserId string `gorm:"index" json:"-"`
Scope ScopeStruct `gorm:"type:longtext" json:"scope"`
CreatedAt int64 `json:"created_at"`
}
type User ¶
type User struct {
Id string `gorm:"primaryKey" json:"id"`
Username string `gorm:"index" json:"username"`
Password string `json:"password,omitempty"`
Email string `json:"email"`
Avatar string `json:"avatar" gorm:"default:''"`
DarkMode string `json:"dark_mode" gorm:"default:'auto'"`
Tokens []Token `json:"tokens" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"`
}
type UserRepository ¶
type UserRepositoryDB ¶
type UserRepositoryDB struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository() UserRepositoryDB
func (UserRepositoryDB) CreateToken ¶
func (d UserRepositoryDB) CreateToken(token Token) *exception.AppError
func (UserRepositoryDB) DeleteTokenById ¶
func (d UserRepositoryDB) DeleteTokenById(id, userId string) *exception.AppError
func (UserRepositoryDB) FindTokenById ¶
func (d UserRepositoryDB) FindTokenById(id string) (Token, *exception.AppError)
func (UserRepositoryDB) FindUserByUsername ¶
func (d UserRepositoryDB) FindUserByUsername(username string) (User, *exception.AppError)
func (UserRepositoryDB) UpdateUser ¶
func (d UserRepositoryDB) UpdateUser(user User) *exception.AppError
Click to show internal directories.
Click to hide internal directories.