repository

package
v2.3.24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PermissionOrderBy = clause.FieldOrderBy{}
View Source
var PermissionSearchable = clause.FieldSearchable{}
View Source
var RoleOrderBy = clause.FieldOrderBy{
	"id":   {Column: `auth_roles."id"`},
	"name": {Column: `auth_roles."name"`},
}
View Source
var RolePermissionOrderBy = clause.FieldOrderBy{}
View Source
var RolePermissionSearchable = clause.FieldSearchable{}
View Source
var RoleSearchable = clause.FieldSearchable{
	"id":   {Column: `auth_roles."id"`, Type: clause.Int},
	"name": {Column: `auth_roles."name"`, Type: clause.String},
}
View Source
var SettingOrderBy = clause.FieldOrderBy{}
View Source
var SettingSearchable = clause.FieldSearchable{}
View Source
var TokenOrderBy = clause.FieldOrderBy{
	"id":         {Column: `auth_tokens."id"`},
	"user_id":    {Column: `auth_tokens."user_id"`},
	"logged_at":  {Column: `auth_tokens."logged_at"`},
	"updated_at": {Column: `auth_tokens."updated_at"`},
}
View Source
var TokenSearchable = clause.FieldSearchable{
	"id":         {Column: `auth_tokens."id"`, Type: clause.Int},
	"user_id":    {Column: `auth_tokens."user_id"`, Type: clause.Int},
	"logged_at":  {Column: `auth_tokens."logged_at"`, Type: clause.DateTime},
	"updated_at": {Column: `auth_tokens."updated_at"`, Type: clause.DateTime},
}
View Source
var UserRoleOrderBy = clause.FieldOrderBy{}
View Source
var UserRoleSearchable = clause.FieldSearchable{}

Functions

This section is empty.

Types

type IPermissionRepository

type IPermissionRepository interface {
	repository.Repository[IPermissionRepository, model.Permission]
}

type IRoleRepository

type IRoleRepository interface {
	repository.Repository[IRoleRepository, model.Role]
}

type ISettingRepository

type ISettingRepository interface {
	repository.Repository[ISettingRepository, model.Setting]
}

type ITokenRepository

type ITokenRepository interface {
	repository.Repository[ITokenRepository, model.RefreshToken]
}

type IUserRepository

type IUserRepository interface {
	repository.Repository[IUserRepository, model.User]
	GetUserWithPermissions(ctx context.Context, query string, args ...any) (*model.User, error)
}

type IUserRoleRepository

type IUserRoleRepository interface {
	repository.Repository[IUserRoleRepository, model.UserRole]
	GetUsersByRole(ctx context.Context, roleID int) ([]int, error)
}

type PermissionRepository

type PermissionRepository struct {
	repository.Repo[model.Permission]
}

func NewPermissionRepository

func NewPermissionRepository(db *gorm.DB) PermissionRepository

func (PermissionRepository) Joins

func (PermissionRepository) Omit

func (PermissionRepository) Trx

func (PermissionRepository) With

type Repositories

type Repositories struct {
	UserRepository           IUserRepository
	TokenRepository          ITokenRepository
	RoleRepository           IRoleRepository
	PermissionRepository     IPermissionRepository
	RolePermissionRepository IRolePermissionRepository
	UserRoleRepository       IUserRoleRepository
	SettingRepository        ISettingRepository
}

func NewRepositories

func NewRepositories(db *gorm.DB) Repositories

type RolePermissionRepository

type RolePermissionRepository struct {
	repository.Repo[model.RolePermission]
}

func NewRolePermissionRepository

func NewRolePermissionRepository(db *gorm.DB) RolePermissionRepository

func (RolePermissionRepository) Joins

func (RolePermissionRepository) Omit

func (RolePermissionRepository) Trx

func (RolePermissionRepository) With

type RoleRepository

type RoleRepository struct {
	repository.Repo[model.Role]
}

func NewRoleRepository

func NewRoleRepository(db *gorm.DB) RoleRepository

func (RoleRepository) Joins

func (r RoleRepository) Joins(models ...string) IRoleRepository

func (RoleRepository) Omit

func (r RoleRepository) Omit(columns ...string) IRoleRepository

func (RoleRepository) Trx

func (RoleRepository) With

func (r RoleRepository) With(models ...string) IRoleRepository

type SettingRepository

type SettingRepository struct {
	repository.Repo[model.Setting]
}

func NewSettingRepository

func NewSettingRepository(db *gorm.DB) SettingRepository

func (SettingRepository) Joins

func (r SettingRepository) Joins(models ...string) ISettingRepository

func (SettingRepository) Omit

func (r SettingRepository) Omit(columns ...string) ISettingRepository

func (SettingRepository) Trx

func (SettingRepository) With

func (r SettingRepository) With(models ...string) ISettingRepository

type TokenRepository

type TokenRepository struct {
	repository.Repo[model.RefreshToken]
}

func NewTokenRepository

func NewTokenRepository(db *gorm.DB) TokenRepository

func (TokenRepository) Joins

func (r TokenRepository) Joins(models ...string) ITokenRepository

func (TokenRepository) Omit

func (r TokenRepository) Omit(columns ...string) ITokenRepository

func (TokenRepository) Trx

func (TokenRepository) With

func (r TokenRepository) With(models ...string) ITokenRepository

type UserRepository

type UserRepository struct {
	repository.Repo[model.User]
}

func NewUserRepository

func NewUserRepository(db *gorm.DB) UserRepository

func (UserRepository) GetUserWithPermissions

func (r UserRepository) GetUserWithPermissions(ctx context.Context, query string, args ...any) (*model.User, error)

func (UserRepository) Joins

func (r UserRepository) Joins(models ...string) IUserRepository

func (UserRepository) Omit

func (r UserRepository) Omit(columns ...string) IUserRepository

func (UserRepository) Trx

func (UserRepository) With

func (r UserRepository) With(models ...string) IUserRepository

type UserRoleRepository

type UserRoleRepository struct {
	repository.Repo[model.UserRole]
}

func NewUserRoleRepository

func NewUserRoleRepository(db *gorm.DB) UserRoleRepository

func (UserRoleRepository) GetUsersByRole

func (r UserRoleRepository) GetUsersByRole(ctx context.Context, roleID int) ([]int, error)

func (UserRoleRepository) Joins

func (r UserRoleRepository) Joins(models ...string) IUserRoleRepository

func (UserRoleRepository) Omit

func (r UserRoleRepository) Omit(columns ...string) IUserRoleRepository

func (UserRoleRepository) Trx

func (UserRoleRepository) With

func (r UserRoleRepository) With(models ...string) IUserRoleRepository

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL