Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateDTO ¶
type CreatedEvent ¶
func NewCreatedEvent ¶
func NewCreatedEvent(ctx context.Context, data User) (*CreatedEvent, error)
type DeletedEvent ¶
func NewDeletedEvent ¶
func NewDeletedEvent(ctx context.Context) (*DeletedEvent, error)
type Repository ¶
type Repository interface { Count(ctx context.Context) (int64, error) GetAll(ctx context.Context) ([]*User, error) GetByEmail(ctx context.Context, email string) (*User, error) GetPaginated(ctx context.Context, limit, offset int, sortBy []string) ([]*User, error) GetByID(ctx context.Context, id uint) (*User, error) Create(ctx context.Context, user *User) error CreateOrUpdate(ctx context.Context, user *User) error Update(ctx context.Context, user *User) error UpdateLastAction(ctx context.Context, id uint) error UpdateLastLogin(ctx context.Context, id uint) error Delete(ctx context.Context, id uint) error }
type UILanguage ¶
type UILanguage string
const ( UILanguageEN UILanguage = "en" UILanguageRU UILanguage = "ru" UILanguageUZ UILanguage = "uz" )
func NewUILanguage ¶
func NewUILanguage(l string) (UILanguage, error)
func (UILanguage) IsValid ¶
func (l UILanguage) IsValid() bool
type UpdateDTO ¶
type UpdatedEvent ¶
func NewUpdatedEvent ¶
func NewUpdatedEvent(ctx context.Context, data User) (*UpdatedEvent, error)
type User ¶
type User struct { ID uint FirstName string `validate:"required"` LastName string `validate:"required"` MiddleName string Password string Email string `validate:"required,email"` AvatarID *uint Avatar *upload.Upload EmployeeID *uint LastIP *string UILanguage UILanguage LastLogin *time.Time LastAction *time.Time CreatedAt time.Time UpdatedAt time.Time Roles []*role.Role }
func (*User) Can ¶
func (u *User) Can(perm permission.Permission) bool
func (*User) CheckPassword ¶
func (*User) SetPassword ¶
Click to show internal directories.
Click to hide internal directories.