service

package
v0.0.0-...-2fcfe56 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: GPL-3.0 Imports: 58 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseTerminalSessions

func CloseTerminalSessions(scope, userID, authSessionID string)

func LoadScriptInfo

func LoadScriptInfo(id uint) (model.ScriptLibrary, error)

func SetSecurityEntranceCookie

func SetSecurityEntranceCookie(c *gin.Context, entrance string)

func StartSync

func StartSync()

func SyncScriptLibraryOnStartup

func SyncScriptLibraryOnStartup()

Types

type AuthService

type AuthService struct{}

func (*AuthService) GetResponsePage

func (u *AuthService) GetResponsePage() (string, error)

func (*AuthService) GetSecurityEntrance

func (u *AuthService) GetSecurityEntrance() string

func (*AuthService) IsLogin

func (u *AuthService) IsLogin(c *gin.Context) bool

func (*AuthService) LogOut

func (u *AuthService) LogOut(c *gin.Context) error

func (*AuthService) PasskeyBeginLogin

func (u *AuthService) PasskeyBeginLogin(c *gin.Context, entrance string) (*dto.PasskeyBeginResponse, string, error)

func (*AuthService) PasskeyBeginRegister

func (u *AuthService) PasskeyBeginRegister(c *gin.Context, name string) (*dto.PasskeyBeginResponse, string, error)

func (*AuthService) PasskeyDelete

func (u *AuthService) PasskeyDelete(id string) error

func (*AuthService) PasskeyFinishLogin

func (u *AuthService) PasskeyFinishLogin(c *gin.Context, sessionID, entrance string) (*dto.UserLoginInfo, string, error)

func (*AuthService) PasskeyFinishRegister

func (u *AuthService) PasskeyFinishRegister(c *gin.Context, sessionID string) (string, error)

func (*AuthService) PasskeyList

func (u *AuthService) PasskeyList() ([]dto.PasskeyInfo, error)

func (*AuthService) PasskeyStatus

func (u *AuthService) PasskeyStatus(c *gin.Context) bool

func (*AuthService) VerifyCode

func (u *AuthService) VerifyCode(code string) (bool, error)

type BackupService

type BackupService struct{}

func (*BackupService) Create

func (u *BackupService) Create(req dto.BackupOperate) error

func (*BackupService) Delete

func (u *BackupService) Delete(name string) error

func (*BackupService) LoadBackupClientInfo

func (u *BackupService) LoadBackupClientInfo(clientType string) (dto.BackupClientInfo, error)

func (*BackupService) RefreshToken

func (u *BackupService) RefreshToken(req dto.OperateByName) error

func (*BackupService) Update

func (u *BackupService) Update(req dto.BackupOperate) error

type CommandService

type CommandService struct{}

func (*CommandService) Create

func (u *CommandService) Create(req dto.CommandOperate) error

func (*CommandService) Delete

func (u *CommandService) Delete(ids []uint) error

func (*CommandService) Export

func (u *CommandService) Export() (string, error)

func (*CommandService) List

func (*CommandService) SearchForTree

func (u *CommandService) SearchForTree(req dto.OperateByType) ([]dto.CommandTree, error)

func (*CommandService) SearchWithPage

func (u *CommandService) SearchWithPage(req dto.SearchCommandWithPage) (int64, interface{}, error)

func (*CommandService) Update

func (u *CommandService) Update(req dto.CommandOperate) error

type GroupService

type GroupService struct{}

func (*GroupService) Create

func (u *GroupService) Create(req dto.GroupCreate) error

func (*GroupService) Delete

func (u *GroupService) Delete(id uint) error

func (*GroupService) List

func (u *GroupService) List(req dto.OperateByType) ([]dto.GroupInfo, error)

func (*GroupService) Update

func (u *GroupService) Update(req dto.GroupUpdate) error

type IAuthService

type IAuthService interface {
	GetResponsePage() (string, error)
	VerifyCode(code string) (bool, error)
	LogOut(c *gin.Context) error
	PasskeyBeginLogin(c *gin.Context, entrance string) (*dto.PasskeyBeginResponse, string, error)
	PasskeyFinishLogin(c *gin.Context, sessionID, entrance string) (*dto.UserLoginInfo, string, error)
	PasskeyBeginRegister(c *gin.Context, name string) (*dto.PasskeyBeginResponse, string, error)
	PasskeyFinishRegister(c *gin.Context, sessionID string) (string, error)
	PasskeyList() ([]dto.PasskeyInfo, error)
	PasskeyDelete(id string) error
	PasskeyStatus(c *gin.Context) bool
	GetSecurityEntrance() string
	IsLogin(c *gin.Context) bool
}

