gorm

package
v0.0.0-...-a23f117 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrJobNameConflict = errors.New("job name conflicts")
View Source
var ErrLocalDataNameConflict = errors.New("data name cannot be the same with existing one")

ErrLocalDataNameConflict means data with same name exists

View Source
var ErrLocalProjectNameConflict = errors.New("project name conflicts")
View Source
var ErrSiteExist = errors.New("site already configured")

ErrSiteExist means the site info is already there

View Source
var ErrUserExist = errors.New("user already exists")

ErrUserExist means new user cannot be created due to the existence of the same-name user

Functions

func InitDB

func InitDB() error

InitDB initialize the connection to the PostgresSQL db

Types

type JobParticipantRepo

type JobParticipantRepo struct{}

JobParticipantRepo implements repo.JobParticipantRepository using gorm and PostgreSQL

func (*JobParticipantRepo) Create

func (r *JobParticipantRepo) Create(instance interface{}) error

func (*JobParticipantRepo) GetByJobAndSiteUUID

func (r *JobParticipantRepo) GetByJobAndSiteUUID(jobUUID, siteUUID string) (interface{}, error)

func (*JobParticipantRepo) GetListByJobUUID

func (r *JobParticipantRepo) GetListByJobUUID(jobUUID string) (interface{}, error)

func (*JobParticipantRepo) InitTable

func (r *JobParticipantRepo) InitTable()

InitTable make sure the table is created in the db

func (*JobParticipantRepo) UpdateStatusByUUID

func (r *JobParticipantRepo) UpdateStatusByUUID(instance interface{}) error

type JobRepo

type JobRepo struct{}

JobRepo implements repo.JobRepository using gorm and PostgreSQL

func (*JobRepo) CheckNameConflict

func (r *JobRepo) CheckNameConflict(name string) error

func (*JobRepo) Create

func (r *JobRepo) Create(instance interface{}) error

func (*JobRepo) DeleteByProjectUUID

func (r *JobRepo) DeleteByProjectUUID(projectUUID string) error

func (*JobRepo) GetAll

func (r *JobRepo) GetAll() (interface{}, error)

func (*JobRepo) GetByUUID

func (r *JobRepo) GetByUUID(uuid string) (interface{}, error)

func (*JobRepo) GetListByProjectUUID

func (r *JobRepo) GetListByProjectUUID(projectUUID string) (interface{}, error)

func (*JobRepo) InitTable

func (r *JobRepo) InitTable()

InitTable make sure the table is created in the db

func (*JobRepo) UpdateFATEJobInfoByUUID

func (r *JobRepo) UpdateFATEJobInfoByUUID(instance interface{}) error

func (*JobRepo) UpdateFATEJobStatusByUUID

func (r *JobRepo) UpdateFATEJobStatusByUUID(instance interface{}) error

func (*JobRepo) UpdateFinishTimeByUUID

func (r *JobRepo) UpdateFinishTimeByUUID(instance interface{}) error

func (*JobRepo) UpdateResultInfoByUUID

func (r *JobRepo) UpdateResultInfoByUUID(instance interface{}) error

func (*JobRepo) UpdateStatusByUUID

func (r *JobRepo) UpdateStatusByUUID(instance interface{}) error

func (*JobRepo) UpdateStatusMessageByUUID

func (r *JobRepo) UpdateStatusMessageByUUID(instance interface{}) error

type LocalDataRepo

type LocalDataRepo struct{}

LocalDataRepo implements repo.LocalDataRepository using gorm and PostgreSQL

func (*LocalDataRepo) CheckNameConflict

func (r *LocalDataRepo) CheckNameConflict(name string) error

func (*LocalDataRepo) Create

func (r *LocalDataRepo) Create(instance interface{}) error

func (*LocalDataRepo) DeleteByUUID

func (r *LocalDataRepo) DeleteByUUID(uuid string) error

func (*LocalDataRepo) GetAll

func (r *LocalDataRepo) GetAll() (interface{}, error)

func (*LocalDataRepo) GetByUUID

func (r *LocalDataRepo) GetByUUID(uuid string) (interface{}, error)

func (*LocalDataRepo) InitTable

func (r *LocalDataRepo) InitTable()

InitTable make sure the table is created in the db

func (*LocalDataRepo) UpdateIDMetaInfoByUUID

func (r *LocalDataRepo) UpdateIDMetaInfoByUUID(uuid string, instance interface{}) error

func (*LocalDataRepo) UpdateJobInfoByUUID

func (r *LocalDataRepo) UpdateJobInfoByUUID(instance interface{}) error

type ModelDeploymentRepo

type ModelDeploymentRepo struct{}

ModelDeploymentRepo implements repo.ModelDeploymentRepository using gorm and PostgreSQL

func (*ModelDeploymentRepo) Create

func (r *ModelDeploymentRepo) Create(instance interface{}) error

func (*ModelDeploymentRepo) InitTable

func (r *ModelDeploymentRepo) InitTable()

