services

package
v0.0.0-...-724610a Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: AGPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package services 备份服务

Package services 证书服务

Package services 插件服务

Package services 设置服务

Package services 用户服务

Package services 网站服务

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupImpl

type BackupImpl struct {
	// contains filtered or unexported fields
}

func NewBackupImpl

func NewBackupImpl() *BackupImpl

func (*BackupImpl) MysqlBackup

func (s *BackupImpl) MysqlBackup(database string) error

MysqlBackup MySQL备份

func (*BackupImpl) MysqlList

func (s *BackupImpl) MysqlList() ([]types.BackupFile, error)

MysqlList MySQL备份列表

func (*BackupImpl) MysqlRestore

func (s *BackupImpl) MysqlRestore(database string, backupFile string) error

MysqlRestore MySQL恢复

func (*BackupImpl) PostgresqlBackup

func (s *BackupImpl) PostgresqlBackup(database string) error

PostgresqlBackup PostgreSQL备份

func (*BackupImpl) PostgresqlList

func (s *BackupImpl) PostgresqlList() ([]types.BackupFile, error)

PostgresqlList PostgreSQL备份列表

func (*BackupImpl) PostgresqlRestore

func (s *BackupImpl) PostgresqlRestore(database string, backupFile string) error

PostgresqlRestore PostgreSQL恢复

func (*BackupImpl) WebSiteBackup

func (s *BackupImpl) WebSiteBackup(website models.Website) error

WebSiteBackup 网站备份

func (*BackupImpl) WebsiteList

func (s *BackupImpl) WebsiteList() ([]types.BackupFile, error)

WebsiteList 网站备份列表

func (*BackupImpl) WebsiteRestore

func (s *BackupImpl) WebsiteRestore(website models.Website, backupFile string) error

WebsiteRestore 网站恢复

type CertImpl

type CertImpl struct {
	// contains filtered or unexported fields
}

func NewCertImpl

func NewCertImpl() *CertImpl

func (*CertImpl) CertDestroy

func (s *CertImpl) CertDestroy(ID uint) error

CertDestroy 删除证书

func (*CertImpl) CertShow

func (s *CertImpl) CertShow(ID uint) (models.Cert, error)

CertShow 根据 ID 获取证书

func (*CertImpl) CertStore

func (s *CertImpl) CertStore(request requests.CertStore) error

CertStore 添加证书

func (*CertImpl) CertUpdate

func (s *CertImpl) CertUpdate(request requests.CertUpdate) error

CertUpdate 更新证书

func (*CertImpl) DNSDestroy

func (s *CertImpl) DNSDestroy(ID uint) error

DNSDestroy 删除 DNS

func (*CertImpl) DNSShow

func (s *CertImpl) DNSShow(ID uint) (models.CertDNS, error)

DNSShow 根据 ID 获取 DNS

func (*CertImpl) DNSStore

func (s *CertImpl) DNSStore(request requests.DNSStore) error

DNSStore 添加 DNS

func (*CertImpl) DNSUpdate

func (s *CertImpl) DNSUpdate(request requests.DNSUpdate) error

DNSUpdate 更新 DNS

func (*CertImpl) Deploy

func (s *CertImpl) Deploy(ID, WebsiteID uint) error

Deploy 部署证书

func (*CertImpl) ManualDNS

func (s *CertImpl) ManualDNS(ID uint) ([]acme.DNSRecord, error)

ManualDNS 获取手动 DNS 解析信息

func (*CertImpl) ObtainAuto

func (s *CertImpl) ObtainAuto(ID uint) (acme.Certificate, error)

ObtainAuto 自动签发证书

func (*CertImpl) ObtainManual

func (s *CertImpl) ObtainManual(ID uint) (acme.Certificate, error)

ObtainManual 手动签发证书

func (*CertImpl) Renew

func (s *CertImpl) Renew(ID uint) (acme.Certificate, error)

Renew 续签证书

func (*CertImpl) UserDestroy

func (s *CertImpl) UserDestroy(ID uint) error

UserDestroy 删除用户

func (*CertImpl) UserShow

func (s *CertImpl) UserShow(ID uint) (models.CertUser, error)

UserShow 根据 ID 获取用户

func (*CertImpl) UserStore

func (s *CertImpl) UserStore(request requests.UserStore) error

UserStore 添加用户

func (*CertImpl) UserUpdate

func (s *CertImpl) UserUpdate(request requests.UserUpdate) error

UserUpdate 更新用户

type Container

type Container struct {
	// contains filtered or unexported fields
}

func NewContainer

func NewContainer(sock ...string) Container

func (*Container) ContainerCreate

func (r *Container) ContainerCreate(name string, config container.Config, host container.HostConfig, network network.NetworkingConfig) (string, error)

ContainerCreate 创建容器

func (*Container) ContainerExist

func (r *Container) ContainerExist(name string) (bool, error)

ContainerExist 判断容器是否存在

func (*Container) ContainerInspect

func (r *Container) ContainerInspect(id string) (types.ContainerJSON, error)

ContainerInspect 查看容器

func (*Container) ContainerKill

func (r *Container) ContainerKill(id string) error

ContainerKill 杀死容器

func (*Container) ContainerListAll

func (r *Container) ContainerListAll() ([]types.Container, error)

ContainerListAll 列出所有容器

func (*Container) ContainerListByNames

func (r *Container) ContainerListByNames(names []string) ([]types.Container, error)

ContainerListByNames 根据名称列出容器

func (*Container) ContainerLogs

func (r *Container) ContainerLogs(id string) (string, error)

ContainerLogs 查看容器日志

func (*Container) ContainerPause

func (r *Container) ContainerPause(id string) error

ContainerPause 暂停容器

func (*Container) ContainerPrune

func (r *Container) ContainerPrune() error

ContainerPrune 清理未使用的容器

func (*Container) ContainerRemove

func (r *Container) ContainerRemove(id string) error

ContainerRemove 移除容器

func (*Container) ContainerRename

func (r *Container) ContainerRename(id string, newName string) error

ContainerRename 重命名容器

func (*Container) ContainerRestart

func (r *Container) ContainerRestart(id string) error

ContainerRestart 重启容器

func (*Container) ContainerStart

func (r *Container) ContainerStart(id string) error

ContainerStart 启动容器

func (*Container) ContainerStats

func (r *Container) ContainerStats(id string) (container.StatsResponseReader, error)

ContainerStats 查看容器状态

func (*Container) ContainerStop

func (r *Container) ContainerStop(id string) error

ContainerStop 停止容器

func (*Container) ContainerUnpause

func (r *Container) ContainerUnpause(id string) error

ContainerUnpause 恢复容器

func (*Container) ContainerUpdate

func (r *Container) ContainerUpdate(id string, config container.UpdateConfig) error

ContainerUpdate 更新容器

func (*Container) ImageExist

func (r *Container) ImageExist(id string) (bool, error)

ImageExist 判断镜像是否存在

func (*Container) ImageInspect

func (r *Container) ImageInspect(id string) (types.ImageInspect, error)

ImageInspect 查看镜像

func (*Container) ImageList

func (r *Container) ImageList() ([]image.Summary, error)

ImageList 列出镜像

func (*Container) ImagePrune

func (r *Container) ImagePrune() error

ImagePrune 清理未使用的镜像

func (*Container) ImagePull

func (r *Container) ImagePull(config requests.ImagePull) error

ImagePull 拉取镜像

func (*Container) ImageRemove

func (r *Container) ImageRemove(id string) error

ImageRemove 删除镜像

func (*Container) KVToMap

func (r *Container) KVToMap(kvs []paneltypes.KV) map[string]string

KVToMap 将 key-value 切片转换为 map

func (*Container) KVToSlice

func (r *Container) KVToSlice(kvs []paneltypes.KV) []string

KVToSlice 将 key-value 切片转换为 key=value 切片

func (*Container) NetworkConnect

func (r *Container) NetworkConnect(networkID string, containerID string) error

NetworkConnect 连接网络

func (*Container) NetworkCreate

func (r *Container) NetworkCreate(config requests.NetworkCreate) (string, error)

NetworkCreate 创建网络

func (*Container) NetworkDisconnect

func (r *Container) NetworkDisconnect(networkID string, containerID string) error

NetworkDisconnect 断开网络

func (*Container) NetworkExist

func (r *Container) NetworkExist(name string) (bool, error)

NetworkExist 判断网络是否存在

func (*Container) NetworkInspect

func (r *Container) NetworkInspect(id string) (network.Inspect, error)

NetworkInspect 查看网络

func (*Container) NetworkList

func (r *Container) NetworkList() ([]network.Inspect, error)

NetworkList 列出网络

func (*Container) NetworkPrune

func (r *Container) NetworkPrune() error

NetworkPrune 清理未使用的网络

func (*Container) NetworkRemove

func (r *Container) NetworkRemove(id string) error

NetworkRemove 删除网络

func (*Container) VolumeCreate

func (r *Container) VolumeCreate(config requests.VolumeCreate) (volume.Volume, error)

VolumeCreate 创建存储卷

func (*Container) VolumeExist

func (r *Container) VolumeExist(id string) (bool, error)

VolumeExist 判断存储卷是否存在

func (*Container) VolumeInspect

func (r *Container) VolumeInspect(id string) (volume.Volume, error)

VolumeInspect 查看存储卷

func (*Container) VolumeList

func (r *Container) VolumeList() ([]*volume.Volume, error)

VolumeList 列出存储卷

func (*Container) VolumePrune

func (r *Container) VolumePrune() error

VolumePrune 清理未使用的存储卷

func (*Container) VolumeRemove

func (r *Container) VolumeRemove(id string) error

VolumeRemove 删除存储卷

type CronImpl

type CronImpl struct {
}

func NewCronImpl

func NewCronImpl() *CronImpl

func (*CronImpl) AddToSystem

func (r *CronImpl) AddToSystem(cron models.Cron) error

AddToSystem 添加到系统

func (*CronImpl) DeleteFromSystem

func (r *CronImpl) DeleteFromSystem(cron models.Cron) error

DeleteFromSystem 从系统中删除