func NewIAuthService

func NewIAuthService() IAuthService

type IBackupService

type IBackupService interface {
	LoadBackupClientInfo(clientType string) (dto.BackupClientInfo, error)
	Create(backupDto dto.BackupOperate) error
	Update(req dto.BackupOperate) error
	Delete(name string) error
	RefreshToken(req dto.OperateByName) error
}

func NewIBackupService

func NewIBackupService() IBackupService

type ICommandService

type ICommandService interface {
	List(req dto.OperateByType) ([]dto.CommandInfo, error)
	SearchForTree(req dto.OperateByType) ([]dto.CommandTree, error)
	SearchWithPage(search dto.SearchCommandWithPage) (int64, interface{}, error)
	Create(req dto.CommandOperate) error
	Update(req dto.CommandOperate) error
	Delete(ids []uint) error

	Export() (string, error)
}

func NewICommandService

func NewICommandService() ICommandService

type IGroupService

type IGroupService interface {
	List(req dto.OperateByType) ([]dto.GroupInfo, error)
	Create(req dto.GroupCreate) error
	Update(req dto.GroupUpdate) error
	Delete(id uint) error
}

func NewIGroupService

func NewIGroupService() IGroupService

type ILogService

type ILogService interface {
	CreateLoginLog(operation model.LoginLog) error
	PageLoginLog(ctx *gin.Context, search dto.SearchLgLogWithPage) (int64, interface{}, error)

	CreateOperationLog(operation *model.OperationLog) error
	PageOperationLog(search dto.SearchOpLogWithPage) (int64, interface{}, error)

	CleanLogs(logtype string) error
}

func NewILogService

func NewILogService() ILogService

type IScriptService

type IScriptService interface {
	Run()
	Search(ctx *gin.Context, req dto.SearchPageWithGroup) (int64, interface{}, error)
	Create(req dto.ScriptOperate) error
	Update(req dto.ScriptOperate) error
	Delete(ids dto.OperateByIDs) error
	Sync(req dto.OperateByTaskID) error
}

func NewIScriptService

func NewIScriptService() IScriptService

type ISettingService

type ISettingService interface {
	GetSettingInfo() (*dto.SettingInfo, error)
	GetSettingBaseInfo() (*dto.SettingBaseInfo, error)
	LoadInterfaceAddr() ([]string, error)
	Update(c *gin.Context, key, value string) error
	UpdatePort(port uint) error
	UpdateBindInfo(req dto.BindInfo) error
	UpdateSSL(c *gin.Context, req dto.SSLUpdate) error
	LoadFromCert() (*dto.SSLInfo, error)

	UpdateProxy(req dto.ProxyUpdate) error

	GetTerminalInfo() (*dto.TerminalInfo, error)
	UpdateTerminal(req dto.TerminalUpdate) error

	UpdateSystemSSL() error
	GenerateRSAKey() error

	UpdateAppstoreConfig(req dto.AppstoreUpdate) error
	GetAppstoreConfig() (*dto.AppstoreConfig, error)
	DefaultMenu() error

	GetMemo() (string, error)
	UpdateMemo(content string) error
}

func NewISettingService

func NewISettingService() ISettingService

type IUpgradeService

type IUpgradeService interface {
	Upgrade(req dto.Upgrade) error
	Rollback(req dto.OperateByID) error
	LoadNotes(req dto.Upgrade) (string, error)
	SearchUpgrade() (*dto.UpgradeInfo, error)
	LoadRelease() ([]dto.ReleasesNotes, error)
}

func NewIUpgradeService

func NewIUpgradeService() IUpgradeService

type LogService

type LogService struct{}

func (*LogService) CleanLogs

func (u *LogService) CleanLogs(logtype string) error

func (*LogService) CreateLoginLog

func (u *LogService) CreateLoginLog(operation model.LoginLog) error

func (*LogService) CreateOperationLog

func (u *LogService) CreateOperationLog(operation *model.OperationLog) error

func (*LogService) PageLoginLog

