persistence

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthLogRepository

func NewAuthLogRepository() authlog.Repository

func NewCurrencyRepository

func NewCurrencyRepository() currency.Repository

func NewDialogueRepository

func NewDialogueRepository() dialogue.Repository

func NewEmployeeRepository

func NewEmployeeRepository() employee.Repository

func NewPermissionRepository

func NewPermissionRepository() permission.Repository

func NewPositionRepository

func NewPositionRepository() position.Repository

func NewProjectRepository

func NewProjectRepository() project.Repository

func NewProjectStageRepository

func NewProjectStageRepository() stage.Repository

func NewPromptRepository

func NewPromptRepository() prompt.Repository

func NewRoleRepository

func NewRoleRepository() role.Repository

func NewSessionRepository

func NewSessionRepository() session.Repository

func NewUploadRepository

func NewUploadRepository() upload.Repository

func NewUserRepository

func NewUserRepository() user.Repository

func ToDBCurrency

func ToDBCurrency(entity *currency.Currency) *models.Currency

func ToDBUpload added in v0.0.2

func ToDBUpload(upload *upload.Upload) *models.Upload

func ToDomainCurrency

func ToDomainCurrency(dbCurrency *models.Currency) (*currency.Currency, error)

func ToDomainUpload added in v0.0.2

func ToDomainUpload(dbUpload *models.Upload) *upload.Upload

Types

type FSStorage

type FSStorage struct{}

func NewFSStorage

func NewFSStorage() (*FSStorage, error)

func (*FSStorage) Save

func (s *FSStorage) Save(ctx context.Context, fileName string, bytes []byte) error

type GormAuthLogRepository

type GormAuthLogRepository struct{}

func (*GormAuthLogRepository) Count

func (g *GormAuthLogRepository) Count(ctx context.Context) (int64, error)

func (*GormAuthLogRepository) Create

func (*GormAuthLogRepository) Delete

func (g *GormAuthLogRepository) Delete(ctx context.Context, id int64) error

func (*GormAuthLogRepository) GetAll

func (*GormAuthLogRepository) GetByID

func (*GormAuthLogRepository) GetPaginated

func (g *GormAuthLogRepository) GetPaginated(
	ctx context.Context,
	limit,
	offset int,
	sortBy []string,
) ([]*authlog.AuthenticationLog, error)

func (*GormAuthLogRepository) Update

type GormCurrencyRepository

type GormCurrencyRepository struct{}

func (*GormCurrencyRepository) Count

func (g *GormCurrencyRepository) Count(ctx context.Context) (uint, error)

func (*GormCurrencyRepository) Create

func (g *GormCurrencyRepository) Create(ctx context.Context, entity *currency.Currency) error

func (*GormCurrencyRepository) CreateOrUpdate

func (g *GormCurrencyRepository) CreateOrUpdate(ctx context.Context, currency *currency.Currency) error

func (*GormCurrencyRepository) Delete

func (g *GormCurrencyRepository) Delete(ctx context.Context, id uint) error

func (*GormCurrencyRepository) GetAll

func (*GormCurrencyRepository) GetByID

func (*GormCurrencyRepository) GetPaginated

func (g *GormCurrencyRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*currency.Currency, error)

func (*GormCurrencyRepository) Update

func (g *GormCurrencyRepository) Update(ctx context.Context, entity *currency.Currency) error

type GormDialogueRepository

type GormDialogueRepository struct{}

func (*GormDialogueRepository) Count

func (*GormDialogueRepository) Create

func (*GormDialogueRepository) Delete

func (g *GormDialogueRepository) Delete(ctx context.Context, id int64) error

func (*GormDialogueRepository) GetAll

func (*GormDialogueRepository) GetByID

func (*GormDialogueRepository) GetByUserID

func (g *GormDialogueRepository) GetByUserID(ctx context.Context, userID int64) ([]*dialogue.Dialogue, error)

func (*GormDialogueRepository) GetPaginated

func (g *GormDialogueRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*dialogue.Dialogue, error)

func (*GormDialogueRepository) Update

type GormEmployeeRepository

type GormEmployeeRepository struct{}

func (*GormEmployeeRepository) Count

func (*GormEmployeeRepository) Create

func (*GormEmployeeRepository) Delete

func (g *GormEmployeeRepository) Delete(ctx context.Context, id uint) error

