Documentation
¶
Index ¶
- func ParseStringUint(s string) (uint, error)
- type GormRole
- type GormRoleRepository
- func (r *GormRoleRepository) Create(ctx context.Context, role core.Role) (*core.Role, error)
- func (r *GormRoleRepository) Delete(ctx context.Context, id string) error
- func (r *GormRoleRepository) GetByID(ctx context.Context, id string) (*core.Role, error)
- func (r *GormRoleRepository) GetByName(ctx context.Context, name string) (*core.Role, error)
- func (r *GormRoleRepository) List(ctx context.Context) ([]core.Role, error)
- func (r *GormRoleRepository) Update(ctx context.Context, role core.Role) (*core.Role, error)
- type GormUser
- type GormUserRepository
- func (r *GormUserRepository) Create(ctx context.Context, user core.User) (*core.User, error)
- func (r *GormUserRepository) Delete(ctx context.Context, id string) error
- func (r *GormUserRepository) GetByEmail(ctx context.Context, email string) (*core.User, error)
- func (r *GormUserRepository) GetByID(ctx context.Context, id string) (*core.User, error)
- func (r *GormUserRepository) GetByUsername(ctx context.Context, username string) (*core.User, error)
- func (r *GormUserRepository) List(ctx context.Context) ([]core.User, error)
- func (r *GormUserRepository) Update(ctx context.Context, user core.User) (*core.User, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseStringUint ¶
ParseStringUint parses a string ID to uint, returns 0 and error if invalid.
Types ¶
type GormRoleRepository ¶
type GormRoleRepository struct {
// contains filtered or unexported fields
}
func NewGormRoleRepository ¶
func NewGormRoleRepository(db *gorm.DB) *GormRoleRepository
func (*GormRoleRepository) Delete ¶
func (r *GormRoleRepository) Delete(ctx context.Context, id string) error
type GormUser ¶
type GormUser struct {
ID uint `gorm:"primaryKey;autoIncrement"`
Username string `gorm:"uniqueIndex;not null"`
Email string `gorm:"uniqueIndex;not null"`
HashedPassword string `gorm:"not null"`
RoleID uint `gorm:"not null"`
Role GormRole `gorm:"foreignKey:RoleID;references:ID"`
LastSeen time.Time `gorm:"not null;default:CURRENT_TIMESTAMP"`
CreatedAt time.Time `gorm:"autoCreateTime"`
UpdatedAt time.Time `gorm:"autoUpdateTime"`
}
type GormUserRepository ¶
type GormUserRepository struct {
// contains filtered or unexported fields
}
func NewGormUserRepository ¶
func NewGormUserRepository(db *gorm.DB) *GormUserRepository
func (*GormUserRepository) Delete ¶
func (r *GormUserRepository) Delete(ctx context.Context, id string) error
func (*GormUserRepository) GetByEmail ¶
func (*GormUserRepository) GetByUsername ¶
Click to show internal directories.
Click to hide internal directories.