func (u *LogService) PageLoginLog(ctx *gin.Context, req dto.SearchLgLogWithPage) (int64, interface{}, error)

func (*LogService) PageOperationLog

func (u *LogService) PageOperationLog(req dto.SearchOpLogWithPage) (int64, interface{}, error)

type ScriptDetail

type ScriptDetail struct {
	Sh []ScriptHelper `json:"sh"`
}

type ScriptHelper

type ScriptHelper struct {
	Key         string            `json:"key"`
	Sort        uint              `json:"sort"`
	Groups      string            `json:"groups"`
	Name        map[string]string `json:"name"`
	Interactive bool              `json:"interactive"`
	Description map[string]string `json:"description"`
}

type ScriptService

type ScriptService struct{}

func (*ScriptService) Create

func (u *ScriptService) Create(req dto.ScriptOperate) error

func (*ScriptService) Delete

func (u *ScriptService) Delete(req dto.OperateByIDs) error

func (*ScriptService) Run

func (u *ScriptService) Run()

func (*ScriptService) Search

func (u *ScriptService) Search(ctx *gin.Context, req dto.SearchPageWithGroup) (int64, interface{}, error)

func (*ScriptService) Sync

func (u *ScriptService) Sync(req dto.OperateByTaskID) error

func (*ScriptService) Update

func (u *ScriptService) Update(req dto.ScriptOperate) error

type Scripts

type Scripts struct {
	Scripts ScriptDetail `json:"scripts"`
}

type SettingService

type SettingService struct{}

func (*SettingService) DefaultMenu

func (u *SettingService) DefaultMenu() error

func (*SettingService) GenerateRSAKey

func (u *SettingService) GenerateRSAKey() error

func (*SettingService) GetAppstoreConfig

func (u *SettingService) GetAppstoreConfig() (*dto.AppstoreConfig, error)

func (*SettingService) GetMemo

func (u *SettingService) GetMemo() (string, error)

func (*SettingService) GetSettingBaseInfo

func (u *SettingService) GetSettingBaseInfo() (*dto.SettingBaseInfo, error)

func (*SettingService) GetSettingInfo

func (u *SettingService) GetSettingInfo() (*dto.SettingInfo, error)

func (*SettingService) GetTerminalInfo

func (u *SettingService) GetTerminalInfo() (*dto.TerminalInfo, error)

func (*SettingService) LoadFromCert

func (u *SettingService) LoadFromCert() (*dto.SSLInfo, error)

func (*SettingService) LoadInterfaceAddr

func (u *SettingService) LoadInterfaceAddr() ([]string, error)

func (*SettingService) Update

func (u *SettingService) Update(c *gin.Context, key, value string) error

func (*SettingService) UpdateAppstoreConfig

func (u *SettingService) UpdateAppstoreConfig(req dto.AppstoreUpdate) error

func (*SettingService) UpdateBindInfo

func (u *SettingService) UpdateBindInfo(req dto.BindInfo) error

func (*SettingService) UpdateMemo

func (u *SettingService) UpdateMemo(content string) error

func (*SettingService) UpdatePort

func (u *SettingService) UpdatePort(port uint) error

func (*SettingService) UpdateProxy

func (u *SettingService) UpdateProxy(req dto.ProxyUpdate) error

func (*SettingService) UpdateSSL

func (u *SettingService) UpdateSSL(c *gin.Context, req dto.SSLUpdate) error

func (*SettingService) UpdateSystemSSL

func (u *SettingService) UpdateSystemSSL() error

func (*SettingService) UpdateTerminal

func (u *SettingService) UpdateTerminal(req dto.TerminalUpdate) error

type UpgradeService

type UpgradeService struct{}

func (*UpgradeService) LoadNotes

func (u *UpgradeService) LoadNotes(req dto.Upgrade) (string, error)

func (*UpgradeService) LoadRelease

func (u *UpgradeService) LoadRelease() ([]dto.ReleasesNotes, error)

func (*UpgradeService) Rollback

func (u *UpgradeService) Rollback(req dto.OperateByID) error

func (*UpgradeService) SearchUpgrade

func (u *UpgradeService) SearchUpgrade() (*dto.UpgradeInfo, error)

func (*UpgradeService) Upgrade

func (u *UpgradeService) Upgrade(req dto.Upgrade) error

Jump to

Keyboard shortcuts

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