Documentation ¶
Overview ¶
Package biz @author <chengjiang@buffalo-robot.com> @date 2023-06-28 @note
Index ¶
- Variables
- type BackupBiz
- type BackupRepo
- type ConfigRepo
- type ConfigUseCase
- func (c *ConfigUseCase) CreateNameSpace(nameSpace string) error
- func (c *ConfigUseCase) GetConfig(nameSpace, appId string) (*configs.AppConfig, error)
- func (c *ConfigUseCase) GetFormatConfig(nameSpace, appId string, dir string) (*configs.FormatAppConfig, error)
- func (c *ConfigUseCase) QueryNameSpace(nameSpace string) (*configs.NameSpace, error)
- func (c *ConfigUseCase) QueryNameSpaceList() ([]*configs.NameSpace, error)
- func (c *ConfigUseCase) ReadConfigFiles(nameSpace string) ([]*configs.AppConfig, error)
- func (c *ConfigUseCase) RegisterConfigByWeb(config *configs.FormatAppConfig, nameSpace, dir string) error
- type DependInfo
- type DependStatus
- type DirDesc
- type ServerRepo
- type ServerServiceRepo
- type ServerServiceUseCase
- func (s *ServerServiceUseCase) ListProduct(ctx context.Context) []component.Product
- func (s *ServerServiceUseCase) ListServerServices(ctx context.Context, serverID int64) ([]*model.ServerServiceBind, map[string]*DependStatus, error)
- func (s *ServerServiceUseCase) ListServiceVersion(ctx context.Context, versionIDList []int64) (map[int64]*model.ServiceVersion, error)
- func (s *ServerServiceUseCase) ProductDependIPPut(ctx context.Context, serverID int64, Ip string, componentCode string) error
- func (s *ServerServiceUseCase) ProductInstall(ctx context.Context, serverID int64, productCode string, ...) error
- func (s *ServerServiceUseCase) ServiceInit(ctx context.Context, serverID int64, serviceCode string, skip int32) error
- func (s *ServerServiceUseCase) ServiceInstall(ctx context.Context, version, serviceCode, installPath string, serverID int64, ...) error
- func (s *ServerServiceUseCase) ServiceRunningStatus(serverIp string, serviceComponent component.ServiceComponent) (bool, error)
- func (s *ServerServiceUseCase) ServiceUninstall(ctx context.Context, serverID int64, serviceCode string) error
- func (s *ServerServiceUseCase) ServiceUpdate(ctx context.Context, serverID int64, serviceCode string, ...) error
- func (s *ServerServiceUseCase) ServiceVersionList(ctx context.Context, serverID int64, serviceCode string, page, perPage int32) ([]*model.ServiceVersion, *model.ServerServiceBind, int64, error)
- func (s *ServerServiceUseCase) ServiceVersionRevert(ctx context.Context, versionID int64) error
- type ServerUsecase
- func (s *ServerUsecase) CreateDir(ctx context.Context, serverID int64, path string) error
- func (s *ServerUsecase) CreateServer(ctx context.Context, ser *model.Server) error
- func (s *ServerUsecase) GetClient(serverID int64) *ssh.SSHClient
- func (s *ServerUsecase) GetComponentRunningStatus(serverID int64, code string) (bool, error)
- func (s *ServerUsecase) GetNginxData(ctx context.Context, serverID int64) (string, error)
- func (s *ServerUsecase) GetServerComponentList(ctx context.Context, serverID int64) ([]*SystemComponentStatus, error)
- func (s *ServerUsecase) GetServerList(ctx context.Context) ([]*model.Server, error)
- func (s *ServerUsecase) GetSystemComponentByCode(code string) component.SystemComponent
- func (s *ServerUsecase) InstallExistedSystemComponent(ctx context.Context, componentCode string, serverID int64) error
- func (s *ServerUsecase) InstallSystemComponent(ctx context.Context, serverID int64, componentCode, installPackegePath string, ...) error
- func (s *ServerUsecase) IsSSHConnect(serverID int64) bool
- func (s *ServerUsecase) ListServerDir(ctx context.Context, serverID int64, path string) ([]*DirDesc, error)
- func (s *ServerUsecase) SystemComponent(ctx context.Context, serverID int64, componectCode string) error
- func (s *ServerUsecase) SystemComponentOperate(ctx context.Context, serverID int64, componectCode string, ...) error
- func (s *ServerUsecase) UFW(ctx context.Context, serverID int64) (status string, err error)
- func (s *ServerUsecase) UninstallSystemComponent(ctx context.Context, serverID int64, systemComponentCode string) error
- func (s *ServerUsecase) UpdateNginxData(ctx context.Context, serverID int64, conf string) error
- func (s *ServerUsecase) UpdateServer(ctx context.Context, id int64, ser *model.Server) error
- func (s *ServerUsecase) UploadFile(ctx context.Context, serverID int64, localFileName string, ...) error
- type ServiceVersionRepo
- type SystemComponentStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ProviderSet = wire.NewSet(NewConfigUseCase, NewServerUsecase, NewBackupBiz, NewServerServiceUseCase)
ProviderSet is biz providers.
Functions ¶
This section is empty.
Types ¶
type BackupBiz ¶ added in v1.0.55
type BackupBiz struct {
// contains filtered or unexported fields
}
func NewBackupBiz ¶ added in v1.0.55
func NewBackupBiz(serverRepo ServerRepo, serverUseCase *ServerUsecase, backupRepo BackupRepo, logger *zap.Logger) *BackupBiz
func (*BackupBiz) ListBackup ¶ added in v1.0.55
func (b *BackupBiz) ListBackup() ([]*model.BackupData, error)
func (*BackupBiz) UploadToOss ¶ added in v1.0.55
type BackupRepo ¶ added in v1.0.55
type ConfigRepo ¶
type ConfigRepo interface { // RegisterConfigByWeb RegisterConfig(config *configs.FormatAppConfig) error // 通过http进行配置注册,写入到配置中心。 RegisterConfigByWeb(config *configs.FormatAppConfig, nameSpace, dir string) error // ReadConfigFiles 根据命名空间读取所有的配置文件。 ReadConfigFiles(nameSpace string) ([]*configs.AppConfig, error) // 读取指定的配置服务配置。 GetConfig(nameSpace, appId string) (*configs.AppConfig, error) // GetFormatConfig 格式化了的配置信息,将字符串的json序列化为map。dir:环境(如:Data,Public)。 GetFormatConfig(nameSpace, appId string, dir string) (*configs.FormatAppConfig, error) // CreateNameSpace 创建域,查询域。 CreateNameSpace(nameSpace string) error QueryNameSpace(nameSpace string) (*configs.NameSpace, error) QueryNameSpaceList() ([]*configs.NameSpace, error) }
type ConfigUseCase ¶
type ConfigUseCase struct {
// contains filtered or unexported fields
}
func NewConfigUseCase ¶
func NewConfigUseCase(configRepo ConfigRepo) *ConfigUseCase
func (*ConfigUseCase) CreateNameSpace ¶
func (c *ConfigUseCase) CreateNameSpace(nameSpace string) error
func (*ConfigUseCase) GetConfig ¶
func (c *ConfigUseCase) GetConfig(nameSpace, appId string) (*configs.AppConfig, error)
func (*ConfigUseCase) GetFormatConfig ¶
func (c *ConfigUseCase) GetFormatConfig(nameSpace, appId string, dir string) (*configs.FormatAppConfig, error)
func (*ConfigUseCase) QueryNameSpace ¶
func (c *ConfigUseCase) QueryNameSpace(nameSpace string) (*configs.NameSpace, error)
func (*ConfigUseCase) QueryNameSpaceList ¶
func (c *ConfigUseCase) QueryNameSpaceList() ([]*configs.NameSpace, error)
func (*ConfigUseCase) ReadConfigFiles ¶
func (c *ConfigUseCase) ReadConfigFiles(nameSpace string) ([]*configs.AppConfig, error)
func (*ConfigUseCase) RegisterConfigByWeb ¶
func (c *ConfigUseCase) RegisterConfigByWeb(config *configs.FormatAppConfig, nameSpace, dir string) error
type DependInfo ¶ added in v1.0.55
type DependStatus ¶ added in v1.0.55
type ServerRepo ¶ added in v1.0.55
type ServerRepo interface { GetServerList(ctx context.Context) ([]*model.Server, error) CreateServer(ctx context.Context, srv *model.Server) error UpdateServer(ctx context.Context, id int64, srv *model.Server) error GetServerByIp(ctx context.Context, ip string) (*model.Server, error) GetServerByID(ctx context.Context, id int64) (*model.Server, error) GetServerClient(ctx context.Context, server *model.Server) (*ssh.SSHClient, error) }
type ServerServiceRepo ¶ added in v1.0.55
type ServerServiceRepo interface { CreateServerService(context.Context, []*model.ServerServiceBind) error ListServerService(context.Context, int64) ([]*model.ServerServiceBind, error) UpdateServerService(ctx context.Context, serverID int64, code string, bind *model.ServerServiceBind) error GetServerService(ctx context.Context, serverID int64, serviceCode string) (*model.ServerServiceBind, error) GetServerServiceByID(context.Context, int64) (*model.ServerServiceBind, error) }
type ServerServiceUseCase ¶ added in v1.0.55
type ServerServiceUseCase struct {
// contains filtered or unexported fields
}
func NewServerServiceUseCase ¶ added in v1.0.55
func NewServerServiceUseCase(serverServiceRepo ServerServiceRepo, serviceVersionRepo ServiceVersionRepo, serverUseCase *ServerUsecase, serverRepo ServerRepo, logger *zap.Logger, ) *ServerServiceUseCase
func (*ServerServiceUseCase) ListProduct ¶ added in v1.0.55
func (s *ServerServiceUseCase) ListProduct(ctx context.Context) []component.Product
func (*ServerServiceUseCase) ListServerServices ¶ added in v1.0.55
func (s *ServerServiceUseCase) ListServerServices(ctx context.Context, serverID int64) ([]*model.ServerServiceBind, map[string]*DependStatus, error)
func (*ServerServiceUseCase) ListServiceVersion ¶ added in v1.0.55
func (s *ServerServiceUseCase) ListServiceVersion(ctx context.Context, versionIDList []int64) (map[int64]*model.ServiceVersion, error)
func (*ServerServiceUseCase) ProductDependIPPut ¶ added in v1.0.55
func (*ServerServiceUseCase) ProductInstall ¶ added in v1.0.55
func (s *ServerServiceUseCase) ProductInstall(ctx context.Context, serverID int64, productCode string, depends *component.ProductDepends, ) error
func (*ServerServiceUseCase) ServiceInit ¶ added in v1.0.55
func (s *ServerServiceUseCase) ServiceInit(ctx context.Context, serverID int64, serviceCode string, skip int32) error
ServiceInit 当skip为1时进行初始化 为2不进行真正的初始化
func (*ServerServiceUseCase) ServiceInstall ¶ added in v1.0.55
func (s *ServerServiceUseCase) ServiceInstall(ctx context.Context, version, serviceCode, installPath string, serverID int64, parameters []*component.ComponentParameters, ) error
func (*ServerServiceUseCase) ServiceRunningStatus ¶ added in v1.0.55
func (s *ServerServiceUseCase) ServiceRunningStatus(serverIp string, serviceComponent component.ServiceComponent) (bool, error)
func (*ServerServiceUseCase) ServiceUninstall ¶ added in v1.0.55
func (*ServerServiceUseCase) ServiceUpdate ¶ added in v1.0.55
func (*ServerServiceUseCase) ServiceVersionList ¶ added in v1.0.55
func (s *ServerServiceUseCase) ServiceVersionList(ctx context.Context, serverID int64, serviceCode string, page, perPage int32, ) ([]*model.ServiceVersion, *model.ServerServiceBind, int64, error)
func (*ServerServiceUseCase) ServiceVersionRevert ¶ added in v1.0.55
func (s *ServerServiceUseCase) ServiceVersionRevert(ctx context.Context, versionID int64) error
type ServerUsecase ¶ added in v1.0.55
type ServerUsecase struct {
// contains filtered or unexported fields
}
func NewServerUsecase ¶ added in v1.0.55
func NewServerUsecase(serverRepo ServerRepo, logger *zap.Logger) *ServerUsecase
func (*ServerUsecase) CreateServer ¶ added in v1.0.55
func (*ServerUsecase) GetClient ¶ added in v1.0.55
func (s *ServerUsecase) GetClient(serverID int64) *ssh.SSHClient
func (*ServerUsecase) GetComponentRunningStatus ¶ added in v1.0.55
func (s *ServerUsecase) GetComponentRunningStatus(serverID int64, code string) (bool, error)
func (*ServerUsecase) GetNginxData ¶ added in v1.0.55
func (*ServerUsecase) GetServerComponentList ¶ added in v1.0.55
func (s *ServerUsecase) GetServerComponentList(ctx context.Context, serverID int64) ([]*SystemComponentStatus, error)
GetServerComponentList 只返回系统组件
func (*ServerUsecase) GetServerList ¶ added in v1.0.55
func (*ServerUsecase) GetSystemComponentByCode ¶ added in v1.0.55
func (s *ServerUsecase) GetSystemComponentByCode(code string) component.SystemComponent
func (*ServerUsecase) InstallExistedSystemComponent ¶ added in v1.0.55
func (*ServerUsecase) InstallSystemComponent ¶ added in v1.0.55
func (s *ServerUsecase) InstallSystemComponent(ctx context.Context, serverID int64, componentCode, installPackegePath string, parameters []*component.ComponentParameters, ) error
func (*ServerUsecase) IsSSHConnect ¶ added in v1.0.55
func (s *ServerUsecase) IsSSHConnect(serverID int64) bool
func (*ServerUsecase) ListServerDir ¶ added in v1.0.55
func (*ServerUsecase) SystemComponent ¶ added in v1.0.55
func (*ServerUsecase) SystemComponentOperate ¶ added in v1.0.55
func (s *ServerUsecase) SystemComponentOperate(ctx context.Context, serverID int64, componectCode string, operate component.OperateType, ) error
func (*ServerUsecase) UninstallSystemComponent ¶ added in v1.0.55
func (*ServerUsecase) UpdateNginxData ¶ added in v1.0.55
func (*ServerUsecase) UpdateServer ¶ added in v1.0.55
func (*ServerUsecase) UploadFile ¶ added in v1.0.55
type ServiceVersionRepo ¶ added in v1.0.55
type ServiceVersionRepo interface { CreateServiceVersion(context.Context, *model.ServiceVersion) error GetServiceVersionByID(context.Context, int64) (*model.ServiceVersion, error) ListServiceVersionByIDList(context.Context, []int64) (map[int64]*model.ServiceVersion, error) ListServiceVersion(ctx context.Context, serverID, serviceID int64, page, perPage int32) ([]*model.ServiceVersion, int64, error) }
type SystemComponentStatus ¶ added in v1.0.55
type SystemComponentStatus struct { ComponentName string ComponentCode string HasInstalled bool IsRunning bool Parameters []*component.ComponentParameters CanInstalled bool Depends []*DependInfo }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.