Documentation ¶
Index ¶
- type BuildRepo
- func (r *BuildRepo) Delete(build model.Build) (err error)
- func (r *BuildRepo) GetBuild(id uint) (build model.Build)
- func (r *BuildRepo) Save(build *model.Build) (err error)
- func (r *BuildRepo) SaveResult(buildTo _domain.BuildTo, resultPath string, progress _const.BuildProgress, ...)
- func (r *BuildRepo) SetTimeoutByQueueId(queueId uint)
- func (r *BuildRepo) Start(build model.Build) (err error)
- type ClusterRepo
- func (r *ClusterRepo) Get(id uint) (cluster model.Cluster)
- func (r *ClusterRepo) GetByIdent(ident string) (cluster model.Cluster)
- func (r *ClusterRepo) Query(keywords string, pageNo, pageSize int) (clusters []model.Cluster, total int64, err error)
- func (r *ClusterRepo) QueryByImages(images []uint, ids []uint) (clusterId, backingImageId uint)
- func (r *ClusterRepo) QueryByType(tp string) (clusters []model.Cluster, err error)
- func (r *ClusterRepo) QueryIdle(cluster int) (ret []map[string]uint)
- type CommonRepo
- func (r *CommonRepo) Defer(tx *gorm.DB, code *int)
- func (r *CommonRepo) DropTables()
- func (r *CommonRepo) Found(s *domain.Search) *gorm.DB
- func (r *CommonRepo) FoundByWhere(fields []*domain.Filed) func(db *gorm.DB) *gorm.DB
- func (r *CommonRepo) GetAll(model interface{}, s *domain.Search) *gorm.DB
- func (r *CommonRepo) GetRelations(relation string, fs map[string]interface{}) []*domain.Relate
- func (r *CommonRepo) GetSearch(key, search string) *domain.Filed
- func (r *CommonRepo) IsNotFound(err error) bool
- func (r *CommonRepo) Paginate(page, pageSize int) func(db *gorm.DB) *gorm.DB
- func (r *CommonRepo) Relation(relates []*domain.Relate) func(db *gorm.DB) *gorm.DB
- func (r *CommonRepo) Update(v, d interface{}, id uint) error
- type ComputerRepo
- type ContainerImageRepo
- func (r *ContainerImageRepo) Get(id uint) (image model.ContainerImage)
- func (r *ContainerImageRepo) GetByEnv(env base.TestEnv) (image model.ContainerImage)
- func (r *ContainerImageRepo) QueryByBrowser(browserType _const.BrowserType, ver string) (ids []int)
- func (r *ContainerImageRepo) QueryByOs(platform _const.OsPlatform, osType _const.OsType, osLang _const.SysLang) (ids []int)
- type ContainerRepo
- func (r *ContainerRepo) DestroyMissedContainersStatus(containers []string, hostId uint)
- func (r *ContainerRepo) FailToCreate(id uint, msg string)
- func (r *ContainerRepo) GetById(id uint) (container model.Container)
- func (r *ContainerRepo) Launch(container _domain.Container)
- func (r *ContainerRepo) QueryForDestroy() (containers []model.Container)
- func (r *ContainerRepo) Register(container _domain.Container) (err error)
- func (r *ContainerRepo) Save(po model.Container)
- func (r *ContainerRepo) UpdateStatusByNames(containers []string, status _const.VmStatus)
- type DeviceRepo
- type EnvRepo
- type ExecRepo
- type IsoRepo
- type PermRepo
- func (r *PermRepo) CreatePermission(perm *model.Permission) error
- func (r *PermRepo) DeletePermissionById(id uint) error
- func (r *PermRepo) GetAllPermissions(s *domain.Search) ([]*model.Permission, int64, error)
- func (r *PermRepo) GetPermission(search *domain.Search) (*model.Permission, error)
- func (r *PermRepo) NewPermission() *model.Permission
- func (r *PermRepo) PermTransform(perm *model.Permission) *transformer.Permission
- func (r *PermRepo) PermsTransform(perms []*model.Permission) []*transformer.Permission
- func (r *PermRepo) UpdatePermission(id uint, pj *model.Permission) error
- type PlanRepo
- func (r *PlanRepo) Query(keywords string, pageNo int, pageSize int) (models []model.Plan, total int64)
- func (r *PlanRepo) Save(plan *model.Plan) (err error)
- func (r *PlanRepo) SetProgress(planId uint, progress _const.BuildProgress) (err error)
- func (r *PlanRepo) SetResult(planId uint, progress _const.BuildProgress, status _const.BuildStatus) (err error)
- type QueueRepo
- func (r *QueueRepo) GetQueue(id uint) (queue model.Queue)
- func (r *QueueRepo) Pending(queueId uint) (err error)
- func (r *QueueRepo) QueryByTask(taskID uint) (queues []model.Queue)
- func (r *QueueRepo) QueryForExec() (queues []model.Queue)
- func (r *QueueRepo) QueryForRetry() (queues []model.Queue)
- func (r *QueueRepo) QueryTimeout() (queueIds []uint)
- func (r *QueueRepo) Run(queue model.Queue) (err error)
- func (r *QueueRepo) Save(queue *model.Queue) (err error)
- func (r *QueueRepo) SetAndLaunchVm(queue model.Queue) (err error)
- func (r *QueueRepo) SetQueueStatus(queueId uint, progress _const.BuildProgress, status _const.BuildStatus)
- func (r *QueueRepo) SetTimeout(queueIds []uint) (err error)
- func (r *QueueRepo) UpdateVm(queueId, vmId uint, status _const.BuildProgress)
- type RoleRepo
- type TaskRepo
- type TokenRepo
- func (r *TokenRepo) CacheToRedis(conn *redisUtils.RedisCluster, cred domain.UserCredentials, token string) error
- func (r *TokenRepo) CleanUserTokenCache(conn *redisUtils.RedisCluster, rs domain.UserCredentials) error
- func (r *TokenRepo) DelTokenCache(conn *redisUtils.RedisCluster, rs domain.UserCredentials, token string) error
- func (r *TokenRepo) DelUserTokenCache(conn *redisUtils.RedisCluster, rs domain.UserCredentials, token string) error
- func (r *TokenRepo) GetRedisSession(conn *redisUtils.RedisCluster, token string) (*domain.UserCredentials, error)
- func (r *TokenRepo) GetTokenExpire(rs domain.UserCredentials) time.Duration
- func (r *TokenRepo) GetUserScope(userType string) uint64
- func (r *TokenRepo) GetWebSession(conn *redisUtils.RedisCluster, token string) (*domain.UserCredentials, error)
- func (r *TokenRepo) IsUserTokenOver(userId string) bool
- func (r *TokenRepo) SyncUserTokenCache(conn *redisUtils.RedisCluster, cred domain.UserCredentials, token string) error
- func (r *TokenRepo) UpdateUserTokenCacheExpire(conn *redisUtils.RedisCluster, rs domain.UserCredentials, token string) error
- func (r *TokenRepo) UserTokenExpired(token string)
- type UserRepo
- func (r *UserRepo) DeleteUser(id uint) error
- func (r *UserRepo) GetAllUsers(s *domain.Search) ([]*model.User, int64, error)
- func (r *UserRepo) GetByToken(token string) (model.User, error)
- func (r *UserRepo) GetUser(search *domain.Search) (*model.User, error)
- func (r *UserRepo) NewUser() *model.User
- func (r *UserRepo) UpdateRefreshToken(id uint, token string)
- type VmRepo
- func (r *VmRepo) FailToCreate(id uint, msg string)
- func (r *VmRepo) GetById(id uint) (vm model.Vm)
- func (r *VmRepo) QueryForDestroy() (vms []model.Vm)
- func (r *VmRepo) Register(vm _domain.Vm) (err error)
- func (r *VmRepo) Save(po *model.Vm)
- func (r *VmRepo) UpdateStatus(vmId uint, status _const.VmStatus)
- func (r *VmRepo) UpdateStatusByNames(vms []string, status _const.VmStatus)
- type VmTemplRepo
- func (r *VmTemplRepo) Create(templ *model.VmTempl)
- func (r *VmTemplRepo) Get(id uint) (templ model.VmTempl)
- func (r *VmTemplRepo) GetByEnv(env base.TestEnv) (templ model.VmTempl)
- func (r *VmTemplRepo) GetByIdent(ident, computer, cluster string) (templ model.VmTempl)
- func (r *VmTemplRepo) Update(templ *model.VmTempl) (err error)
- func (r *VmTemplRepo) UpdateAllSameName(templ *model.VmTempl) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildRepo ¶
type BuildRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewBuildRepo ¶
func NewBuildRepo() *BuildRepo
func (*BuildRepo) SaveResult ¶
func (r *BuildRepo) SaveResult(buildTo _domain.BuildTo, resultPath string, progress _const.BuildProgress, status _const.BuildStatus, msg string)
func (*BuildRepo) SetTimeoutByQueueId ¶
type ClusterRepo ¶
type ClusterRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewClusterRepo ¶
func NewClusterRepo() *ClusterRepo
func (*ClusterRepo) GetByIdent ¶
func (r *ClusterRepo) GetByIdent(ident string) (cluster model.Cluster)
func (*ClusterRepo) QueryByImages ¶
func (r *ClusterRepo) QueryByImages(images []uint, ids []uint) (clusterId, backingImageId uint)
func (*ClusterRepo) QueryByType ¶
func (r *ClusterRepo) QueryByType(tp string) (clusters []model.Cluster, err error)
type CommonRepo ¶
type CommonRepo struct { }
func NewCommonRepo ¶
func NewCommonRepo() *CommonRepo
func (*CommonRepo) FoundByWhere ¶
FoundByWhere 查询条件
func (*CommonRepo) GetAll ¶
func (r *CommonRepo) GetAll(model interface{}, s *domain.Search) *gorm.DB
GetAll 批量查询
func (*CommonRepo) GetRelations ¶
func (r *CommonRepo) GetRelations(relation string, fs map[string]interface{}) []*domain.Relate
GetRelations 转换前端获取关联关系为 []*Relate
func (*CommonRepo) GetSearch ¶
func (r *CommonRepo) GetSearch(key, search string) *domain.Filed
GetSearch 转换前端查询关系为 *Filed
func (*CommonRepo) IsNotFound ¶
func (r *CommonRepo) IsNotFound(err error) bool
IsNotFound 判断是否是查询不存在错误
type ComputerRepo ¶
type ComputerRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewComputerRepo ¶
func NewComputerRepo() *ComputerRepo
func (*ComputerRepo) AddInstCount ¶
func (r *ComputerRepo) AddInstCount(id uint)
func (*ComputerRepo) Create ¶
func (r *ComputerRepo) Create(computer *model.Computer)
func (*ComputerRepo) GetByIndent ¶
func (r *ComputerRepo) GetByIndent(ident string) (ret model.Computer)
type ContainerImageRepo ¶
type ContainerImageRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewContainerImageRepo ¶
func NewContainerImageRepo() *ContainerImageRepo
func (*ContainerImageRepo) Get ¶
func (r *ContainerImageRepo) Get(id uint) (image model.ContainerImage)
func (*ContainerImageRepo) GetByEnv ¶
func (r *ContainerImageRepo) GetByEnv(env base.TestEnv) (image model.ContainerImage)
func (*ContainerImageRepo) QueryByBrowser ¶
func (r *ContainerImageRepo) QueryByBrowser(browserType _const.BrowserType, ver string) (ids []int)
func (*ContainerImageRepo) QueryByOs ¶
func (r *ContainerImageRepo) QueryByOs(platform _const.OsPlatform, osType _const.OsType, osLang _const.SysLang) (ids []int)
type ContainerRepo ¶
type ContainerRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewContainerRepo ¶
func NewContainerRepo() *ContainerRepo
func (*ContainerRepo) DestroyMissedContainersStatus ¶
func (r *ContainerRepo) DestroyMissedContainersStatus(containers []string, hostId uint)
func (*ContainerRepo) FailToCreate ¶
func (r *ContainerRepo) FailToCreate(id uint, msg string)
func (*ContainerRepo) GetById ¶
func (r *ContainerRepo) GetById(id uint) (container model.Container)
func (*ContainerRepo) Launch ¶
func (r *ContainerRepo) Launch(container _domain.Container)
func (*ContainerRepo) QueryForDestroy ¶
func (r *ContainerRepo) QueryForDestroy() (containers []model.Container)
func (*ContainerRepo) Register ¶
func (r *ContainerRepo) Register(container _domain.Container) (err error)
func (*ContainerRepo) Save ¶
func (r *ContainerRepo) Save(po model.Container)
func (*ContainerRepo) UpdateStatusByNames ¶
func (r *ContainerRepo) UpdateStatusByNames(containers []string, status _const.VmStatus)
type DeviceRepo ¶
type DeviceRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewDeviceRepo ¶
func NewDeviceRepo() *DeviceRepo
func (*DeviceRepo) GetBySerial ¶
func (r *DeviceRepo) GetBySerial(serial string) (device model.Device)
func (*DeviceRepo) Register ¶
func (r *DeviceRepo) Register(device _domain.DeviceInst) (err error)
type EnvRepo ¶
type EnvRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewEnvRepo ¶
func NewEnvRepo() *EnvRepo
func (*EnvRepo) ListBrowserType ¶
func (r *EnvRepo) ListBrowserType() (list []model.BrowserType)
func (*EnvRepo) ListOsLang ¶
func (*EnvRepo) ListOsPlatform ¶
func (r *EnvRepo) ListOsPlatform() (list []model.OsPlatform)
func (*EnvRepo) ListOsType ¶
type ExecRepo ¶
type ExecRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewExecRepo ¶
func NewExecRepo() *ExecRepo
func (*ExecRepo) DeleteInSameGroup ¶
type IsoRepo ¶
type IsoRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewIsoRepo ¶
func NewIsoRepo() *IsoRepo
type PermRepo ¶
type PermRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewPermRepo ¶
func NewPermRepo() *PermRepo
func (*PermRepo) CreatePermission ¶
func (r *PermRepo) CreatePermission(perm *model.Permission) error
CreatePermission create permission
func (*PermRepo) DeletePermissionById ¶
DeletePermissionById del permission by id
func (*PermRepo) GetAllPermissions ¶
GetAllPermissions get all permissions
func (*PermRepo) GetPermission ¶
GetPermission get permission
func (*PermRepo) NewPermission ¶
func (r *PermRepo) NewPermission() *model.Permission
func (*PermRepo) PermTransform ¶
func (r *PermRepo) PermTransform(perm *model.Permission) *transformer.Permission
func (*PermRepo) PermsTransform ¶
func (r *PermRepo) PermsTransform(perms []*model.Permission) []*transformer.Permission
func (*PermRepo) UpdatePermission ¶
func (r *PermRepo) UpdatePermission(id uint, pj *model.Permission) error
UpdatePermission update permission
type PlanRepo ¶
type PlanRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewPlanRepo ¶
func NewPlanRepo() *PlanRepo
func (*PlanRepo) SetProgress ¶
func (r *PlanRepo) SetProgress(planId uint, progress _const.BuildProgress) (err error)
func (*PlanRepo) SetResult ¶
func (r *PlanRepo) SetResult(planId uint, progress _const.BuildProgress, status _const.BuildStatus) (err error)
type QueueRepo ¶
type QueueRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewQueueRepo ¶
func NewQueueRepo() *QueueRepo
func (*QueueRepo) QueryForExec ¶
func (*QueueRepo) QueryForRetry ¶
func (*QueueRepo) QueryTimeout ¶
func (*QueueRepo) SetAndLaunchVm ¶
func (*QueueRepo) SetQueueStatus ¶
func (r *QueueRepo) SetQueueStatus(queueId uint, progress _const.BuildProgress, status _const.BuildStatus)
func (*QueueRepo) SetTimeout ¶
type RoleRepo ¶
type RoleRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewRoleRepo ¶
func NewRoleRepo() *RoleRepo
func (*RoleRepo) DeleteRoleById ¶
DeleteRoleById del role by id
func (*RoleRepo) GetAllRoles ¶
GetAllRoles get all roles
type TaskRepo ¶
type TaskRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewTaskRepo ¶
func NewTaskRepo() *TaskRepo
func (*TaskRepo) SetProgress ¶
func (r *TaskRepo) SetProgress(taskId uint, progress _const.BuildProgress) (err error)
func (*TaskRepo) SetResult ¶
func (r *TaskRepo) SetResult(taskId uint, progress _const.BuildProgress, status _const.BuildStatus) (err error)
type TokenRepo ¶
type TokenRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewTokenRepo ¶
func NewTokenRepo() *TokenRepo
func (*TokenRepo) CacheToRedis ¶
func (r *TokenRepo) CacheToRedis(conn *redisUtils.RedisCluster, cred domain.UserCredentials, token string) error
func (*TokenRepo) CleanUserTokenCache ¶
func (r *TokenRepo) CleanUserTokenCache(conn *redisUtils.RedisCluster, rs domain.UserCredentials) error
func (*TokenRepo) DelTokenCache ¶
func (r *TokenRepo) DelTokenCache(conn *redisUtils.RedisCluster, rs domain.UserCredentials, token string) error
func (*TokenRepo) DelUserTokenCache ¶
func (r *TokenRepo) DelUserTokenCache(conn *redisUtils.RedisCluster, rs domain.UserCredentials, token string) error
func (*TokenRepo) GetRedisSession ¶
func (r *TokenRepo) GetRedisSession(conn *redisUtils.RedisCluster, token string) (*domain.UserCredentials, error)
func (*TokenRepo) GetTokenExpire ¶
func (r *TokenRepo) GetTokenExpire(rs domain.UserCredentials) time.Duration
func (*TokenRepo) GetUserScope ¶
func (*TokenRepo) GetWebSession ¶
func (r *TokenRepo) GetWebSession(conn *redisUtils.RedisCluster, token string) (*domain.UserCredentials, error)
func (*TokenRepo) IsUserTokenOver ¶
func (*TokenRepo) SyncUserTokenCache ¶
func (r *TokenRepo) SyncUserTokenCache(conn *redisUtils.RedisCluster, cred domain.UserCredentials, token string) error
func (*TokenRepo) UpdateUserTokenCacheExpire ¶
func (r *TokenRepo) UpdateUserTokenCacheExpire(conn *redisUtils.RedisCluster, rs domain.UserCredentials, token string) error
func (*TokenRepo) UserTokenExpired ¶
type UserRepo ¶
type UserRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewUserRepo ¶
func NewUserRepo() *UserRepo
func (*UserRepo) DeleteUser ¶
DeleteUser del user . if user's username is username ,can't del it.
func (*UserRepo) GetAllUsers ¶
GetAllUsers get all users
func (*UserRepo) UpdateRefreshToken ¶
type VmRepo ¶
type VmRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func (*VmRepo) FailToCreate ¶
func (*VmRepo) QueryForDestroy ¶
type VmTemplRepo ¶
type VmTemplRepo struct { CommonRepo DB *gorm.DB `inject:""` }
func NewVmTemplRepo ¶
func NewVmTemplRepo() *VmTemplRepo
func (*VmTemplRepo) Create ¶
func (r *VmTemplRepo) Create(templ *model.VmTempl)
func (*VmTemplRepo) GetByEnv ¶
func (r *VmTemplRepo) GetByEnv(env base.TestEnv) (templ model.VmTempl)
func (*VmTemplRepo) GetByIdent ¶
func (r *VmTemplRepo) GetByIdent(ident, computer, cluster string) (templ model.VmTempl)
func (*VmTemplRepo) UpdateAllSameName ¶
func (r *VmTemplRepo) UpdateAllSameName(templ *model.VmTempl) (err error)
Click to show internal directories.
Click to hide internal directories.