Documentation ¶
Index ¶
- Variables
- type Auth
- type AuthRegister
- type AuthResponse
- type AuthUsecase
- type Author
- type AuthorRepository
- type Base
- type CasbinRBAC
- type CasbinRBACRepository
- type Employee
- type EmployeeHistory
- type EmployeeRepository
- type EmployeeUsecase
- type ForgotPassword
- type History
- type Query
- type QueryArgs
- type Role
- type RoleRepository
- type RoleUsecase
- type SelectClause
- type User
- type UserFilepath
- type UserFilepathRepository
- type UserQueryArgs
- type UserRepository
- type UserRole
- type UserRoleRepository
- type UserUpdate
- type UserUsecase
- type WhereClause
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInternalServerError will throw if any the Internal Server Error happen ErrInternalServerError = errors.New("internal Server Error") // ErrNotFound will throw if the requested item is not exists ErrNotFound = errors.New("your requested item is not found") // ErrConflict will throw if the current action already exists ErrConflict = errors.New("already exist") ErrUsenameTaken = errors.New("username already taken") ErrEmailTaken = errors.New("email already taken") // ErrBadParamInput will throw if the given request-body or params is not valid ErrBadParamInput = errors.New("given Param is not valid") ErrInvalidInput = errors.New("invalid input data") )
Functions ¶
This section is empty.
Types ¶
type AuthRegister ¶
type AuthResponse ¶
type AuthUsecase ¶
type Author ¶
type Author struct { ID int64 `json:"id"` Name string `json:"name"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
Author ...
type AuthorRepository ¶
AuthorRepository represent the author's repository contract
type Base ¶
type CasbinRBAC ¶
type CasbinRBACRepository ¶
type CasbinRBACRepository interface {
Store(c *CasbinRBAC) (bool, error)
}
type Employee ¶
type Employee struct { Base NIP string `json:"NIP" form:"NIP"` NIK string `json:"NIK" form:"NIK"` Name string `json:"name" form:"name"` Gender string `json:"gender" form:"gender"` Email string `json:"email" form:"email"` PhoneNumber string `json:"phone_number" form:"phone_number"` JoinedAt string `json:"joined_at" form:"joined_at"` JobRole string `json:"job_role" form:"job_role"` }
type EmployeeHistory ¶
type EmployeeRepository ¶
type EmployeeUsecase ¶
type ForgotPassword ¶
type ForgotPassword struct {
Email string `json:"email" validate:"required,email"`
}
type QueryArgs ¶
type QueryArgs struct { SelectClause WhereClause }
type RoleRepository ¶
type RoleUsecase ¶
type SelectClause ¶
type SelectClause struct {
User, UserRoles, Role, Employee string
}
type User ¶
type User struct { Base Username string `json:"username,omitempty" form:"username" gorm:"size:191"` Email string `json:"email,omitempty" validate:"required" form:"email" gorm:"index"` Password string `json:"password,omitempty" form:"password"` Name string `json:"name,omitempty" form:"name"` Gender string `json:"gender,omitempty" form:"gender"` Status string `gorm:"default:'not active'" json:"status,omitempty" form:"status"` UserRoles []UserRole `gorm:"foreignKey:UserID;" json:"user_role,omitempty" form:"user_roles"` ProfilePic string `json:"profile_pic,omitempty"` File *multipart.FileHeader `gorm:"-" json:"file,omitempty"` VerifiedAt *time.Time `json:"verified_at,omitempty" form:"verified_at"` OauthProvider string `json:"oauth_provider,omitempty"` OauthToken string `json:"oauth_token,omitempty"` }
type UserFilepath ¶
type UserFilepathRepository ¶
type UserFilepathRepository interface {
Store(ctx context.Context, f *UserFilepath) error
}
type UserQueryArgs ¶
type UserQueryArgs struct { SelectClause WhereClause }
type UserRepository ¶
type UserRepository interface { GetOneByUsernameOrEmail(ctx context.Context, usernameOrEmail string) (User, error) GetOne(ctx context.Context, args QueryArgs) (User, error) GetByID(ctx context.Context, id uuid.UUID) (User, error) Store(ctx context.Context, a *User) error Update(ctx context.Context, a *User) error }
type UserRoleRepository ¶
type UserUpdate ¶
type UserUsecase ¶
type UserUsecase interface { GetOneByUsernameOrEmail(ctx context.Context, usernameOrEmail string) (User, error) GetByID(ctx context.Context, id uuid.UUID) (User, error) Store(context.Context, *User, *UserRole) error Update(ctx context.Context, a *User) error ResendEmailVerification(ctx context.Context, token string) error GetUsingRefreshToken(ctx context.Context, userID uuid.UUID) (refreshToken string, accessToken string, err error) }
type WhereClause ¶
type WhereClause struct {
UserRoles, Role, User, Employee Query
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.