Documentation
¶
Index ¶
- func WithByAddr(addr string) global.DBOption
- func WithByGroupID(id uint) global.DBOption
- func WithByID(id uint) global.DBOption
- func WithByIDs(ids []uint) global.DBOption
- func WithByKey(key string) global.DBOption
- func WithByName(name string) global.DBOption
- func WithByNode(node string) global.DBOption
- func WithByStatus(status string) global.DBOption
- func WithByType(ty string) global.DBOption
- func WithOrderAsc(orderBy string) global.DBOption
- func WithOrderDesc(orderBy string) global.DBOption
- func WithOrderRuleBy(orderBy, order string) global.DBOption
- func WithoutByName(name string) global.DBOption
- type AgentRepo
- type BackupRepo
- func (u *BackupRepo) Create(backup *model.BackupAccount) error
- func (u *BackupRepo) Delete(opts ...global.DBOption) error
- func (u *BackupRepo) Get(opts ...global.DBOption) (model.BackupAccount, error)
- func (u *BackupRepo) List(opts ...global.DBOption) ([]model.BackupAccount, error)
- func (u *BackupRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.BackupAccount, error)
- func (u *BackupRepo) Save(backup *model.BackupAccount) error
- type CommandRepo
- func (u *CommandRepo) Create(command *model.Command) error
- func (u *CommandRepo) Delete(opts ...global.DBOption) error
- func (u *CommandRepo) Get(opts ...global.DBOption) (model.Command, error)
- func (u *CommandRepo) List(opts ...global.DBOption) ([]model.Command, error)
- func (u *CommandRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.Command, error)
- func (u *CommandRepo) Update(id uint, vars map[string]interface{}) error
- func (h *CommandRepo) UpdateGroup(group, newGroup uint) error
- func (c *CommandRepo) WithByInfo(info string) global.DBOption
- type GroupRepo
- func (u *GroupRepo) CancelDefault(groupType string) error
- func (u *GroupRepo) Create(group *model.Group) error
- func (u *GroupRepo) Delete(opts ...global.DBOption) error
- func (u *GroupRepo) Get(opts ...global.DBOption) (model.Group, error)
- func (u *GroupRepo) GetList(opts ...global.DBOption) ([]model.Group, error)
- func (u *GroupRepo) Update(id uint, vars map[string]interface{}) error
- func (c *GroupRepo) WithByDefault(isDefault bool) global.DBOption
- type HostRepo
- func (h *HostRepo) Create(host *model.Host) error
- func (h *HostRepo) Delete(opts ...global.DBOption) error
- func (h *HostRepo) Get(opts ...global.DBOption) (model.Host, error)
- func (h *HostRepo) GetList(opts ...global.DBOption) ([]model.Host, error)
- func (h *HostRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.Host, error)
- func (h *HostRepo) Update(id uint, vars map[string]interface{}) error
- func (h *HostRepo) UpdateGroup(group, newGroup uint) error
- func (h *HostRepo) WithByInfo(info string) global.DBOption
- func (h *HostRepo) WithByPort(port uint) global.DBOption
- func (h *HostRepo) WithByUser(user string) global.DBOption
- type IAgentRepo
- type IBackupRepo
- type ICommandRepo
- type IGroupRepo
- type IHostRepo
- type ILogRepo
- type IScriptRepo
- type ISettingRepo
- type ITaskRepo
- type IUpgradeLogRepo
- type LogRepo
- func (u *LogRepo) CleanLogin() error
- func (u *LogRepo) CleanOperation() error
- func (u *LogRepo) CreateLoginLog(log *model.LoginLog) error
- func (u *LogRepo) CreateOperationLog(log *model.OperationLog) error
- func (u *LogRepo) PageLoginLog(page, size int, opts ...global.DBOption) (int64, []model.LoginLog, error)
- func (u *LogRepo) PageOperationLog(page, size int, opts ...global.DBOption) (int64, []model.OperationLog, error)
- func (c *LogRepo) WithByIP(ip string) global.DBOption
- func (c *LogRepo) WithByLikeOperation(operation string) global.DBOption
- func (c *LogRepo) WithBySource(source string) global.DBOption
- func (c *LogRepo) WithByStatus(status string) global.DBOption
- type ScriptRepo
- func (u *ScriptRepo) Create(ScriptLibrary *model.ScriptLibrary) error
- func (u *ScriptRepo) Delete(opts ...global.DBOption) error
- func (u *ScriptRepo) Get(opts ...global.DBOption) (model.ScriptLibrary, error)
- func (u *ScriptRepo) GetList(opts ...global.DBOption) ([]model.ScriptLibrary, error)
- func (u *ScriptRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.ScriptLibrary, error)
- func (u *ScriptRepo) SyncAll(scripts []model.ScriptLibrary) error
- func (u *ScriptRepo) Update(id uint, vars map[string]interface{}) error
- func (u *ScriptRepo) WithByInfo(info string) global.DBOption
- type SettingRepo
- func (u *SettingRepo) Create(key, value string) error
- func (u *SettingRepo) DefaultMenu() error
- func (u *SettingRepo) Get(opts ...global.DBOption) (model.Setting, error)
- func (u *SettingRepo) GetValueByKey(key string) (string, error)
- func (u *SettingRepo) List(opts ...global.DBOption) ([]model.Setting, error)
- func (u *SettingRepo) Update(key, value string) error
- func (u *SettingRepo) UpdateOrCreate(key, value string) error
- type TaskRepo
- func (t TaskRepo) GetFirst(opts ...global.DBOption) (model.Task, error)
- func (t TaskRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.Task, error)
- func (t TaskRepo) Save(ctx context.Context, task *model.Task) error
- func (t TaskRepo) Update(ctx context.Context, task *model.Task) error
- func (t TaskRepo) WithByID(id string) global.DBOption
- func (t TaskRepo) WithOperate(taskOperate string) global.DBOption
- func (t TaskRepo) WithResourceID(id uint) global.DBOption
- type UpgradeLogRepo
- func (u *UpgradeLogRepo) Clean() error
- func (u *UpgradeLogRepo) Create(log *model.UpgradeLog) error
- func (u *UpgradeLogRepo) Delete(opts ...global.DBOption) error
- func (u *UpgradeLogRepo) Get(opts ...global.DBOption) (model.UpgradeLog, error)
- func (u *UpgradeLogRepo) List(opts ...global.DBOption) ([]model.UpgradeLog, error)
- func (u *UpgradeLogRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.UpgradeLog, error)
- func (u *UpgradeLogRepo) Save(log *model.UpgradeLog) error
- func (c *UpgradeLogRepo) WithByNodeID(nodeID uint) global.DBOption
- func (c *UpgradeLogRepo) WithByUpgradeVersion(oldVersion, newVersion string) global.DBOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithByAddr ¶
func WithByGroupID ¶
func WithByName ¶
func WithByNode ¶
func WithByStatus ¶
func WithByType ¶
func WithOrderAsc ¶
func WithOrderDesc ¶
func WithOrderRuleBy ¶
func WithoutByName ¶
Types ¶
type AgentRepo ¶
type AgentRepo struct{}
func (*AgentRepo) GetWebsiteSSL ¶
type BackupRepo ¶
type BackupRepo struct{}
func (*BackupRepo) Create ¶
func (u *BackupRepo) Create(backup *model.BackupAccount) error
func (*BackupRepo) Get ¶
func (u *BackupRepo) Get(opts ...global.DBOption) (model.BackupAccount, error)
func (*BackupRepo) List ¶
func (u *BackupRepo) List(opts ...global.DBOption) ([]model.BackupAccount, error)
func (*BackupRepo) Page ¶
func (u *BackupRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.BackupAccount, error)
func (*BackupRepo) Save ¶
func (u *BackupRepo) Save(backup *model.BackupAccount) error
type CommandRepo ¶
type CommandRepo struct{}
func (*CommandRepo) Update ¶
func (u *CommandRepo) Update(id uint, vars map[string]interface{}) error
func (*CommandRepo) UpdateGroup ¶
func (h *CommandRepo) UpdateGroup(group, newGroup uint) error
func (*CommandRepo) WithByInfo ¶
func (c *CommandRepo) WithByInfo(info string) global.DBOption
type GroupRepo ¶
type GroupRepo struct{}
func (*GroupRepo) CancelDefault ¶
type HostRepo ¶
type HostRepo struct{}
func (*HostRepo) UpdateGroup ¶
type IAgentRepo ¶
type IAgentRepo interface {
GetWebsiteSSL(opts ...global.DBOption) (model.WebsiteSSL, error)
GetCA(opts ...global.DBOption) (model.WebsiteCA, error)
}
func NewIAgentRepo ¶
func NewIAgentRepo() IAgentRepo
type IBackupRepo ¶
type IBackupRepo interface {
Get(opts ...global.DBOption) (model.BackupAccount, error)
List(opts ...global.DBOption) ([]model.BackupAccount, error)
Page(limit, offset int, opts ...global.DBOption) (int64, []model.BackupAccount, error)
Create(backup *model.BackupAccount) error
Save(backup *model.BackupAccount) error
Delete(opts ...global.DBOption) error
}
func NewIBackupRepo ¶
func NewIBackupRepo() IBackupRepo
type ICommandRepo ¶
type ICommandRepo interface {
List(opts ...global.DBOption) ([]model.Command, error)
Page(limit, offset int, opts ...global.DBOption) (int64, []model.Command, error)
Create(command *model.Command) error
Update(id uint, vars map[string]interface{}) error
UpdateGroup(group, newGroup uint) error
Delete(opts ...global.DBOption) error
Get(opts ...global.DBOption) (model.Command, error)
WithByInfo(info string) global.DBOption
}
func NewICommandRepo ¶
func NewICommandRepo() ICommandRepo
type IGroupRepo ¶
type IGroupRepo interface {
Get(opts ...global.DBOption) (model.Group, error)
GetList(opts ...global.DBOption) ([]model.Group, error)
Create(group *model.Group) error
Update(id uint, vars map[string]interface{}) error
Delete(opts ...global.DBOption) error
WithByDefault(isDefault bool) global.DBOption
CancelDefault(groupType string) error
}
func NewIGroupRepo ¶
func NewIGroupRepo() IGroupRepo
type IHostRepo ¶
type IHostRepo interface {
Get(opts ...global.DBOption) (model.Host, error)
GetList(opts ...global.DBOption) ([]model.Host, error)
Page(limit, offset int, opts ...global.DBOption) (int64, []model.Host, error)
Create(host *model.Host) error
Update(id uint, vars map[string]interface{}) error
UpdateGroup(group, newGroup uint) error
Delete(opts ...global.DBOption) error
WithByInfo(info string) global.DBOption
WithByPort(port uint) global.DBOption
WithByUser(user string) global.DBOption
}
func NewIHostRepo ¶
func NewIHostRepo() IHostRepo
type ILogRepo ¶
type ILogRepo interface {
CleanLogin() error
CreateLoginLog(user *model.LoginLog) error
PageLoginLog(limit, offset int, opts ...global.DBOption) (int64, []model.LoginLog, error)
CleanOperation() error
CreateOperationLog(user *model.OperationLog) error
PageOperationLog(limit, offset int, opts ...global.DBOption) (int64, []model.OperationLog, error)
WithByIP(ip string) global.DBOption
WithBySource(source string) global.DBOption
WithByLikeOperation(operation string) global.DBOption
}
func NewILogRepo ¶
func NewILogRepo() ILogRepo
type IScriptRepo ¶
type IScriptRepo interface {
Get(opts ...global.DBOption) (model.ScriptLibrary, error)
GetList(opts ...global.DBOption) ([]model.ScriptLibrary, error)
Create(script *model.ScriptLibrary) error
Update(id uint, vars map[string]interface{}) error
Page(limit, offset int, opts ...global.DBOption) (int64, []model.ScriptLibrary, error)
Delete(opts ...global.DBOption) error
SyncAll(scripts []model.ScriptLibrary) error
WithByInfo(info string) global.DBOption
}
func NewIScriptRepo ¶
func NewIScriptRepo() IScriptRepo
type ISettingRepo ¶
type ISettingRepo interface {
List(opts ...global.DBOption) ([]model.Setting, error)
Get(opts ...global.DBOption) (model.Setting, error)
GetValueByKey(key string) (string, error)
Create(key, value string) error
Update(key, value string) error
UpdateOrCreate(key, value string) error
DefaultMenu() error
}
func NewISettingRepo ¶
func NewISettingRepo() ISettingRepo
type ITaskRepo ¶
type ITaskRepo interface {
Save(ctx context.Context, task *model.Task) error
GetFirst(opts ...global.DBOption) (model.Task, error)
Page(page, size int, opts ...global.DBOption) (int64, []model.Task, error)
Update(ctx context.Context, task *model.Task) error
WithByID(id string) global.DBOption
WithResourceID(id uint) global.DBOption
WithOperate(taskOperate string) global.DBOption
}
func NewITaskRepo ¶
func NewITaskRepo() ITaskRepo
type IUpgradeLogRepo ¶
type IUpgradeLogRepo interface {
Get(opts ...global.DBOption) (model.UpgradeLog, error)
List(opts ...global.DBOption) ([]model.UpgradeLog, error)
Create(log *model.UpgradeLog) error
Page(limit, offset int, opts ...global.DBOption) (int64, []model.UpgradeLog, error)
Delete(opts ...global.DBOption) error
WithByNodeID(nodeID uint) global.DBOption
WithByUpgradeVersion(oldVersion, newVersion string) global.DBOption
}
func NewIUpgradeLogRepo ¶
func NewIUpgradeLogRepo() IUpgradeLogRepo
type LogRepo ¶
type LogRepo struct{}
func (*LogRepo) CleanLogin ¶
func (*LogRepo) CleanOperation ¶
func (*LogRepo) CreateOperationLog ¶
func (u *LogRepo) CreateOperationLog(log *model.OperationLog) error
func (*LogRepo) PageLoginLog ¶
func (*LogRepo) PageOperationLog ¶
func (*LogRepo) WithByLikeOperation ¶
type ScriptRepo ¶
type ScriptRepo struct{}
func (*ScriptRepo) Create ¶
func (u *ScriptRepo) Create(ScriptLibrary *model.ScriptLibrary) error
func (*ScriptRepo) Get ¶
func (u *ScriptRepo) Get(opts ...global.DBOption) (model.ScriptLibrary, error)
func (*ScriptRepo) GetList ¶
func (u *ScriptRepo) GetList(opts ...global.DBOption) ([]model.ScriptLibrary, error)
func (*ScriptRepo) Page ¶
func (u *ScriptRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.ScriptLibrary, error)
func (*ScriptRepo) SyncAll ¶
func (u *ScriptRepo) SyncAll(scripts []model.ScriptLibrary) error
func (*ScriptRepo) WithByInfo ¶
func (u *ScriptRepo) WithByInfo(info string) global.DBOption
type SettingRepo ¶
type SettingRepo struct{}
func (*SettingRepo) Create ¶
func (u *SettingRepo) Create(key, value string) error
func (*SettingRepo) DefaultMenu ¶
func (u *SettingRepo) DefaultMenu() error
func (*SettingRepo) GetValueByKey ¶
func (u *SettingRepo) GetValueByKey(key string) (string, error)
func (*SettingRepo) Update ¶
func (u *SettingRepo) Update(key, value string) error
func (*SettingRepo) UpdateOrCreate ¶
func (u *SettingRepo) UpdateOrCreate(key, value string) error
type UpgradeLogRepo ¶
type UpgradeLogRepo struct{}
func (*UpgradeLogRepo) Clean ¶
func (u *UpgradeLogRepo) Clean() error
func (*UpgradeLogRepo) Create ¶
func (u *UpgradeLogRepo) Create(log *model.UpgradeLog) error
func (*UpgradeLogRepo) Get ¶
func (u *UpgradeLogRepo) Get(opts ...global.DBOption) (model.UpgradeLog, error)
func (*UpgradeLogRepo) List ¶
func (u *UpgradeLogRepo) List(opts ...global.DBOption) ([]model.UpgradeLog, error)
func (*UpgradeLogRepo) Page ¶
func (u *UpgradeLogRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.UpgradeLog, error)
func (*UpgradeLogRepo) Save ¶
func (u *UpgradeLogRepo) Save(log *model.UpgradeLog) error
func (*UpgradeLogRepo) WithByNodeID ¶
func (c *UpgradeLogRepo) WithByNodeID(nodeID uint) global.DBOption
func (*UpgradeLogRepo) WithByUpgradeVersion ¶
func (c *UpgradeLogRepo) WithByUpgradeVersion(oldVersion, newVersion string) global.DBOption
Click to show internal directories.
Click to hide internal directories.