type PHPImpl

type PHPImpl struct {
	// contains filtered or unexported fields
}

func NewPHPImpl

func NewPHPImpl(version uint) *PHPImpl

func (*PHPImpl) ClearErrorLog

func (r *PHPImpl) ClearErrorLog() error

func (*PHPImpl) ClearSlowLog

func (r *PHPImpl) ClearSlowLog() error

func (*PHPImpl) GetConfig

func (r *PHPImpl) GetConfig() (string, error)

func (*PHPImpl) GetErrorLog

func (r *PHPImpl) GetErrorLog() (string, error)

func (*PHPImpl) GetExtensions

func (r *PHPImpl) GetExtensions() ([]types.PHPExtension, error)

func (*PHPImpl) GetFPMConfig

func (r *PHPImpl) GetFPMConfig() (string, error)

func (*PHPImpl) GetSlowLog

func (r *PHPImpl) GetSlowLog() (string, error)

func (*PHPImpl) InstallExtension

func (r *PHPImpl) InstallExtension(slug string) error

func (*PHPImpl) Load

func (r *PHPImpl) Load() ([]types.NV, error)

func (*PHPImpl) Reload

func (r *PHPImpl) Reload() error

func (*PHPImpl) SaveConfig

func (r *PHPImpl) SaveConfig(config string) error

func (*PHPImpl) SaveFPMConfig

func (r *PHPImpl) SaveFPMConfig(config string) error

func (*PHPImpl) UninstallExtension

func (r *PHPImpl) UninstallExtension(slug string) error

type PluginImpl

type PluginImpl struct {
	// contains filtered or unexported fields
}

func NewPluginImpl

func NewPluginImpl() *PluginImpl

func (*PluginImpl) All

func (r *PluginImpl) All() []types.Plugin

All 获取所有插件

func (*PluginImpl) AllInstalled

func (r *PluginImpl) AllInstalled() ([]models.Plugin, error)

AllInstalled 获取已安装的所有插件

func (*PluginImpl) GetBySlug

func (r *PluginImpl) GetBySlug(slug string) types.Plugin

GetBySlug 根据 slug 获取插件

func (*PluginImpl) GetInstalledBySlug

func (r *PluginImpl) GetInstalledBySlug(slug string) models.Plugin

GetInstalledBySlug 根据 slug 获取已安装的插件

func (*PluginImpl) Install

func (r *PluginImpl) Install(slug string) error

Install 安装插件

func (*PluginImpl) Uninstall

func (r *PluginImpl) Uninstall(slug string) error

Uninstall 卸载插件

func (*PluginImpl) Update

func (r *PluginImpl) Update(slug string) error

Update 更新插件

type SettingImpl

type SettingImpl struct {
}

func NewSettingImpl

func NewSettingImpl() *SettingImpl

func (*SettingImpl) Delete

func (r *SettingImpl) Delete(key string) error

Delete 删除设置

func (*SettingImpl) Get

func (r *SettingImpl) Get(key string, defaultValue ...string) string

Get 获取设置

func (*SettingImpl) Set

func (r *SettingImpl) Set(key, value string) error

Set 更新或创建设置

type TaskImpl

type TaskImpl struct {
}

func NewTaskImpl

func NewTaskImpl() *TaskImpl

func (*TaskImpl) DispatchWaiting

func (r *TaskImpl) DispatchWaiting() error

func (*TaskImpl) Process

func (r *TaskImpl) Process(taskID uint) error

type UserImpl

type UserImpl struct {
}

func NewUserImpl

func NewUserImpl() *UserImpl

func (*UserImpl) Create

func (r *UserImpl) Create(username, password string) (models.User, error)

func (*UserImpl) Update

func (r *UserImpl) Update(user models.User) (models.User, error)

type WebsiteImpl

type WebsiteImpl struct {
	// contains filtered or unexported fields
}

func NewWebsiteImpl

func NewWebsiteImpl() *WebsiteImpl

func (*WebsiteImpl) Add

func (r *WebsiteImpl) Add(website requests.Add) (models.Website, error)

Add 添加网站

func (*WebsiteImpl) Delete

func (r *WebsiteImpl) Delete(request requests.Delete) error

Delete 删除网站

func (*WebsiteImpl) GetConfig

func (r *WebsiteImpl) GetConfig(id uint) (types.WebsiteSetting, error)

GetConfig 获取网站配置

func (*WebsiteImpl) GetConfigByName

func (r *WebsiteImpl) GetConfigByName(name string) (types.WebsiteSetting, error)

GetConfigByName 根据网站名称获取网站配置

func (*WebsiteImpl) GetIDByName

func (r *WebsiteImpl) GetIDByName(name string) (uint, error)

GetIDByName 根据网站名称获取网站ID

func (*WebsiteImpl) List

func (r *WebsiteImpl) List(page, limit int) (int64, []models.Website, error)

List 列出网站

func (*WebsiteImpl) SaveConfig

func (r *WebsiteImpl) SaveConfig(config requests.SaveConfig) error

SaveConfig 保存网站配置

Jump to

Keyboard shortcuts

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