InitTable make sure the table is created in the db

func (*ModelDeploymentRepo) UpdateResultJsonByUUID

func (r *ModelDeploymentRepo) UpdateResultJsonByUUID(instance interface{}) error

func (*ModelDeploymentRepo) UpdateStatusByUUID

func (r *ModelDeploymentRepo) UpdateStatusByUUID(instance interface{}) error

type ModelRepo

type ModelRepo struct{}

ModelRepo implements repo.ModelRepository using gorm and PostgreSQL

func (*ModelRepo) Create

func (r *ModelRepo) Create(instance interface{}) error

func (*ModelRepo) DeleteByUUID

func (r *ModelRepo) DeleteByUUID(uuid string) error

func (*ModelRepo) GetAll

func (r *ModelRepo) GetAll() (interface{}, error)

func (*ModelRepo) GetByUUID

func (r *ModelRepo) GetByUUID(uuid string) (interface{}, error)

func (*ModelRepo) GetListByProjectUUID

func (r *ModelRepo) GetListByProjectUUID(projectUUID string) (interface{}, error)

func (*ModelRepo) InitTable

func (r *ModelRepo) InitTable()

InitTable make sure the table is created in the db

type ProjectDataRepo

type ProjectDataRepo struct{}

ProjectDataRepo is the implementation of repo.ProjectDataRepository

func (*ProjectDataRepo) Create

func (r *ProjectDataRepo) Create(instance interface{}) error

func (*ProjectDataRepo) DeleteByProjectUUID

func (r *ProjectDataRepo) DeleteByProjectUUID(projectUUID string) error

func (*ProjectDataRepo) DeleteByUUID

func (r *ProjectDataRepo) DeleteByUUID(uuid string) error

func (*ProjectDataRepo) GetByDataUUID

func (r *ProjectDataRepo) GetByDataUUID(dataUUID string) (interface{}, error)

func (*ProjectDataRepo) GetByProjectAndDataUUID

func (r *ProjectDataRepo) GetByProjectAndDataUUID(projectUUID string, dataUUID string) (interface{}, error)

func (*ProjectDataRepo) GetListByDataUUID

func (r *ProjectDataRepo) GetListByDataUUID(dataUUID string) (interface{}, error)

func (*ProjectDataRepo) GetListByProjectAndSiteUUID

func (r *ProjectDataRepo) GetListByProjectAndSiteUUID(projectUUID string, siteUUID string) (interface{}, error)

func (*ProjectDataRepo) GetListByProjectUUID

func (r *ProjectDataRepo) GetListByProjectUUID(projectUUID string) (interface{}, error)

func (*ProjectDataRepo) InitTable

func (r *ProjectDataRepo) InitTable()

InitTable make sure the table is created in the db

func (*ProjectDataRepo) UpdateSiteInfoBySiteUUID

func (r *ProjectDataRepo) UpdateSiteInfoBySiteUUID(instance interface{}) error

func (*ProjectDataRepo) UpdateStatusByUUID

func (r *ProjectDataRepo) UpdateStatusByUUID(instance interface{}) error

type ProjectInvitationRepo

type ProjectInvitationRepo struct{}

ProjectInvitationRepo is the implementation of repo.ProjectInvitationRepository

func (*ProjectInvitationRepo) Create

func (r *ProjectInvitationRepo) Create(instance interface{}) error

func (*ProjectInvitationRepo) GetByProjectAndSiteUUID

func (r *ProjectInvitationRepo) GetByProjectAndSiteUUID(projectUUID, siteUUID string) (interface{}, error)

func (*ProjectInvitationRepo) GetByProjectUUID

func (r *ProjectInvitationRepo) GetByProjectUUID(uuid string) (interface{}, error)

func (*ProjectInvitationRepo) GetByUUID

func (r *ProjectInvitationRepo) GetByUUID(uuid string) (interface{}, error)

func (*ProjectInvitationRepo) InitTable

func (r *ProjectInvitationRepo) InitTable()

InitTable make sure the table is created in the db

func (*ProjectInvitationRepo) UpdateStatusByUUID

func (r *ProjectInvitationRepo) UpdateStatusByUUID(instance interface{}) error

type ProjectParticipantRepo

type ProjectParticipantRepo struct{}

ProjectParticipantRepo is the implementation of repo.ProjectParticipantRepository

func (*ProjectParticipantRepo) CountJoinedParticipantByProjectUUID

func (r *ProjectParticipantRepo) CountJoinedParticipantByProjectUUID(uuid string) (int64, error)

func (*ProjectParticipantRepo) Create

func (r *ProjectParticipantRepo) Create(instance interface{}) error

func (*ProjectParticipantRepo) DeleteByProjectUUID

func (r *ProjectParticipantRepo) DeleteByProjectUUID(projectUUID string) error

func (*ProjectParticipantRepo) GetByProjectAndSiteUUID

func (r *ProjectParticipantRepo) GetByProjectAndSiteUUID(projectUUID, siteUUID string) (interface{}, error)