func (*GormEmployeeRepository) GetAll

func (*GormEmployeeRepository) GetByID

func (*GormEmployeeRepository) GetPaginated

func (g *GormEmployeeRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*employee.Employee, error)

func (*GormEmployeeRepository) Update

type GormPermissionRepository

type GormPermissionRepository struct{}

func (*GormPermissionRepository) Count

func (*GormPermissionRepository) Create

func (*GormPermissionRepository) CreateOrUpdate

func (g *GormPermissionRepository) CreateOrUpdate(ctx context.Context, data *permission.Permission) error

func (*GormPermissionRepository) Delete

func (g *GormPermissionRepository) Delete(ctx context.Context, id uint) error

func (*GormPermissionRepository) GetAll

func (*GormPermissionRepository) GetByID

func (*GormPermissionRepository) GetPaginated

func (g *GormPermissionRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*permission.Permission, error)

func (*GormPermissionRepository) Update

type GormPositionRepository

type GormPositionRepository struct{}

func (*GormPositionRepository) Count

func (*GormPositionRepository) Create

func (*GormPositionRepository) Delete

func (g *GormPositionRepository) Delete(ctx context.Context, id int64) error

func (*GormPositionRepository) GetAll

func (*GormPositionRepository) GetByID

func (*GormPositionRepository) GetPaginated

func (g *GormPositionRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*position.Position, error)

func (*GormPositionRepository) Update

type GormProjectRepository

type GormProjectRepository struct{}

func (*GormProjectRepository) Count

func (g *GormProjectRepository) Count(ctx context.Context) (uint, error)

func (*GormProjectRepository) Create

func (g *GormProjectRepository) Create(ctx context.Context, data *project.Project) error

func (*GormProjectRepository) Delete

func (g *GormProjectRepository) Delete(ctx context.Context, id uint) error

func (*GormProjectRepository) GetAll

func (*GormProjectRepository) GetByID

func (g *GormProjectRepository) GetByID(ctx context.Context, id uint) (*project.Project, error)

func (*GormProjectRepository) GetPaginated

func (g *GormProjectRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*project.Project, error)

func (*GormProjectRepository) Update

func (g *GormProjectRepository) Update(ctx context.Context, data *project.Project) error

type GormPromptRepository

type GormPromptRepository struct{}

func (*GormPromptRepository) Count

func (g *GormPromptRepository) Count(ctx context.Context) (int64, error)

func (*GormPromptRepository) Create

func (g *GormPromptRepository) Create(ctx context.Context, data *prompt.Prompt) error

func (*GormPromptRepository) Delete

func (g *GormPromptRepository) Delete(ctx context.Context, id int64) error

func (*GormPromptRepository) GetAll

func (g *GormPromptRepository) GetAll(ctx context.Context) ([]*prompt.Prompt, error)

func (*GormPromptRepository) GetByID

func (g *GormPromptRepository) GetByID(ctx context.Context, id string) (*prompt.Prompt, error)

func (*GormPromptRepository) GetPaginated

func (g *GormPromptRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*prompt.Prompt, error)

func (*GormPromptRepository) Update

func (g *GormPromptRepository) Update(ctx context.Context, data *prompt.Prompt) error

type GormRoleRepository

type GormRoleRepository struct{}

func (*GormRoleRepository) Count

func (g *GormRoleRepository) Count(ctx context.Context) (int64, error)

func (*GormRoleRepository) Create

func (g *GormRoleRepository) Create(ctx context.Context, data *role.Role) error

func (*GormRoleRepository) CreateOrUpdate

func (g *GormRoleRepository) CreateOrUpdate(ctx context.Context, data *role.Role) error

func (*GormRoleRepository) Delete

func (g *GormRoleRepository) Delete(ctx context.Context, id int64) error

func (*GormRoleRepository) GetAll

func (g *GormRoleRepository) GetAll(ctx context.Context) ([]*role.Role, error)

func (*GormRoleRepository) GetByID

func (g *GormRoleRepository) GetByID(ctx context.Context, id int64) (*role.Role, error)

func (*GormRoleRepository) GetPaginated

func (g *GormRoleRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*role.Role, error)

func (*GormRoleRepository) Update

func (g *GormRoleRepository) Update(ctx context.Context, data *role.Role) error

