repo

package
v0.0.0-...-6c3f565 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithByAddr

func WithByAddr(addr string) global.DBOption

func WithByGroupID

func WithByGroupID(id uint) global.DBOption

func WithByID

func WithByID(id uint) global.DBOption

func WithByIDs

func WithByIDs(ids []uint) global.DBOption

func WithByKey

func WithByKey(key string) global.DBOption

func WithByName

func WithByName(name string) global.DBOption

func WithByNode

func WithByNode(node string) global.DBOption

func WithByStatus

func WithByStatus(status string) global.DBOption

func WithByType

func WithByType(ty string) global.DBOption

func WithOrderAsc

func WithOrderAsc(orderBy string) global.DBOption

func WithOrderDesc

func WithOrderDesc(orderBy string) global.DBOption

func WithOrderRuleBy

func WithOrderRuleBy(orderBy, order string) global.DBOption

func WithoutByName

func WithoutByName(name string) global.DBOption

Types

type AgentRepo

type AgentRepo struct{}

func (*AgentRepo) GetCA

func (a *AgentRepo) GetCA(opts ...global.DBOption) (model.WebsiteCA, error)

func (*AgentRepo) GetWebsiteSSL

func (a *AgentRepo) GetWebsiteSSL(opts ...global.DBOption) (model.WebsiteSSL, error)

type BackupRepo

type BackupRepo struct{}

func (*BackupRepo) Create

func (u *BackupRepo) Create(backup *model.BackupAccount) error

func (*BackupRepo) Delete

func (u *BackupRepo) Delete(opts ...global.DBOption) 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) Create

func (u *CommandRepo) Create(command *model.Command) error

func (*CommandRepo) Delete

func (u *CommandRepo) Delete(opts ...global.DBOption) error

func (*CommandRepo) Get

func (u *CommandRepo) Get(opts ...global.DBOption) (model.Command, error)

func (*CommandRepo) List

func (u *CommandRepo) List(opts ...global.DBOption) ([]model.Command, error)

func (*CommandRepo) Page

func (u *CommandRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.Command, error)

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

func (u *GroupRepo) CancelDefault(groupType string) error

func (*GroupRepo) Create

func (u *GroupRepo) Create(group *model.Group) error

func (*GroupRepo) Delete

func (u *GroupRepo) Delete(opts ...global.DBOption) error

func (*GroupRepo) Get

func (u *GroupRepo) Get(opts ...global.DBOption) (model.Group, error)

func (*GroupRepo) GetList

func (u *GroupRepo) GetList(opts ...global.DBOption) ([]model.Group, error)

func (*GroupRepo) Update

func (u *GroupRepo) Update(id uint, vars map[string]interface{}) error

func (*GroupRepo) WithByDefault

func (c *GroupRepo) WithByDefault(isDefault bool) global.DBOption

type HostRepo

type HostRepo struct{}

func (*HostRepo) Create

func (h *HostRepo) Create(host *model.Host) error

func (*HostRepo) Delete

func (h *HostRepo) Delete(opts ...global.DBOption) error

func (*HostRepo) Get

func (h *HostRepo) Get(opts ...global.DBOption) (model.Host, error)

func (*HostRepo) GetList

func (h *HostRepo) GetList(opts ...global.DBOption) ([]model.Host, error)

func (*HostRepo) Page

func (h *HostRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.Host, error)

func (*HostRepo) Update

func (h *HostRepo) Update(id uint, vars map[string]interface{}) error

func (*HostRepo) UpdateGroup

func (h *HostRepo) UpdateGroup(group, newGroup uint) error

func (*HostRepo) WithByInfo

func (h *HostRepo) WithByInfo(info string) global.DBOption

func (*HostRepo) WithByPort

func (h *HostRepo) WithByPort(port uint) global.DBOption

func (*HostRepo) WithByUser

func (h *HostRepo) WithByUser(user string) global.DBOption

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 (u *LogRepo) CleanLogin() error

func (*LogRepo) CleanOperation

func (u *LogRepo) CleanOperation() error

func (*LogRepo) CreateLoginLog

func (u *LogRepo) CreateLoginLog(log *model.LoginLog) error

func (*LogRepo) CreateOperationLog

func (u *LogRepo) CreateOperationLog(log *model.OperationLog) error

func (*LogRepo) PageLoginLog

func (u *LogRepo) PageLoginLog(page, size int, opts ...global.DBOption) (int64, []model.LoginLog, error)

func (*LogRepo) PageOperationLog

func (u *LogRepo) PageOperationLog(page, size int, opts ...global.DBOption) (int64, []model.OperationLog, error)

func (*LogRepo) WithByIP

func (c *LogRepo) WithByIP(ip string) global.DBOption

func (*LogRepo) WithByLikeOperation

func (c *LogRepo) WithByLikeOperation(operation string) global.DBOption

func (*LogRepo) WithBySource

func (c *LogRepo) WithBySource(source string) global.DBOption

func (*LogRepo) WithByStatus

func (c *LogRepo) WithByStatus(status string) global.DBOption

type ScriptRepo

type ScriptRepo struct{}

func (*ScriptRepo) Create

func (u *ScriptRepo) Create(ScriptLibrary *model.ScriptLibrary) error

func (*ScriptRepo) Delete

func (u *ScriptRepo) Delete(opts ...global.DBOption) 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) Update

func (u *ScriptRepo) Update(id uint, vars map[string]interface{}) 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) Get

func (u *SettingRepo) Get(opts ...global.DBOption) (model.Setting, error)

func (*SettingRepo) GetValueByKey

func (u *SettingRepo) GetValueByKey(key string) (string, error)

func (*SettingRepo) List

func (u *SettingRepo) List(opts ...global.DBOption) ([]model.Setting, error)

func (*SettingRepo) Update

func (u *SettingRepo) Update(key, value string) error

func (*SettingRepo) UpdateOrCreate

func (u *SettingRepo) UpdateOrCreate(key, value string) error

type TaskRepo

type TaskRepo struct {
}

func (TaskRepo) GetFirst

func (t TaskRepo) GetFirst(opts ...global.DBOption) (model.Task, error)

func (TaskRepo) Page

func (t TaskRepo) Page(page, size int, opts ...global.DBOption) (int64, []model.Task, error)

func (TaskRepo) Save

func (t TaskRepo) Save(ctx context.Context, task *model.Task) error

func (TaskRepo) Update

func (t TaskRepo) Update(ctx context.Context, task *model.Task) error

func (TaskRepo) WithByID

func (t TaskRepo) WithByID(id string) global.DBOption

func (TaskRepo) WithOperate

func (t TaskRepo) WithOperate(taskOperate string) global.DBOption

func (TaskRepo) WithResourceID

func (t TaskRepo) WithResourceID(id uint) global.DBOption

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) Delete

func (u *UpgradeLogRepo) Delete(opts ...global.DBOption) 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

Jump to

Keyboard shortcuts

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