func (*ProjectParticipantRepo) GetByProjectUUID

func (r *ProjectParticipantRepo) GetByProjectUUID(uuid string) (interface{}, error)

func (*ProjectParticipantRepo) GetBySiteUUID

func (r *ProjectParticipantRepo) GetBySiteUUID(siteUUID string) (interface{}, error)

func (*ProjectParticipantRepo) InitTable

func (r *ProjectParticipantRepo) InitTable()

InitTable make sure the table is created in the db

func (*ProjectParticipantRepo) UpdateParticipantInfoBySiteUUID

func (r *ProjectParticipantRepo) UpdateParticipantInfoBySiteUUID(instance interface{}) error

func (*ProjectParticipantRepo) UpdateStatusByUUID

func (r *ProjectParticipantRepo) UpdateStatusByUUID(instance interface{}) error

type ProjectRepo

type ProjectRepo struct{}

ProjectRepo is the implementation of repo.ProjectRepository

func (*ProjectRepo) CheckNameConflict

func (r *ProjectRepo) CheckNameConflict(name string) error

func (*ProjectRepo) Create

func (r *ProjectRepo) Create(instance interface{}) error

func (*ProjectRepo) DeleteByUUID

func (r *ProjectRepo) DeleteByUUID(uuid string) error

func (*ProjectRepo) GetAll

func (r *ProjectRepo) GetAll() (interface{}, error)

func (*ProjectRepo) GetByUUID

func (r *ProjectRepo) GetByUUID(uuid string) (interface{}, error)

func (*ProjectRepo) InitTable

func (r *ProjectRepo) InitTable()

InitTable make sure the table is created in the db

func (*ProjectRepo) UpdateAutoApprovalStatusByUUID

func (r *ProjectRepo) UpdateAutoApprovalStatusByUUID(instance interface{}) error

func (*ProjectRepo) UpdateManagingSiteInfoBySiteUUID

func (r *ProjectRepo) UpdateManagingSiteInfoBySiteUUID(instance interface{}) error

func (*ProjectRepo) UpdateStatusByUUID

func (r *ProjectRepo) UpdateStatusByUUID(instance interface{}) error

func (*ProjectRepo) UpdateTypeByUUID

func (r *ProjectRepo) UpdateTypeByUUID(instance interface{}) error

type SiteRepo

type SiteRepo struct{}

SiteRepo is the implementation of the domain's repo interface

func (*SiteRepo) CreateSite

func (r *SiteRepo) CreateSite(site *entity.Site) error

CreateSite inserts a site info entry

func (*SiteRepo) GetSite

func (r *SiteRepo) GetSite() (interface{}, error)

GetSite returns the site information

func (*SiteRepo) InitData

func (r *SiteRepo) InitData()

InitData inserts an empty site info

func (*SiteRepo) InitTable

func (r *SiteRepo) InitTable()

InitTable make sure the table is created in the db

func (*SiteRepo) Load

func (r *SiteRepo) Load(instance interface{}) error

Load reads the site information

func (*SiteRepo) Update

func (r *SiteRepo) Update(instance interface{}) error

Update updates the site info

func (*SiteRepo) UpdateFMLManagerConnectionStatus

func (r *SiteRepo) UpdateFMLManagerConnectionStatus(instance interface{}) error

UpdateFMLManagerConnectionStatus updates fml manager related information

type UserRepo

type UserRepo struct{}

UserRepo implements repo.UserRepository using gorm and PostgreSQL

func (*UserRepo) CreateUser

func (r *UserRepo) CreateUser(instance interface{}) error

CreateUser creates a new user

func (*UserRepo) GetAllUsers

func (r *UserRepo) GetAllUsers() (interface{}, error)

GetAllUsers returns all available users' info

func (*UserRepo) GetByName

func (r *UserRepo) GetByName(name string) (*entity.User, error)

GetByName returns the user info indexed by the name

func (*UserRepo) InitData

func (r *UserRepo) InitData()

InitData inserts or updates the defaults users information

func (*UserRepo) InitTable

func (r *UserRepo) InitTable()

InitTable make sure the table is created in the db

func (*UserRepo) LoadById

func (r *UserRepo) LoadById(instance interface{}) error

LoadById loads the user info by id

func (*UserRepo) LoadByName

func (r *UserRepo) LoadByName(instance interface{}) error

LoadByName loads the user info by name

func (*UserRepo) UpdateByName

func (r *UserRepo) UpdateByName(updatedUser *entity.User) error

UpdateByName changes the specified user's info

func (*UserRepo) UpdatePasswordById

func (r *UserRepo) UpdatePasswordById(id uint, hashedPassword string) error

UpdatePasswordById changes the user's hashed password

func (*UserRepo) UpdatePermissionInfoById

func (r *UserRepo) UpdatePermissionInfoById(id uint, info valueobject.UserPermissionInfo) error

UpdatePermissionInfoById changes the specified user's permission info

Jump to

Keyboard shortcuts

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