type GormSessionRepository

type GormSessionRepository struct{}

func (*GormSessionRepository) Count

func (g *GormSessionRepository) Count(ctx context.Context) (int64, error)

func (*GormSessionRepository) Create

func (g *GormSessionRepository) Create(ctx context.Context, data *session.Session) error

func (*GormSessionRepository) Delete

func (g *GormSessionRepository) Delete(ctx context.Context, id int64) error

func (*GormSessionRepository) GetAll

func (*GormSessionRepository) GetByToken

func (g *GormSessionRepository) GetByToken(ctx context.Context, token string) (*session.Session, error)

func (*GormSessionRepository) GetPaginated

func (g *GormSessionRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*session.Session, error)

func (*GormSessionRepository) Update

func (g *GormSessionRepository) Update(ctx context.Context, data *session.Session) error

type GormStageRepository

type GormStageRepository struct{}

func (*GormStageRepository) Count

func (g *GormStageRepository) Count(ctx context.Context) (uint, error)

func (*GormStageRepository) Create

func (g *GormStageRepository) Create(ctx context.Context, entity *stage.ProjectStage) error

func (*GormStageRepository) Delete

func (g *GormStageRepository) Delete(ctx context.Context, id uint) error

func (*GormStageRepository) GetAll

func (*GormStageRepository) GetByID

func (*GormStageRepository) GetPaginated

func (g *GormStageRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*stage.ProjectStage, error)

func (*GormStageRepository) Update

func (g *GormStageRepository) Update(ctx context.Context, entity *stage.ProjectStage) error

type GormUploadRepository

type GormUploadRepository struct{}

func (*GormUploadRepository) Count

func (g *GormUploadRepository) Count(ctx context.Context) (int64, error)

func (*GormUploadRepository) Create

func (g *GormUploadRepository) Create(ctx context.Context, data *upload.Upload) error

func (*GormUploadRepository) Delete

func (g *GormUploadRepository) Delete(ctx context.Context, id uint) error

func (*GormUploadRepository) GetAll

func (g *GormUploadRepository) GetAll(ctx context.Context) ([]*upload.Upload, error)

func (*GormUploadRepository) GetByHash

func (g *GormUploadRepository) GetByHash(ctx context.Context, hash string) (*upload.Upload, error)

func (*GormUploadRepository) GetByID

func (g *GormUploadRepository) GetByID(ctx context.Context, id uint) (*upload.Upload, error)

func (*GormUploadRepository) GetPaginated

func (g *GormUploadRepository) GetPaginated(
	ctx context.Context, params *upload.FindParams,
) ([]*upload.Upload, error)

func (*GormUploadRepository) Update

func (g *GormUploadRepository) Update(ctx context.Context, data *upload.Upload) error

type GormUserRepository

type GormUserRepository struct{}

func (*GormUserRepository) Count

func (g *GormUserRepository) Count(ctx context.Context) (int64, error)

func (*GormUserRepository) Create

func (g *GormUserRepository) Create(ctx context.Context, user *user.User) error

func (*GormUserRepository) CreateOrUpdate

func (g *GormUserRepository) CreateOrUpdate(ctx context.Context, user *user.User) error

func (*GormUserRepository) Delete

func (g *GormUserRepository) Delete(ctx context.Context, id uint) error

func (*GormUserRepository) GetAll

func (g *GormUserRepository) GetAll(ctx context.Context) ([]*user.User, error)

func (*GormUserRepository) GetByEmail

func (g *GormUserRepository) GetByEmail(ctx context.Context, email string) (*user.User, error)

func (*GormUserRepository) GetByID

func (g *GormUserRepository) GetByID(ctx context.Context, id uint) (*user.User, error)

func (*GormUserRepository) GetPaginated

func (g *GormUserRepository) GetPaginated(
	ctx context.Context,
	limit, offset int,
	sortBy []string,
) ([]*user.User, error)

func (*GormUserRepository) Update

func (g *GormUserRepository) Update(ctx context.Context, user *user.User) error

func (*GormUserRepository) UpdateLastAction

func (g *GormUserRepository) UpdateLastAction(ctx context.Context, id uint) error

func (*GormUserRepository) UpdateLastLogin

func (g *GormUserRepository) UpdateLastLogin(ctx context.Context, id uint) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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