Documentation ¶
Index ¶
Constants ¶
View Source
const ProductTableName string = "products"
View Source
const ProfileTableName string = "profiles"
View Source
const UserTableName string = "users"
Variables ¶
View Source
var I18Messages map[string]*I18nMessages = map[string]*I18nMessages{}
Functions ¶
This section is empty.
Types ¶
type AuthRepository ¶
type AuthResponse ¶
type AuthResponse struct { User *User `json:"user"` AccessToken string `json:"accesstoken" validate:"jwt"` RefreshToken string `json:"refreshtoken" validate:"jwt"` }
func (*AuthResponse) Validate ¶ added in v0.0.4
func (s *AuthResponse) Validate() error
type AuthService ¶
type I18nMessages ¶
type I18nMessages struct { ErrGeneric error ErrPassUnmatch error ErrInvalidId error ErrExpiredToken error ErrInvalidToken error ErrManyRequest error ErrMissingToken error ErrUserHasPass error ErrIncorrectPassword error ErrDisabledUser error ErrorNonexistentRoute error ErrUndefinedColumn error ErrProfileUsed error ErrProfileNotFound error ErrProfileRegistered error ErrProductUsed error ErrProductNotFound error ErrProductRegistered error ErrUserUsed error ErrUserNotFound error ErrUserRegistered error }
type Permissions ¶
type Permissions struct { Id uint `json:"-" gorm:"primarykey"` ProfileID uint `json:"-" gorm:"column:profile_id;unique;"` UserModule bool `json:"user_module" gorm:"column:user;type:bool;not null;"` ProfileModule bool `json:"profile_module" gorm:"column:profile;type:bool;not null;"` ProductModule bool `json:"product_module" gorm:"column:product;type:bool;not null;"` }
func (*Permissions) ToMap ¶
func (s *Permissions) ToMap() *map[string]interface{}
type Product ¶ added in v0.0.2
type ProductRepository ¶ added in v0.0.2
type ProductRepository interface { GetProducts(context.Context, *gormhelper.GORMFilter, *gormhelper.GORMLoad) (*[]Product, error) CountProducts(context.Context, *gormhelper.GORMFilter) (int64, error) GetProduct(context.Context, uint, *gormhelper.GORMLoad) (*Product, error) GetProductWhere(context.Context, string, *gormhelper.GORMLoad) (*Product, error) CreateProduct(context.Context, *dto.ProductInputDTO) (uint, error) UpdateProduct(context.Context, *Product, *dto.ProductInputDTO) error DeleteProduct(context.Context, *Product) error }
type ProductService ¶ added in v0.0.2
type ProductService interface { GetProducts(context.Context, *gormhelper.GORMFilter, *gormhelper.GORMLoad) (*[]Product, error) CountProducts(context.Context, *gormhelper.GORMFilter) (int64, error) GetProduct(context.Context, uint, *gormhelper.GORMLoad) (*Product, error) GetProductWhere(context.Context, string, *gormhelper.GORMLoad) (*Product, error) CreateProduct(context.Context, *dto.ProductInputDTO) (uint, error) UpdateProduct(context.Context, *Product, *dto.ProductInputDTO) error DeleteProduct(context.Context, *Product) error }
type Profile ¶
type Profile struct { Base Name string `json:"name" gorm:"column:name;type:varchar(100);unique;not null;" validate:"required,min=4"` Permissions Permissions `json:"permissions" gorm:"constraint:OnUpdate:CASCADE,OnDelete:CASCADE;"` }
type ProfileRepository ¶
type ProfileRepository interface { GetProfiles(context.Context, *gormhelper.GORMFilter, *gormhelper.GORMLoad) (*[]Profile, error) CountProfiles(context.Context, *gormhelper.GORMFilter) (int64, error) GetProfile(context.Context, uint, *gormhelper.GORMLoad) (*Profile, error) GetProfileWhere(context.Context, string, *gormhelper.GORMLoad) (*Profile, error) CreateProfile(context.Context, *dto.ProfileInputDTO) (uint, error) UpdateProfile(context.Context, *Profile, *dto.ProfileInputDTO) error DeleteProfile(context.Context, *Profile) error }
type ProfileService ¶
type ProfileService interface { GetProfiles(context.Context, *gormhelper.GORMFilter, *gormhelper.GORMLoad) (*[]Profile, error) CountProfiles(context.Context, *gormhelper.GORMFilter) (int64, error) GetProfile(context.Context, uint, *gormhelper.GORMLoad) (*Profile, error) GetProfileWhere(context.Context, string, *gormhelper.GORMLoad) (*Profile, error) CreateProfile(context.Context, *dto.ProfileInputDTO) (uint, error) UpdateProfile(context.Context, *Profile, *dto.ProfileInputDTO) error DeleteProfile(context.Context, *Profile) error }
type User ¶
type User struct { Base Name string `json:"name" gorm:"column:name;type:varchar(200);not null;" validate:"required,min=5"` Email string `json:"email" gorm:"column:email;type:varchar(320);unique;index;not null;" validate:"required,email"` Status bool `json:"status" gorm:"column:status;type:bool;not null;"` New bool `json:"new" gorm:"column:new;type:bool;not null;"` ProfileID uint `json:"-" gorm:"column:profile_id;type:bigint;not null;" validate:"required,min=1"` Token *string `json:"-" gorm:"column:token;type:varchar(255);unique;index"` Password *string `json:"-" gorm:"column:password;type:varchar(255);"` Profile *Profile `json:"profile"` }
func (*User) GenerateToken ¶
func (*User) ValidatePassword ¶
type UserRepository ¶
type UserRepository interface { GetUsers(context.Context, *gormhelper.GORMFilter, *gormhelper.GORMLoad) (*[]User, error) CountUsers(context.Context, *gormhelper.GORMFilter) (int64, error) GetUser(context.Context, uint, *gormhelper.GORMLoad) (*User, error) GetUserWhere(context.Context, string, *gormhelper.GORMLoad) (*User, error) GetUserByEmail(context.Context, string, *gormhelper.GORMLoad) (*User, error) GetUserByToken(context.Context, string, *gormhelper.GORMLoad) (*User, error) CreateUser(context.Context, *dto.UserInputDTO) (uint, error) UpdateUser(context.Context, *User, *dto.UserInputDTO) error DeleteUser(context.Context, *User) error ResetUser(context.Context, *User) error PasswordUser(context.Context, *User, *dto.PasswordInputDTO) error }
type UserService ¶
type UserService interface { GetUsers(context.Context, *gormhelper.GORMFilter, *gormhelper.GORMLoad) (*[]User, error) CountUsers(context.Context, *gormhelper.GORMFilter) (int64, error) GetUser(context.Context, uint, *gormhelper.GORMLoad) (*User, error) GetUserWhere(context.Context, string, *gormhelper.GORMLoad) (*User, error) GetUserByEmail(context.Context, string, *gormhelper.GORMLoad) (*User, error) GetUserByToken(context.Context, string, *gormhelper.GORMLoad) (*User, error) CreateUser(context.Context, *dto.UserInputDTO) (uint, error) UpdateUser(context.Context, *User, *dto.UserInputDTO) error DeleteUser(context.Context, *User) error ResetUser(context.Context, *User) error PasswordUser(context.Context, *User, *dto.PasswordInputDTO) error }
Click to show internal directories.
Click to hide internal directories.