Documentation ¶
Index ¶
- Constants
- Variables
- func BasePack(text []byte) (string, error)
- func CheckLabel(serviceID string) bool
- func CheckMapKey(rebody map[string]interface{}, key string, defaultValue interface{}) map[string]interface{}
- func CheckTenantResource(tenant *dbmodel.Tenants, needMemory int) error
- func CreateDefaultTokenMap(conf option.Config)
- func CreateLicenseManger() error
- func CreateLicensesInfoManager() error
- func CreateRootFuncHandler(conf option.Config) error
- func CreateTokenIdenHandler(conf option.Config) error
- func GetAPPBackupHandler() *group.BackupHandle
- func GetBuilderProxy() proxy.Proxy
- func GetDefaultSourceURI() map[string][]*dbmodel.RegionAPIClass
- func GetDefaultTokenMap() map[string]*dbmodel.RegionUserInfo
- func GetMonitorProxy() proxy.Proxy
- func GetNodeProxy() proxy.Proxy
- func GetPluginShareHandle() *share.PluginShareHandle
- func GetPrometheusProxy() proxy.Proxy
- func GetServicesDisk(ids []string, p proxy.Proxy) map[string]float64
- func GetShareHandle() *share.ServiceShareHandle
- func InitHandle(conf option.Config, statusCli *client.AppRuntimeSyncClient) error
- func InitProxy(conf option.Config)
- func ListLicense() (map[string]*api_model.LicenseInfo, error)
- func SetTokenCache(info *dbmodel.RegionUserInfo)
- func TransStatus(eStatus string) string
- type AppAction
- type AppRestoreAction
- func (a *AppRestoreAction) RestoreDepVols(tenantID, serviceID string, req *apimodel.RestoreDepVolsReq) error
- func (a *AppRestoreAction) RestoreDeps(tenantID, serviceID string, req *apimodel.RestoreDepsReq) error
- func (a *AppRestoreAction) RestoreEnvs(tenantID, serviceID string, req *apimodel.RestoreEnvsReq) error
- func (a *AppRestoreAction) RestorePlugins(tenantID, serviceID string, req *apimodel.RestorePluginsReq) error
- func (a *AppRestoreAction) RestorePorts(tenantID, serviceID string, req *apimodel.RestorePortsReq) error
- func (a *AppRestoreAction) RestoreProbe(serviceID string, req *apimodel.ServiceProbe) error
- func (a *AppRestoreAction) RestoreVolumes(tenantID, serviceID string, req *apimodel.RestoreVolumesReq) error
- type AppRestoreHandler
- type BatchOperationHandler
- func (b *BatchOperationHandler) Build(buildInfos []model.BuildInfoRequestStruct) (re BatchOperationResult)
- func (b *BatchOperationHandler) Start(startInfos []model.StartOrStopInfoRequestStruct) (re BatchOperationResult)
- func (b *BatchOperationHandler) Stop(stopInfos []model.StartOrStopInfoRequestStruct) (re BatchOperationResult)
- func (b *BatchOperationHandler) Upgrade(upgradeInfos []model.UpgradeInfoRequestStruct) (re BatchOperationResult)
- type BatchOperationResult
- type CloudAction
- func (c *CloudAction) CertDispatcher(gt *api_model.GetUserToken) ([]byte, []byte, error)
- func (c *CloudAction) GetTokenInfo(eid string) (*dbmodel.RegionUserInfo, *util.APIHandleError)
- func (c *CloudAction) TokenDispatcher(gt *api_model.GetUserToken) (*api_model.TokenInfo, *util.APIHandleError)
- func (c *CloudAction) UpdateTokenTime(eid string, vd int) *util.APIHandleError
- type CloudHandler
- type ClusterResourceStats
- type EventHandler
- type GatewayAction
- func (g *GatewayAction) AddCertificate(req *apimodel.AddHTTPRuleStruct, tx *gorm.DB) error
- func (g *GatewayAction) AddHTTPRule(req *apimodel.AddHTTPRuleStruct) (string, error)
- func (g *GatewayAction) AddRuleExtensions(ruleID string, ruleExtensions []*apimodel.RuleExtensionStruct, tx *gorm.DB) error
- func (g *GatewayAction) AddTCPRule(req *apimodel.AddTCPRuleStruct) (string, error)
- func (g *GatewayAction) DeleteHTTPRule(req *apimodel.DeleteHTTPRuleStruct) (string, error)
- func (g *GatewayAction) DeleteHTTPRuleByServiceIDWithTransaction(sid string, tx *gorm.DB) error
- func (g *GatewayAction) DeleteTCPRule(req *apimodel.DeleteTCPRuleStruct) (string, error)
- func (g *GatewayAction) DeleteTCPRuleByServiceIDWithTransaction(sid string, tx *gorm.DB) error
- func (g *GatewayAction) GetAvailablePort(ip string) (int, error)
- func (g *GatewayAction) GetGatewayIPs() []IPAndAvailablePort
- func (g *GatewayAction) ListHTTPRulesByCertID(certID string) ([]*model.HTTPRule, error)
- func (g *GatewayAction) RuleConfig(req *apimodel.RuleConfigReq) error
- func (g *GatewayAction) SendTask(in map[string]interface{}) error
- func (g *GatewayAction) TCPIPPortExists(host string, port int) bool
- func (g *GatewayAction) UpdCertificate(req *apimodel.UpdCertificateReq) error
- func (g *GatewayAction) UpdateCertificate(req apimodel.AddHTTPRuleStruct, httpRule *model.HTTPRule, tx *gorm.DB) error
- func (g *GatewayAction) UpdateHTTPRule(req *apimodel.UpdateHTTPRuleStruct) (string, error)
- func (g *GatewayAction) UpdateTCPRule(req *apimodel.UpdateTCPRuleStruct, minPort int) (string, error)
- type GatewayHandler
- type IPAndAvailablePort
- type Info
- type K8sPodInfo
- type K8sPodInfos
- type LangInfo
- type LicenseAction
- type LicenseHandler
- type LicenseInfoHandler
- type LicensesInfos
- type LogAction
- func (l *LogAction) GetEvents(target, targetID string, page, size int) ([]*dbmodel.ServiceEvent, int, error)
- func (l *LogAction) GetLevelLog(eventID string, level string) (*api_model.DataLog, error)
- func (l *LogAction) GetLogFile(serviceAlias, fileName string) (string, string, error)
- func (l *LogAction) GetLogInstance(serviceID string) (string, error)
- func (l *LogAction) GetLogList(serviceAlias string) ([]string, error)
- type MajorInfo
- type MinorInfo
- type NetRulesAction
- func (n *NetRulesAction) CreateDownStreamNetRules(tenantID string, rs *api_model.SetNetDownStreamRuleStruct) *util.APIHandleError
- func (n *NetRulesAction) GetDownStreamNetRule(tenantID, serviceAlias, destServiceAlias, port string) (*api_model.NetRulesDownStreamBody, *util.APIHandleError)
- func (n *NetRulesAction) UpdateDownStreamNetRule(tenantID string, urs *api_model.UpdateNetDownStreamRuleStruct) *util.APIHandleError
- type NetRulesHandler
- type OperationHandler
- func (o *OperationHandler) Build(buildInfo model.BuildInfoRequestStruct) (re OperationResult)
- func (o *OperationHandler) Restart(restartInfo model.StartOrStopInfoRequestStruct) (re OperationResult)
- func (o *OperationHandler) RollBack(rollback model.RollbackInfoRequestStruct) (re OperationResult)
- func (o *OperationHandler) Start(startInfo model.StartOrStopInfoRequestStruct) (re OperationResult)
- func (o *OperationHandler) Stop(stopInfo model.StartOrStopInfoRequestStruct) (re OperationResult)
- func (o *OperationHandler) Upgrade(ru model.UpgradeInfoRequestStruct) (re OperationResult)
- type OperationResult
- type PluginAction
- func (p *PluginAction) AddDefaultEnv(est *api_model.ENVStruct) *util.APIHandleError
- func (p *PluginAction) BuildPluginManual(bps *api_model.BuildPluginStruct) (*dbmodel.TenantPluginBuildVersion, *util.APIHandleError)
- func (p *PluginAction) CreatePluginAct(cps *api_model.CreatePluginStruct) *util.APIHandleError
- func (p *PluginAction) DeleteDefaultEnv(pluginID, versionID, name string) *util.APIHandleError
- func (p *PluginAction) DeletePluginAct(pluginID, tenantID string) *util.APIHandleError
- func (p *PluginAction) DeletePluginBuildVersion(pluginID, versionID string) *util.APIHandleError
- func (p *PluginAction) GetAllPluginBuildVersions(pluginID string) ([]*dbmodel.TenantPluginBuildVersion, *util.APIHandleError)
- func (p *PluginAction) GetDefaultEnv(pluginID, versionID string) ([]*dbmodel.TenantPluginDefaultENV, *util.APIHandleError)
- func (p *PluginAction) GetEnvsWhichCanBeSet(serviceID, pluginID string) (interface{}, *util.APIHandleError)
- func (p *PluginAction) GetPluginBuildVersion(pluginID, versionID string) (*dbmodel.TenantPluginBuildVersion, *util.APIHandleError)
- func (p *PluginAction) GetPlugins(tenantID string) ([]*dbmodel.TenantPlugin, *util.APIHandleError)
- func (p *PluginAction) UpdateDefaultEnv(est *api_model.ENVStruct) *util.APIHandleError
- func (p *PluginAction) UpdatePluginAct(pluginID, tenantID string, cps *api_model.UpdatePluginStruct) *util.APIHandleError
- type PluginHandler
- type PodAction
- type PodHandler
- type QueryResult
- type RootAction
- type RootFuncHandler
- type ServiceAction
- func (s *ServiceAction) AddAutoscalerRule(req *api_model.AutoscalerRuleReq) error
- func (s *ServiceAction) AddLabel(l *api_model.LabelsStruct, serviceID string) error
- func (s *ServiceAction) CodeCheck(c *api_model.CheckCodeStruct) error
- func (s *ServiceAction) CreateTenandIDAndName(eid string) (string, string, error)
- func (s *ServiceAction) CreateTenant(t *dbmodel.Tenants) error
- func (s *ServiceAction) DeleteLabel(l *api_model.LabelsStruct, serviceID string) error
- func (s *ServiceAction) DeletePluginConfig(serviceID, pluginID string) *util.APIHandleError
- func (s *ServiceAction) EnvAttr(action string, at *dbmodel.TenantServiceEnvVar) error
- func (s *ServiceAction) GetDepVolumes(serviceID string) ([]*dbmodel.TenantServiceMountRelation, *util.APIHandleError)
- func (s *ServiceAction) GetPagedTenantRes(offset, len int) ([]*api_model.TenantResource, int, error)
- func (s *ServiceAction) GetPodContainerMemory(podNames []string) (map[string]map[string]string, error)
- func (s *ServiceAction) GetPods(serviceID string) (*K8sPodInfos, error)
- func (s *ServiceAction) GetService(tenantID string) ([]*dbmodel.TenantServices, error)
- func (s *ServiceAction) GetServiceCheckInfo(uuid string) (*exector.ServiceCheckResult, *util.APIHandleError)
- func (s *ServiceAction) GetServiceDeployInfo(tenantID, serviceID string) (*pb.DeployInfo, *util.APIHandleError)
- func (s *ServiceAction) GetServicesStatus(tenantID string, serviceIDs []string) map[string]string
- func (s *ServiceAction) GetStatus(serviceID string) (*api_model.StatusList, error)
- func (s *ServiceAction) GetTenantRes(uuid string) (*api_model.TenantResource, error)
- func (s *ServiceAction) GetTenantServicePluginRelation(serviceID string) ([]*dbmodel.TenantServicePluginRelation, *util.APIHandleError)
- func (s *ServiceAction) GetVolumes(serviceID string) ([]*dbmodel.TenantServiceVolume, *util.APIHandleError)
- func (s *ServiceAction) LanguageSet(langS *api_model.LanguageSet) error
- func (s *ServiceAction) ListScalingRecords(serviceID string, page, pageSize int) ([]*dbmodel.TenantServiceScalingRecords, int, error)
- func (s *ServiceAction) ListVersionInfo(serviceID string) (*api_model.BuildListRespVO, error)
- func (s *ServiceAction) PortInner(tenantName, serviceID, operation string, port int) error
- func (s *ServiceAction) PortOuter(tenantName, serviceID string, containerPort int, ...) (*dbmodel.TenantServiceLBMappingPort, string, error)
- func (s *ServiceAction) PortVar(action, tenantID, serviceID string, vps *api_model.ServicePorts, oldPort int) error
- func (s *ServiceAction) RollBack(rs *api_model.RollbackStruct) error
- func (s *ServiceAction) SavePluginConfig(serviceID, pluginID string, config *api_model.ResourceSpec) *util.APIHandleError
- func (s *ServiceAction) ServiceBuild(tenantID, serviceID string, r *api_model.BuildServiceStruct) error
- func (s *ServiceAction) ServiceCheck(scs *api_model.ServiceCheckStruct) (string, string, *util.APIHandleError)
- func (s *ServiceAction) ServiceCreate(sc *api_model.ServiceStruct) error
- func (s *ServiceAction) ServiceDepend(action string, ds *api_model.DependService) error
- func (s *ServiceAction) ServiceHorizontal(hs *model.HorizontalScalingTaskBody) error
- func (s *ServiceAction) ServiceProbe(tsp *dbmodel.TenantServiceProbe, action string) error
- func (s *ServiceAction) ServiceUpdate(sc map[string]interface{}) error
- func (s *ServiceAction) ServiceUpgrade(ru *model.RollingUpgradeTaskBody) error
- func (s *ServiceAction) ServiceVertical(vs *model.VerticalScalingTaskBody) error
- func (s *ServiceAction) SetTenantServicePluginRelation(tenantID, serviceID string, pss *api_model.PluginSetStruct) (*dbmodel.TenantServicePluginRelation, *util.APIHandleError)
- func (s *ServiceAction) StartStopService(sss *api_model.StartStopStruct) error
- func (s *ServiceAction) TenantServiceDeletePluginRelation(tenantID, serviceID, pluginID string) *util.APIHandleError
- func (s *ServiceAction) TransServieToDelete(tenantID, serviceID string) error
- func (s *ServiceAction) UpdAutoscalerRule(req *api_model.AutoscalerRuleReq) error
- func (s *ServiceAction) UpdVolume(sid string, req *api_model.UpdVolumeReq) error
- func (s *ServiceAction) UpdateLabel(l *api_model.LabelsStruct, serviceID string) error
- func (s *ServiceAction) UpdateServiceLabel(serviceID, value string) error
- func (s *ServiceAction) UpdateTenantServicePluginRelation(serviceID string, pss *api_model.PluginSetStruct) (*dbmodel.TenantServicePluginRelation, *util.APIHandleError)
- func (s *ServiceAction) UpdateVersionEnv(uve *api_model.SetVersionEnv) *util.APIHandleError
- func (s *ServiceAction) VolumeDependency(tsr *dbmodel.TenantServiceMountRelation, action string) *util.APIHandleError
- func (s *ServiceAction) VolumnVar(tsv *dbmodel.TenantServiceVolume, tenantID, fileContent, action string) *util.APIHandleError
- type ServiceDependency
- type ServiceHandler
- type TenantAction
- func (t *TenantAction) BindTenantsResource(source []*dbmodel.Tenants) api_model.TenantList
- func (t *TenantAction) DeleteTenant(tenantID string) error
- func (t *TenantAction) GetAllocatableResources() (*ClusterResourceStats, error)
- func (t *TenantAction) GetProtocols() ([]*dbmodel.RegionProcotols, *util.APIHandleError)
- func (t *TenantAction) GetServicesResources(tr *api_model.ServicesResources) (re map[string]map[string]interface{}, err error)
- func (t *TenantAction) GetServicesStatus(ids string) map[string]string
- func (t *TenantAction) GetTenantResource(tenantID string) (ts TenantResourceStats, err error)
- func (t *TenantAction) GetTenants(query string) ([]*dbmodel.Tenants, error)
- func (t *TenantAction) GetTenantsByEid(eid, query string) ([]*dbmodel.Tenants, error)
- func (t *TenantAction) GetTenantsByName(name string) (*dbmodel.Tenants, error)
- func (t *TenantAction) GetTenantsByUUID(uuid string) (*dbmodel.Tenants, error)
- func (t *TenantAction) GetTenantsName() ([]string, error)
- func (t *TenantAction) GetTenantsResources(tr *api_model.TenantResources) (map[string]map[string]interface{}, error)
- func (t *TenantAction) IsClosedStatus(status string) bool
- func (t *TenantAction) StatsMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error)
- func (t *TenantAction) TenantsSum() (int, error)
- func (t *TenantAction) TotalMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error)
- func (t *TenantAction) TransPlugins(tenantID, tenantName, fromTenant string, pluginList []string) *util.APIHandleError
- func (t *TenantAction) UpdateTenant(tenant *dbmodel.Tenants) error
- type TenantHandler
- type TenantResourceStats
- type ThirdPartyServiceHanlder
- func (t *ThirdPartyServiceHanlder) AddEndpoints(sid string, d *model.AddEndpiontsReq) error
- func (t *ThirdPartyServiceHanlder) DelEndpoints(epid, sid string) error
- func (t *ThirdPartyServiceHanlder) ListEndpoints(sid string) ([]*model.EndpointResp, error)
- func (t *ThirdPartyServiceHanlder) UpdEndpoints(d *model.UpdEndpiontsReq) error
- type TokenIdenAction
- func (t *TokenIdenAction) AddAPIManager(am *api_model.APIManager) *util.APIHandleError
- func (t *TokenIdenAction) AddTokenIntoMap(rui *dbmodel.RegionUserInfo)
- func (t *TokenIdenAction) CheckToken(token, uri string) bool
- func (t *TokenIdenAction) DeleteAPIManager(am *api_model.APIManager) *util.APIHandleError
- func (t *TokenIdenAction) DeleteTokenFromMap(oldtoken string, rui *dbmodel.RegionUserInfo)
- func (t *TokenIdenAction) GetAPIManager() map[string][]*dbmodel.RegionAPIClass
- func (t *TokenIdenAction) InitTokenMap() error
- type TokenMap
- type TokenMapHandler
- type VersionInfo
Constants ¶
const TIMELAYOUT = "2006-01-02T15:04:05"
TIMELAYOUT timelayout
Variables ¶
var ( // ErrTenantStillHasServices - ErrTenantStillHasServices = errors.New("tenant still has services") // ErrTenantStillHasPlugins - ErrTenantStillHasPlugins = errors.New("tenant still has plugins") )
var ErrEventIDIsExist = fmt.Errorf("event_id is exist")
ErrEventIDIsExist event id is exist
var ErrEventIsRuning = fmt.Errorf("event is running")
ErrEventIsRuning last event is running
var ErrServiceNotClosed = errors.New("Service has not been closed")
ErrServiceNotClosed -
Functions ¶
func CheckMapKey ¶
func CheckMapKey(rebody map[string]interface{}, key string, defaultValue interface{}) map[string]interface{}
CheckMapKey CheckMapKey
func CheckTenantResource ¶
CheckTenantResource check tenant's resource is support action or not
func CreateDefaultTokenMap ¶
CreateDefaultTokenMap CreateDefaultTokenMap
func CreateLicenseManger ¶
func CreateLicenseManger() error
CreateLicenseManger create service manager
func CreateLicensesInfoManager ¶
func CreateLicensesInfoManager() error
CreateLicensesInfoManager CreateLicensesInfoManager
func CreateRootFuncHandler ¶
CreateRootFuncHandler create root func handler
func CreateTokenIdenHandler ¶
CreateTokenIdenHandler create token identification handler
func GetAPPBackupHandler ¶
func GetAPPBackupHandler() *group.BackupHandle
GetAPPBackupHandler GetAPPBackupHandler
func GetDefaultSourceURI ¶
func GetDefaultSourceURI() map[string][]*dbmodel.RegionAPIClass
GetDefaultSourceURI GetDefaultSourceURI
func GetDefaultTokenMap ¶
func GetDefaultTokenMap() map[string]*dbmodel.RegionUserInfo
GetDefaultTokenMap GetDefaultTokenMap
func GetPluginShareHandle ¶
func GetPluginShareHandle() *share.PluginShareHandle
GetPluginShareHandle get plugin share handle
func GetPrometheusProxy ¶
GetPrometheusProxy GetPrometheusProxy
func GetServicesDisk ¶
GetServicesDisk get service disk
func GetShareHandle ¶
func GetShareHandle() *share.ServiceShareHandle
GetShareHandle get share handle
func InitHandle ¶
func InitHandle(conf option.Config, statusCli *client.AppRuntimeSyncClient) error
InitHandle 初始化handle
func ListLicense ¶
func ListLicense() (map[string]*api_model.LicenseInfo, error)
ListLicense lise license
Types ¶
type AppAction ¶
AppAction app action
func CreateAppManager ¶
CreateAppManager create app manager
func (*AppAction) Complete ¶
func (a *AppAction) Complete(tr *model.ExportAppStruct) error
Complete Complete
func (*AppAction) ExportApp ¶
func (a *AppAction) ExportApp(tr *model.ExportAppStruct) error
ExportApp ExportApp
func (*AppAction) GetStaticDir ¶
GetStaticDir get static dir
type AppRestoreAction ¶
type AppRestoreAction struct { }
AppRestoreAction is an implementation of AppRestoreHandler
func (*AppRestoreAction) RestoreDepVols ¶
func (a *AppRestoreAction) RestoreDepVols(tenantID, serviceID string, req *apimodel.RestoreDepVolsReq) error
RestoreDepVols restores service dependent volumes.
func (*AppRestoreAction) RestoreDeps ¶
func (a *AppRestoreAction) RestoreDeps(tenantID, serviceID string, req *apimodel.RestoreDepsReq) error
RestoreDeps restores service dependencies.
func (*AppRestoreAction) RestoreEnvs ¶
func (a *AppRestoreAction) RestoreEnvs(tenantID, serviceID string, req *apimodel.RestoreEnvsReq) error
RestoreEnvs restores environment variables.
func (*AppRestoreAction) RestorePlugins ¶
func (a *AppRestoreAction) RestorePlugins(tenantID, serviceID string, req *apimodel.RestorePluginsReq) error
RestorePlugins restores service plugins.
func (*AppRestoreAction) RestorePorts ¶
func (a *AppRestoreAction) RestorePorts(tenantID, serviceID string, req *apimodel.RestorePortsReq) error
RestorePorts restores service ports.
func (*AppRestoreAction) RestoreProbe ¶
func (a *AppRestoreAction) RestoreProbe(serviceID string, req *apimodel.ServiceProbe) error
RestoreProbe restores service probe.
func (*AppRestoreAction) RestoreVolumes ¶
func (a *AppRestoreAction) RestoreVolumes(tenantID, serviceID string, req *apimodel.RestoreVolumesReq) error
RestoreVolumes restores service volumes.
type AppRestoreHandler ¶
type AppRestoreHandler interface { RestoreEnvs(tenantID, serviceID string, req *apimodel.RestoreEnvsReq) error RestorePorts(tenantID, serviceID string, req *apimodel.RestorePortsReq) error RestoreVolumes(tenantID, serviceID string, req *apimodel.RestoreVolumesReq) error RestoreProbe(serviceID string, req *apimodel.ServiceProbe) error RestoreDeps(tenantID, serviceID string, req *apimodel.RestoreDepsReq) error RestoreDepVols(tenantID, serviceID string, req *apimodel.RestoreDepVolsReq) error RestorePlugins(tenantID, serviceID string, req *apimodel.RestorePluginsReq) error }
AppRestoreHandler defines handler methods to restore app. app means market service.
func GetAppRestoreHandler ¶
func GetAppRestoreHandler() AppRestoreHandler
GetAppRestoreHandler returns a default AppRestoreHandler
func NewAppRestoreHandler ¶
func NewAppRestoreHandler() AppRestoreHandler
NewAppRestoreHandler creates a new AppRestoreHandler.
type BatchOperationHandler ¶
type BatchOperationHandler struct {
// contains filtered or unexported fields
}
BatchOperationHandler batch operation handler
func CreateBatchOperationHandler ¶
func CreateBatchOperationHandler(mqCli gclient.MQClient, operationHandler *OperationHandler) *BatchOperationHandler
CreateBatchOperationHandler create batch operation handler
func GetBatchOperationHandler ¶
func GetBatchOperationHandler() *BatchOperationHandler
GetBatchOperationHandler get handler
func (*BatchOperationHandler) Build ¶
func (b *BatchOperationHandler) Build(buildInfos []model.BuildInfoRequestStruct) (re BatchOperationResult)
Build build
func (*BatchOperationHandler) Start ¶
func (b *BatchOperationHandler) Start(startInfos []model.StartOrStopInfoRequestStruct) (re BatchOperationResult)
Start batch start
func (*BatchOperationHandler) Stop ¶
func (b *BatchOperationHandler) Stop(stopInfos []model.StartOrStopInfoRequestStruct) (re BatchOperationResult)
Stop batch stop
func (*BatchOperationHandler) Upgrade ¶
func (b *BatchOperationHandler) Upgrade(upgradeInfos []model.UpgradeInfoRequestStruct) (re BatchOperationResult)
Upgrade batch upgrade
type BatchOperationResult ¶
type BatchOperationResult struct {
BatchResult []OperationResult `json:"batche_result"`
}
BatchOperationResult batch operation result
type CloudAction ¶
CloudAction cloud action struct
func CreateCloudManager ¶
func CreateCloudManager(conf option.Config) *CloudAction
CreateCloudManager get cloud manager
func (*CloudAction) CertDispatcher ¶
func (c *CloudAction) CertDispatcher(gt *api_model.GetUserToken) ([]byte, []byte, error)
CertDispatcher Cert
func (*CloudAction) GetTokenInfo ¶
func (c *CloudAction) GetTokenInfo(eid string) (*dbmodel.RegionUserInfo, *util.APIHandleError)
GetTokenInfo GetTokenInfo
func (*CloudAction) TokenDispatcher ¶
func (c *CloudAction) TokenDispatcher(gt *api_model.GetUserToken) (*api_model.TokenInfo, *util.APIHandleError)
TokenDispatcher token
func (*CloudAction) UpdateTokenTime ¶
func (c *CloudAction) UpdateTokenTime(eid string, vd int) *util.APIHandleError
UpdateTokenTime UpdateTokenTime
type CloudHandler ¶
type CloudHandler interface { TokenDispatcher(gt *api_model.GetUserToken) (*api_model.TokenInfo, *util.APIHandleError) GetTokenInfo(eid string) (*dbmodel.RegionUserInfo, *util.APIHandleError) UpdateTokenTime(eid string, vd int) *util.APIHandleError }
CloudHandler define source handler
type ClusterResourceStats ¶
type ClusterResourceStats struct { AllCPU int64 AllMemory int64 RequestCPU int64 RequestMemory int64 }
ClusterResourceStats cluster resource stats
type EventHandler ¶
type EventHandler interface { GetLogList(serviceAlias string) ([]string, error) GetLogInstance(serviceID string) (string, error) GetLevelLog(eventID string, level string) (*api_model.DataLog, error) GetLogFile(serviceAlias, fileName string) (string, string, error) GetEvents(target, targetID string, page, size int) ([]*dbmodel.ServiceEvent, int, error) }
EventHandler event handler interface
type GatewayAction ¶
type GatewayAction struct {
// contains filtered or unexported fields
}
GatewayAction -
func CreateGatewayManager ¶
func CreateGatewayManager(dbmanager db.Manager, mqclient client.MQClient, etcdCli *clientv3.Client) *GatewayAction
CreateGatewayManager creates gateway manager.
func (*GatewayAction) AddCertificate ¶
func (g *GatewayAction) AddCertificate(req *apimodel.AddHTTPRuleStruct, tx *gorm.DB) error
AddCertificate adds certificate to db if it doesn't exists
func (*GatewayAction) AddHTTPRule ¶
func (g *GatewayAction) AddHTTPRule(req *apimodel.AddHTTPRuleStruct) (string, error)
AddHTTPRule adds http rule to db if it doesn't exists.
func (*GatewayAction) AddRuleExtensions ¶
func (g *GatewayAction) AddRuleExtensions(ruleID string, ruleExtensions []*apimodel.RuleExtensionStruct, tx *gorm.DB) error
AddRuleExtensions adds rule extensions to db if any of they doesn't exists
func (*GatewayAction) AddTCPRule ¶
func (g *GatewayAction) AddTCPRule(req *apimodel.AddTCPRuleStruct) (string, error)
AddTCPRule adds tcp rule.
func (*GatewayAction) DeleteHTTPRule ¶
func (g *GatewayAction) DeleteHTTPRule(req *apimodel.DeleteHTTPRuleStruct) (string, error)
DeleteHTTPRule deletes http rule, including certificate and rule extensions
func (*GatewayAction) DeleteHTTPRuleByServiceIDWithTransaction ¶
func (g *GatewayAction) DeleteHTTPRuleByServiceIDWithTransaction(sid string, tx *gorm.DB) error
DeleteHTTPRuleByServiceIDWithTransaction deletes http rule, including certificate and rule extensions
func (*GatewayAction) DeleteTCPRule ¶
func (g *GatewayAction) DeleteTCPRule(req *apimodel.DeleteTCPRuleStruct) (string, error)
DeleteTCPRule deletes a tcp rule
func (*GatewayAction) DeleteTCPRuleByServiceIDWithTransaction ¶
func (g *GatewayAction) DeleteTCPRuleByServiceIDWithTransaction(sid string, tx *gorm.DB) error
DeleteTCPRuleByServiceIDWithTransaction deletes a tcp rule
func (*GatewayAction) GetAvailablePort ¶
func (g *GatewayAction) GetAvailablePort(ip string) (int, error)
GetAvailablePort returns a available port
func (*GatewayAction) GetGatewayIPs ¶
func (g *GatewayAction) GetGatewayIPs() []IPAndAvailablePort
GetGatewayIPs get all gateway node ips
func (*GatewayAction) ListHTTPRulesByCertID ¶
func (g *GatewayAction) ListHTTPRulesByCertID(certID string) ([]*model.HTTPRule, error)
ListHTTPRulesByCertID -
func (*GatewayAction) RuleConfig ¶
func (g *GatewayAction) RuleConfig(req *apimodel.RuleConfigReq) error
RuleConfig -
func (*GatewayAction) SendTask ¶
func (g *GatewayAction) SendTask(in map[string]interface{}) error
SendTask sends apply rules task
func (*GatewayAction) TCPIPPortExists ¶
func (g *GatewayAction) TCPIPPortExists(host string, port int) bool
TCPIPPortExists returns if the port exists
func (*GatewayAction) UpdCertificate ¶
func (g *GatewayAction) UpdCertificate(req *apimodel.UpdCertificateReq) error
UpdCertificate -
func (*GatewayAction) UpdateCertificate ¶
func (g *GatewayAction) UpdateCertificate(req apimodel.AddHTTPRuleStruct, httpRule *model.HTTPRule, tx *gorm.DB) error
UpdateCertificate updates certificate for http rule
func (*GatewayAction) UpdateHTTPRule ¶
func (g *GatewayAction) UpdateHTTPRule(req *apimodel.UpdateHTTPRuleStruct) (string, error)
UpdateHTTPRule updates http rule
func (*GatewayAction) UpdateTCPRule ¶
func (g *GatewayAction) UpdateTCPRule(req *apimodel.UpdateTCPRuleStruct, minPort int) (string, error)
UpdateTCPRule updates a tcp rule
type GatewayHandler ¶
type GatewayHandler interface { AddHTTPRule(req *apimodel.AddHTTPRuleStruct) (string, error) UpdateHTTPRule(req *apimodel.UpdateHTTPRuleStruct) (string, error) DeleteHTTPRule(req *apimodel.DeleteHTTPRuleStruct) (string, error) DeleteHTTPRuleByServiceIDWithTransaction(sid string, tx *gorm.DB) error AddCertificate(req *apimodel.AddHTTPRuleStruct, tx *gorm.DB) error UpdateCertificate(req apimodel.AddHTTPRuleStruct, httpRule *dbmodel.HTTPRule, tx *gorm.DB) error AddTCPRule(req *apimodel.AddTCPRuleStruct) (string, error) UpdateTCPRule(req *apimodel.UpdateTCPRuleStruct, minPort int) (string, error) DeleteTCPRule(req *apimodel.DeleteTCPRuleStruct) (string, error) DeleteTCPRuleByServiceIDWithTransaction(sid string, tx *gorm.DB) error AddRuleExtensions(ruleID string, ruleExtensions []*apimodel.RuleExtensionStruct, tx *gorm.DB) error GetAvailablePort(ip string) (int, error) TCPIPPortExists(ip string, port int) bool SendTask(in map[string]interface{}) error RuleConfig(req *apimodel.RuleConfigReq) error UpdCertificate(req *apimodel.UpdCertificateReq) error GetGatewayIPs() []IPAndAvailablePort ListHTTPRulesByCertID(certID string) ([]*dbmodel.HTTPRule, error) }
GatewayHandler gateway api handler
func GetGatewayHandler ¶
func GetGatewayHandler() GatewayHandler
GetGatewayHandler returns a default GatewayHandler
type IPAndAvailablePort ¶
IPAndAvailablePort ip and advice available port
type Info ¶
type Info struct { Code string `json:"code"` Company string `json:"company"` Node int64 `json:"node"` CPU int64 `json:"cpu"` Memory int64 `json:"memory"` Tenant int64 `json:"tenant"` EndTime string `json:"end_time"` StartTime string `json:"start_time"` DataCenter int64 `json:"data_center"` ModuleList []string `json:"module_list"` }
Info license 信息
func ReadLicenseFromConsole ¶
ReadLicenseFromConsole 从控制台api获取license
func ReadLicenseFromFile ¶
ReadLicenseFromFile 从文件获取license
type K8sPodInfo ¶
type K8sPodInfo struct { PodName string `json:"pod_name"` PodIP string `json:"pod_ip"` PodStatus string `json:"pod_status"` ServiceID string `json:"service_id"` Container map[string]map[string]string `json:"container"` }
K8sPodInfo for api
type K8sPodInfos ¶
type K8sPodInfos struct { NewPods []*K8sPodInfo `json:"new_pods"` OldPods []*K8sPodInfo `json:"old_pods"` }
K8sPodInfos -
type LicenseAction ¶
type LicenseAction struct{}
LicenseAction LicenseAction
func (*LicenseAction) PackLicense ¶
func (l *LicenseAction) PackLicense(encrypted string) ([]byte, error)
PackLicense PackLicense
func (*LicenseAction) StoreLicense ¶
func (l *LicenseAction) StoreLicense(license, token string) error
StoreLicense StoreLicense
type LicenseHandler ¶
type LicenseHandler interface { PackLicense(encrypted string) ([]byte, error) StoreLicense(license, token string) error }
LicenseHandler LicenseAction
func GetLicenseHandler ¶
func GetLicenseHandler() LicenseHandler
GetLicenseHandler get license handler
type LicenseInfoHandler ¶
type LicenseInfoHandler interface {
ShowInfos() (map[string]*api_model.LicenseInfo, error)
}
LicenseInfoHandler LicenseInfoHandler
func GetLicensesInfosHandler ¶
func GetLicensesInfosHandler() LicenseInfoHandler
GetLicensesInfosHandler GetLicensesInfosHandler
type LicensesInfos ¶
type LicensesInfos struct {
Infos map[string]*api_model.LicenseInfo
}
LicensesInfos LicensesInfos 验证
func (*LicensesInfos) ShowInfos ¶
func (l *LicensesInfos) ShowInfos() (map[string]*api_model.LicenseInfo, error)
ShowInfos ShowInfos
type LogAction ¶
type LogAction struct { EtcdEndpoints []string // contains filtered or unexported fields }
LogAction log action struct
func CreateLogManager ¶
CreateLogManager get log manager
func (*LogAction) GetEvents ¶
func (l *LogAction) GetEvents(target, targetID string, page, size int) ([]*dbmodel.ServiceEvent, int, error)
GetEvents get target logs
func (*LogAction) GetLevelLog ¶
GetLevelLog get event log
func (*LogAction) GetLogFile ¶
GetLogFile GetLogFile
func (*LogAction) GetLogInstance ¶
GetLogInstance get log web socket instance
type NetRulesAction ¶
type NetRulesAction struct {
// contains filtered or unexported fields
}
NetRulesAction rules action struct
func CreateNetRulesManager ¶
func CreateNetRulesManager(etcdCli *clientv3.Client) *NetRulesAction
CreateNetRulesManager get net rules manager
func (*NetRulesAction) CreateDownStreamNetRules ¶
func (n *NetRulesAction) CreateDownStreamNetRules( tenantID string, rs *api_model.SetNetDownStreamRuleStruct) *util.APIHandleError
CreateDownStreamNetRules CreateDownStreamNetRules
func (*NetRulesAction) GetDownStreamNetRule ¶
func (n *NetRulesAction) GetDownStreamNetRule( tenantID, serviceAlias, destServiceAlias, port string) (*api_model.NetRulesDownStreamBody, *util.APIHandleError)
GetDownStreamNetRule GetDownStreamNetRule
func (*NetRulesAction) UpdateDownStreamNetRule ¶
func (n *NetRulesAction) UpdateDownStreamNetRule( tenantID string, urs *api_model.UpdateNetDownStreamRuleStruct) *util.APIHandleError
UpdateDownStreamNetRule UpdateDownStreamNetRule
type NetRulesHandler ¶
type NetRulesHandler interface { CreateDownStreamNetRules( tenantID string, rs *api_model.SetNetDownStreamRuleStruct) *util.APIHandleError GetDownStreamNetRule( tenantID, serviceAlias, destServiceAlias, port string) (*api_model.NetRulesDownStreamBody, *util.APIHandleError) UpdateDownStreamNetRule( tenantID string, urs *api_model.UpdateNetDownStreamRuleStruct) *util.APIHandleError }
NetRulesHandler net rules handler
type OperationHandler ¶
type OperationHandler struct {
// contains filtered or unexported fields
}
OperationHandler operation handler
func CreateOperationHandler ¶
func CreateOperationHandler(mqCli gclient.MQClient) *OperationHandler
CreateOperationHandler create operation handler
func GetOperationHandler ¶
func GetOperationHandler() *OperationHandler
GetOperationHandler get handler
func (*OperationHandler) Build ¶
func (o *OperationHandler) Build(buildInfo model.BuildInfoRequestStruct) (re OperationResult)
Build service build,will create new version if deploy version not define, will create by time
func (*OperationHandler) Restart ¶
func (o *OperationHandler) Restart(restartInfo model.StartOrStopInfoRequestStruct) (re OperationResult)
Restart service restart TODO
func (*OperationHandler) RollBack ¶
func (o *OperationHandler) RollBack(rollback model.RollbackInfoRequestStruct) (re OperationResult)
RollBack service rollback
func (*OperationHandler) Start ¶
func (o *OperationHandler) Start(startInfo model.StartOrStopInfoRequestStruct) (re OperationResult)
Start service start
func (*OperationHandler) Stop ¶
func (o *OperationHandler) Stop(stopInfo model.StartOrStopInfoRequestStruct) (re OperationResult)
Stop service stop
func (*OperationHandler) Upgrade ¶
func (o *OperationHandler) Upgrade(ru model.UpgradeInfoRequestStruct) (re OperationResult)
Upgrade service upgrade
type OperationResult ¶
type OperationResult struct { ServiceID string `json:"service_id"` Operation string `json:"operation"` EventID string `json:"event_id"` Status string `json:"status"` ErrMsg string `json:"err_message"` DeployVersion string `json:"deploy_version"` }
OperationResult batch operation result
type PluginAction ¶
PluginAction plugin action struct
func CreatePluginManager ¶
func CreatePluginManager(mqClient client.MQClient) *PluginAction
CreatePluginManager get plugin manager
func (*PluginAction) AddDefaultEnv ¶
func (p *PluginAction) AddDefaultEnv(est *api_model.ENVStruct) *util.APIHandleError
AddDefaultEnv AddDefaultEnv
func (*PluginAction) BuildPluginManual ¶
func (p *PluginAction) BuildPluginManual(bps *api_model.BuildPluginStruct) (*dbmodel.TenantPluginBuildVersion, *util.APIHandleError)
BuildPluginManual BuildPluginManual
func (*PluginAction) CreatePluginAct ¶
func (p *PluginAction) CreatePluginAct(cps *api_model.CreatePluginStruct) *util.APIHandleError
CreatePluginAct PluginAct
func (*PluginAction) DeleteDefaultEnv ¶
func (p *PluginAction) DeleteDefaultEnv(pluginID, versionID, name string) *util.APIHandleError
DeleteDefaultEnv DeleteDefaultEnv
func (*PluginAction) DeletePluginAct ¶
func (p *PluginAction) DeletePluginAct(pluginID, tenantID string) *util.APIHandleError
DeletePluginAct DeletePluginAct
func (*PluginAction) DeletePluginBuildVersion ¶
func (p *PluginAction) DeletePluginBuildVersion(pluginID, versionID string) *util.APIHandleError
DeletePluginBuildVersion DeletePluginBuildVersion
func (*PluginAction) GetAllPluginBuildVersions ¶
func (p *PluginAction) GetAllPluginBuildVersions(pluginID string) ([]*dbmodel.TenantPluginBuildVersion, *util.APIHandleError)
GetAllPluginBuildVersions GetAllPluginBuildVersions
func (*PluginAction) GetDefaultEnv ¶
func (p *PluginAction) GetDefaultEnv(pluginID, versionID string) ([]*dbmodel.TenantPluginDefaultENV, *util.APIHandleError)
GetDefaultEnv GetDefaultEnv
func (*PluginAction) GetEnvsWhichCanBeSet ¶
func (p *PluginAction) GetEnvsWhichCanBeSet(serviceID, pluginID string) (interface{}, *util.APIHandleError)
GetEnvsWhichCanBeSet GetEnvsWhichCanBeSet
func (*PluginAction) GetPluginBuildVersion ¶
func (p *PluginAction) GetPluginBuildVersion(pluginID, versionID string) (*dbmodel.TenantPluginBuildVersion, *util.APIHandleError)
GetPluginBuildVersion GetPluginBuildVersion
func (*PluginAction) GetPlugins ¶
func (p *PluginAction) GetPlugins(tenantID string) ([]*dbmodel.TenantPlugin, *util.APIHandleError)
GetPlugins get all plugins by tenantID
func (*PluginAction) UpdateDefaultEnv ¶
func (p *PluginAction) UpdateDefaultEnv(est *api_model.ENVStruct) *util.APIHandleError
UpdateDefaultEnv UpdateDefaultEnv
func (*PluginAction) UpdatePluginAct ¶
func (p *PluginAction) UpdatePluginAct(pluginID, tenantID string, cps *api_model.UpdatePluginStruct) *util.APIHandleError
UpdatePluginAct UpdatePluginAct
type PluginHandler ¶
type PluginHandler interface { CreatePluginAct(cps *api_model.CreatePluginStruct) *util.APIHandleError UpdatePluginAct(pluginID, tenantID string, cps *api_model.UpdatePluginStruct) *util.APIHandleError DeletePluginAct(pluginID, tenantID string) *util.APIHandleError GetPlugins(tenantID string) ([]*dbmodel.TenantPlugin, *util.APIHandleError) AddDefaultEnv(est *api_model.ENVStruct) *util.APIHandleError UpdateDefaultEnv(est *api_model.ENVStruct) *util.APIHandleError DeleteDefaultEnv(pluginID, versionID, envName string) *util.APIHandleError BuildPluginManual(bps *api_model.BuildPluginStruct) (*dbmodel.TenantPluginBuildVersion, *util.APIHandleError) GetAllPluginBuildVersions(pluginID string) ([]*dbmodel.TenantPluginBuildVersion, *util.APIHandleError) GetPluginBuildVersion(pluginID, versionID string) (*dbmodel.TenantPluginBuildVersion, *util.APIHandleError) DeletePluginBuildVersion(pluginID, versionID string) *util.APIHandleError GetDefaultEnv(pluginID, versionID string) ([]*dbmodel.TenantPluginDefaultENV, *util.APIHandleError) GetEnvsWhichCanBeSet(serviceID, pluginID string) (interface{}, *util.APIHandleError) }
PluginHandler plugin handler
type PodAction ¶
type PodAction struct {
// contains filtered or unexported fields
}
PodAction is an implementation of PodHandler
type PodHandler ¶
PodHandler defines handler methods about k8s pods.
func NewPodHandler ¶
func NewPodHandler(statusCli *client.AppRuntimeSyncClient) PodHandler
NewPodHandler creates a new PodHandler.
type QueryResult ¶
type QueryResult struct { Data struct { Type string `json:"resultType"` Result []map[string]interface{} `json:"result"` } `json:"data"` Status string `json:"status"` }
QueryResult contains result data for a query.
type RootAction ¶
type RootAction struct{}
RootAction root function action struct
func CreateRootFuncManager ¶
func CreateRootFuncManager(conf option.Config) *RootAction
CreateRootFuncManager get root func manager
func (*RootAction) ResolvePHP ¶
func (r *RootAction) ResolvePHP(cs *api_model.ComposerStruct) (string, error)
ResolvePHP php 应用构建
type RootFuncHandler ¶
type RootFuncHandler interface { }
RootFuncHandler root function handler interface
func GetRootFuncHandler ¶
func GetRootFuncHandler() RootFuncHandler
GetRootFuncHandler get root handler
type ServiceAction ¶
type ServiceAction struct { MQClient gclient.MQClient EtcdCli *clientv3.Client // contains filtered or unexported fields }
ServiceAction service act
func CreateManager ¶
func CreateManager(conf option.Config, mqClient gclient.MQClient, etcdCli *clientv3.Client, statusCli *client.AppRuntimeSyncClient) *ServiceAction
CreateManager create Manger
func (*ServiceAction) AddAutoscalerRule ¶
func (s *ServiceAction) AddAutoscalerRule(req *api_model.AutoscalerRuleReq) error
AddAutoscalerRule -
func (*ServiceAction) AddLabel ¶
func (s *ServiceAction) AddLabel(l *api_model.LabelsStruct, serviceID string) error
AddLabel add labels
func (*ServiceAction) CodeCheck ¶
func (s *ServiceAction) CodeCheck(c *api_model.CheckCodeStruct) error
CodeCheck code check
func (*ServiceAction) CreateTenandIDAndName ¶
func (s *ServiceAction) CreateTenandIDAndName(eid string) (string, string, error)
CreateTenandIDAndName create tenant_id and tenant_name
func (*ServiceAction) CreateTenant ¶
func (s *ServiceAction) CreateTenant(t *dbmodel.Tenants) error
CreateTenant create tenant
func (*ServiceAction) DeleteLabel ¶
func (s *ServiceAction) DeleteLabel(l *api_model.LabelsStruct, serviceID string) error
DeleteLabel deletes label
func (*ServiceAction) DeletePluginConfig ¶
func (s *ServiceAction) DeletePluginConfig(serviceID, pluginID string) *util.APIHandleError
DeletePluginConfig delete service plugin dynamic discovery config
func (*ServiceAction) EnvAttr ¶
func (s *ServiceAction) EnvAttr(action string, at *dbmodel.TenantServiceEnvVar) error
EnvAttr env attr
func (*ServiceAction) GetDepVolumes ¶
func (s *ServiceAction) GetDepVolumes(serviceID string) ([]*dbmodel.TenantServiceMountRelation, *util.APIHandleError)
GetDepVolumes 获取依赖存储
func (*ServiceAction) GetPagedTenantRes ¶
func (s *ServiceAction) GetPagedTenantRes(offset, len int) ([]*api_model.TenantResource, int, error)
GetPagedTenantRes get pagedTenantServiceRes(s)
func (*ServiceAction) GetPodContainerMemory ¶
func (s *ServiceAction) GetPodContainerMemory(podNames []string) (map[string]map[string]string, error)
GetPodContainerMemory Use Prometheus to query memory resources
func (*ServiceAction) GetPods ¶
func (s *ServiceAction) GetPods(serviceID string) (*K8sPodInfos, error)
GetPods get pods
func (*ServiceAction) GetService ¶
func (s *ServiceAction) GetService(tenantID string) ([]*dbmodel.TenantServices, error)
GetService get service(s)
func (*ServiceAction) GetServiceCheckInfo ¶
func (s *ServiceAction) GetServiceCheckInfo(uuid string) (*exector.ServiceCheckResult, *util.APIHandleError)
GetServiceCheckInfo get application source detection information
func (*ServiceAction) GetServiceDeployInfo ¶
func (s *ServiceAction) GetServiceDeployInfo(tenantID, serviceID string) (*pb.DeployInfo, *util.APIHandleError)
GetServiceDeployInfo get service deploy info
func (*ServiceAction) GetServicesStatus ¶
func (s *ServiceAction) GetServicesStatus(tenantID string, serviceIDs []string) map[string]string
GetServicesStatus 获取一组应用状态,若 serviceIDs为空,获取租户所有应用状态
func (*ServiceAction) GetStatus ¶
func (s *ServiceAction) GetStatus(serviceID string) (*api_model.StatusList, error)
GetStatus GetStatus
func (*ServiceAction) GetTenantRes ¶
func (s *ServiceAction) GetTenantRes(uuid string) (*api_model.TenantResource, error)
GetTenantRes get pagedTenantServiceRes(s)
func (*ServiceAction) GetTenantServicePluginRelation ¶
func (s *ServiceAction) GetTenantServicePluginRelation(serviceID string) ([]*dbmodel.TenantServicePluginRelation, *util.APIHandleError)
GetTenantServicePluginRelation GetTenantServicePluginRelation
func (*ServiceAction) GetVolumes ¶
func (s *ServiceAction) GetVolumes(serviceID string) ([]*dbmodel.TenantServiceVolume, *util.APIHandleError)
GetVolumes 获取应用全部存储
func (*ServiceAction) LanguageSet ¶
func (s *ServiceAction) LanguageSet(langS *api_model.LanguageSet) error
LanguageSet language set
func (*ServiceAction) ListScalingRecords ¶
func (s *ServiceAction) ListScalingRecords(serviceID string, page, pageSize int) ([]*dbmodel.TenantServiceScalingRecords, int, error)
ListScalingRecords -
func (*ServiceAction) ListVersionInfo ¶
func (s *ServiceAction) ListVersionInfo(serviceID string) (*api_model.BuildListRespVO, error)
ListVersionInfo lists version info
func (*ServiceAction) PortInner ¶
func (s *ServiceAction) PortInner(tenantName, serviceID, operation string, port int) error
PortInner 端口对内服务操作 TODO: send task to worker
func (*ServiceAction) PortOuter ¶
func (s *ServiceAction) PortOuter(tenantName, serviceID string, containerPort int, servicePort *api_model.ServicePortInnerOrOuter) (*dbmodel.TenantServiceLBMappingPort, string, error)
PortOuter 端口对外服务操作
func (*ServiceAction) PortVar ¶
func (s *ServiceAction) PortVar(action, tenantID, serviceID string, vps *api_model.ServicePorts, oldPort int) error
PortVar port var
func (*ServiceAction) RollBack ¶
func (s *ServiceAction) RollBack(rs *api_model.RollbackStruct) error
RollBack RollBack
func (*ServiceAction) SavePluginConfig ¶
func (s *ServiceAction) SavePluginConfig(serviceID, pluginID string, config *api_model.ResourceSpec) *util.APIHandleError
SavePluginConfig save plugin dynamic discovery config
func (*ServiceAction) ServiceBuild ¶
func (s *ServiceAction) ServiceBuild(tenantID, serviceID string, r *api_model.BuildServiceStruct) error
ServiceBuild service build
func (*ServiceAction) ServiceCheck ¶
func (s *ServiceAction) ServiceCheck(scs *api_model.ServiceCheckStruct) (string, string, *util.APIHandleError)
ServiceCheck check service build source
func (*ServiceAction) ServiceCreate ¶
func (s *ServiceAction) ServiceCreate(sc *api_model.ServiceStruct) error
ServiceCreate create service
func (*ServiceAction) ServiceDepend ¶
func (s *ServiceAction) ServiceDepend(action string, ds *api_model.DependService) error
ServiceDepend service depend
func (*ServiceAction) ServiceHorizontal ¶
func (s *ServiceAction) ServiceHorizontal(hs *model.HorizontalScalingTaskBody) error
ServiceHorizontal Service Horizontal
func (*ServiceAction) ServiceProbe ¶
func (s *ServiceAction) ServiceProbe(tsp *dbmodel.TenantServiceProbe, action string) error
ServiceProbe ServiceProbe
func (*ServiceAction) ServiceUpdate ¶
func (s *ServiceAction) ServiceUpdate(sc map[string]interface{}) error
ServiceUpdate update service
func (*ServiceAction) ServiceUpgrade ¶
func (s *ServiceAction) ServiceUpgrade(ru *model.RollingUpgradeTaskBody) error
ServiceUpgrade service upgrade
func (*ServiceAction) ServiceVertical ¶
func (s *ServiceAction) ServiceVertical(vs *model.VerticalScalingTaskBody) error
ServiceVertical vertical service
func (*ServiceAction) SetTenantServicePluginRelation ¶
func (s *ServiceAction) SetTenantServicePluginRelation(tenantID, serviceID string, pss *api_model.PluginSetStruct) (*dbmodel.TenantServicePluginRelation, *util.APIHandleError)
SetTenantServicePluginRelation SetTenantServicePluginRelation
func (*ServiceAction) StartStopService ¶
func (s *ServiceAction) StartStopService(sss *api_model.StartStopStruct) error
StartStopService start service
func (*ServiceAction) TenantServiceDeletePluginRelation ¶
func (s *ServiceAction) TenantServiceDeletePluginRelation(tenantID, serviceID, pluginID string) *util.APIHandleError
TenantServiceDeletePluginRelation uninstall plugin for app
func (*ServiceAction) TransServieToDelete ¶
func (s *ServiceAction) TransServieToDelete(tenantID, serviceID string) error
TransServieToDelete trans service info to delete table
func (*ServiceAction) UpdAutoscalerRule ¶
func (s *ServiceAction) UpdAutoscalerRule(req *api_model.AutoscalerRuleReq) error
UpdAutoscalerRule -
func (*ServiceAction) UpdVolume ¶
func (s *ServiceAction) UpdVolume(sid string, req *api_model.UpdVolumeReq) error
UpdVolume updates service volume.
func (*ServiceAction) UpdateLabel ¶
func (s *ServiceAction) UpdateLabel(l *api_model.LabelsStruct, serviceID string) error
UpdateLabel updates labels
func (*ServiceAction) UpdateServiceLabel ¶
func (s *ServiceAction) UpdateServiceLabel(serviceID, value string) error
UpdateServiceLabel UpdateLabel
func (*ServiceAction) UpdateTenantServicePluginRelation ¶
func (s *ServiceAction) UpdateTenantServicePluginRelation(serviceID string, pss *api_model.PluginSetStruct) (*dbmodel.TenantServicePluginRelation, *util.APIHandleError)
UpdateTenantServicePluginRelation UpdateTenantServicePluginRelation
func (*ServiceAction) UpdateVersionEnv ¶
func (s *ServiceAction) UpdateVersionEnv(uve *api_model.SetVersionEnv) *util.APIHandleError
UpdateVersionEnv UpdateVersionEnv
func (*ServiceAction) VolumeDependency ¶
func (s *ServiceAction) VolumeDependency(tsr *dbmodel.TenantServiceMountRelation, action string) *util.APIHandleError
VolumeDependency VolumeDependency
func (*ServiceAction) VolumnVar ¶
func (s *ServiceAction) VolumnVar(tsv *dbmodel.TenantServiceVolume, tenantID, fileContent, action string) *util.APIHandleError
VolumnVar var volumn
type ServiceDependency ¶
type ServiceDependency struct {
// contains filtered or unexported fields
}
ServiceDependency documents a set of services and their dependencies. provides the ability to build linked lists of dependencies and find circular dependencies.
func NewServiceDependency ¶
func NewServiceDependency(serviceIDs []string) (*ServiceDependency, error)
NewServiceDependency creates a new ServiceDependency.
type ServiceHandler ¶
type ServiceHandler interface { ServiceBuild(tenantID, serviceID string, r *api_model.BuildServiceStruct) error AddLabel(l *api_model.LabelsStruct, serviceID string) error DeleteLabel(l *api_model.LabelsStruct, serviceID string) error UpdateLabel(l *api_model.LabelsStruct, serviceID string) error UpdateServiceLabel(serviceID, value string) error StartStopService(s *api_model.StartStopStruct) error ServiceVertical(v *model.VerticalScalingTaskBody) error ServiceHorizontal(h *model.HorizontalScalingTaskBody) error ServiceUpgrade(r *model.RollingUpgradeTaskBody) error ServiceCreate(ts *api_model.ServiceStruct) error ServiceUpdate(sc map[string]interface{}) error LanguageSet(langS *api_model.LanguageSet) error GetService(tenantID string) ([]*dbmodel.TenantServices, error) GetPagedTenantRes(offset, len int) ([]*api_model.TenantResource, int, error) GetTenantRes(uuid string) (*api_model.TenantResource, error) CodeCheck(c *api_model.CheckCodeStruct) error ServiceDepend(action string, ds *api_model.DependService) error EnvAttr(action string, at *dbmodel.TenantServiceEnvVar) error PortVar(action string, tenantID, serviceID string, vp *api_model.ServicePorts, oldPort int) error PortOuter(tenantName, serviceID string, containerPort int, servicePort *api_model.ServicePortInnerOrOuter) (*dbmodel.TenantServiceLBMappingPort, string, error) PortInner(tenantName, serviceID, operation string, port int) error VolumnVar(avs *dbmodel.TenantServiceVolume, tenantID, fileContent, action string) *util.APIHandleError UpdVolume(sid string, req *api_model.UpdVolumeReq) error VolumeDependency(tsr *dbmodel.TenantServiceMountRelation, action string) *util.APIHandleError GetDepVolumes(serviceID string) ([]*dbmodel.TenantServiceMountRelation, *util.APIHandleError) GetVolumes(serviceID string) ([]*dbmodel.TenantServiceVolume, *util.APIHandleError) ServiceProbe(tsp *dbmodel.TenantServiceProbe, action string) error RollBack(rs *api_model.RollbackStruct) error GetStatus(serviceID string) (*api_model.StatusList, error) GetServicesStatus(tenantID string, services []string) map[string]string CreateTenant(*dbmodel.Tenants) error CreateTenandIDAndName(eid string) (string, string, error) GetPods(serviceID string) (*K8sPodInfos, error) TransServieToDelete(tenantID, serviceID string) error TenantServiceDeletePluginRelation(tenantID, serviceID, pluginID string) *util.APIHandleError GetTenantServicePluginRelation(serviceID string) ([]*dbmodel.TenantServicePluginRelation, *util.APIHandleError) SetTenantServicePluginRelation(tenantID, serviceID string, pss *api_model.PluginSetStruct) (*dbmodel.TenantServicePluginRelation, *util.APIHandleError) UpdateTenantServicePluginRelation(serviceID string, pss *api_model.PluginSetStruct) (*dbmodel.TenantServicePluginRelation, *util.APIHandleError) UpdateVersionEnv(uve *api_model.SetVersionEnv) *util.APIHandleError DeletePluginConfig(serviceID, pluginID string) *util.APIHandleError ServiceCheck(*api_model.ServiceCheckStruct) (string, string, *util.APIHandleError) GetServiceCheckInfo(uuid string) (*exector.ServiceCheckResult, *util.APIHandleError) GetServiceDeployInfo(tenantID, serviceID string) (*pb.DeployInfo, *util.APIHandleError) ListVersionInfo(serviceID string) (*api_model.BuildListRespVO, error) AddAutoscalerRule(req *api_model.AutoscalerRuleReq) error UpdAutoscalerRule(req *api_model.AutoscalerRuleReq) error ListScalingRecords(serviceID string, page, pageSize int) ([]*dbmodel.TenantServiceScalingRecords, int, error) }
ServiceHandler service handler
type TenantAction ¶
type TenantAction struct { MQClient mqclient.MQClient OptCfg *option.Config // contains filtered or unexported fields }
TenantAction tenant act
func CreateTenManager ¶
func CreateTenManager(mqc mqclient.MQClient, statusCli *client.AppRuntimeSyncClient, optCfg *option.Config) *TenantAction
CreateTenManager create Manger
func (*TenantAction) BindTenantsResource ¶
func (t *TenantAction) BindTenantsResource(source []*dbmodel.Tenants) api_model.TenantList
BindTenantsResource query tenant resource used and sort
func (*TenantAction) DeleteTenant ¶
func (t *TenantAction) DeleteTenant(tenantID string) error
DeleteTenant deletes tenant based on the given tenantID.
tenant can only be deleted without service or plugin
func (*TenantAction) GetAllocatableResources ¶
func (t *TenantAction) GetAllocatableResources() (*ClusterResourceStats, error)
GetAllocatableResources returns allocatable cpu and memory (MB)
func (*TenantAction) GetProtocols ¶
func (t *TenantAction) GetProtocols() ([]*dbmodel.RegionProcotols, *util.APIHandleError)
GetProtocols GetProtocols
func (*TenantAction) GetServicesResources ¶
func (t *TenantAction) GetServicesResources(tr *api_model.ServicesResources) (re map[string]map[string]interface{}, err error)
GetServicesResources Gets the resource usage of the specified service.
func (*TenantAction) GetServicesStatus ¶
func (t *TenantAction) GetServicesStatus(ids string) map[string]string
GetServicesStatus returns a list of service status matching ids.
func (*TenantAction) GetTenantResource ¶
func (t *TenantAction) GetTenantResource(tenantID string) (ts TenantResourceStats, err error)
GetTenantResource get tenant resource
func (*TenantAction) GetTenants ¶
func (t *TenantAction) GetTenants(query string) ([]*dbmodel.Tenants, error)
GetTenants get tenants
func (*TenantAction) GetTenantsByEid ¶
func (t *TenantAction) GetTenantsByEid(eid, query string) ([]*dbmodel.Tenants, error)
GetTenantsByEid GetTenantsByEid
func (*TenantAction) GetTenantsByName ¶
func (t *TenantAction) GetTenantsByName(name string) (*dbmodel.Tenants, error)
GetTenantsByName get tenants
func (*TenantAction) GetTenantsByUUID ¶
func (t *TenantAction) GetTenantsByUUID(uuid string) (*dbmodel.Tenants, error)
GetTenantsByUUID get tenants
func (*TenantAction) GetTenantsName ¶
func (t *TenantAction) GetTenantsName() ([]string, error)
GetTenantsName get tenants name
func (*TenantAction) GetTenantsResources ¶
func (t *TenantAction) GetTenantsResources(tr *api_model.TenantResources) (map[string]map[string]interface{}, error)
GetTenantsResources Gets the resource usage of the specified tenant.
func (*TenantAction) IsClosedStatus ¶
func (t *TenantAction) IsClosedStatus(status string) bool
IsClosedStatus checks if the status is closed status.
func (*TenantAction) StatsMemCPU ¶
func (t *TenantAction) StatsMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error)
StatsMemCPU StatsMemCPU
func (*TenantAction) TenantsSum ¶
func (t *TenantAction) TenantsSum() (int, error)
TenantsSum TenantsSum
func (*TenantAction) TotalMemCPU ¶
func (t *TenantAction) TotalMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error)
TotalMemCPU StatsMemCPU
func (*TenantAction) TransPlugins ¶
func (t *TenantAction) TransPlugins(tenantID, tenantName, fromTenant string, pluginList []string) *util.APIHandleError
TransPlugins TransPlugins
func (*TenantAction) UpdateTenant ¶
func (t *TenantAction) UpdateTenant(tenant *dbmodel.Tenants) error
UpdateTenant update tenant info
type TenantHandler ¶
type TenantHandler interface { GetTenants(query string) ([]*dbmodel.Tenants, error) GetTenantsByName(name string) (*dbmodel.Tenants, error) GetTenantsByEid(eid, query string) ([]*dbmodel.Tenants, error) GetTenantsByUUID(uuid string) (*dbmodel.Tenants, error) GetTenantsName() ([]string, error) StatsMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error) TotalMemCPU(services []*dbmodel.TenantServices) (*api_model.StatsInfo, error) GetTenantsResources(tr *api_model.TenantResources) (map[string]map[string]interface{}, error) GetTenantResource(tenantID string) (TenantResourceStats, error) GetAllocatableResources() (*ClusterResourceStats, error) GetServicesResources(tr *api_model.ServicesResources) (map[string]map[string]interface{}, error) TenantsSum() (int, error) GetProtocols() ([]*dbmodel.RegionProcotols, *util.APIHandleError) TransPlugins(tenantID, tenantName, fromTenant string, pluginList []string) *util.APIHandleError GetServicesStatus(ids string) map[string]string IsClosedStatus(status string) bool BindTenantsResource(source []*dbmodel.Tenants) api_model.TenantList UpdateTenant(*dbmodel.Tenants) error DeleteTenant(tenantID string) error }
TenantHandler tenant handler
type TenantResourceStats ¶
type TenantResourceStats struct { TenantID string `json:"tenant_id,omitempty"` CPURequest int64 `json:"cpu_request,omitempty"` CPULimit int64 `json:"cpu_limit,omitempty"` MemoryRequest int64 `json:"memory_request,omitempty"` MemoryLimit int64 `json:"memory_limit,omitempty"` RunningAppNum int64 `json:"running_app_num"` UnscdCPUReq int64 `json:"unscd_cpu_req,omitempty"` UnscdCPULimit int64 `json:"unscd_cpu_limit,omitempty"` UnscdMemoryReq int64 `json:"unscd_memory_req,omitempty"` UnscdMemoryLimit int64 `json:"unscd_memory_limit,omitempty"` }
TenantResourceStats tenant resource stats
type ThirdPartyServiceHanlder ¶
type ThirdPartyServiceHanlder struct {
// contains filtered or unexported fields
}
ThirdPartyServiceHanlder handles business logic for all third-party services
func Create3rdPartySvcHandler ¶
func Create3rdPartySvcHandler(dbmanager db.Manager, statusCli *client.AppRuntimeSyncClient) *ThirdPartyServiceHanlder
Create3rdPartySvcHandler creates a new *ThirdPartyServiceHanlder.
func Get3rdPartySvcHandler ¶
func Get3rdPartySvcHandler() *ThirdPartyServiceHanlder
Get3rdPartySvcHandler returns the defalut ThirdParthServiceHanlder
func (*ThirdPartyServiceHanlder) AddEndpoints ¶
func (t *ThirdPartyServiceHanlder) AddEndpoints(sid string, d *model.AddEndpiontsReq) error
AddEndpoints adds endpoints for third-party service.
func (*ThirdPartyServiceHanlder) DelEndpoints ¶
func (t *ThirdPartyServiceHanlder) DelEndpoints(epid, sid string) error
DelEndpoints deletes endpoints for third-party service.
func (*ThirdPartyServiceHanlder) ListEndpoints ¶
func (t *ThirdPartyServiceHanlder) ListEndpoints(sid string) ([]*model.EndpointResp, error)
ListEndpoints lists third-party service endpoints.
func (*ThirdPartyServiceHanlder) UpdEndpoints ¶
func (t *ThirdPartyServiceHanlder) UpdEndpoints(d *model.UpdEndpiontsReq) error
UpdEndpoints updates endpoints for third-party service.
type TokenIdenAction ¶
type TokenIdenAction struct{}
TokenIdenAction TokenIdenAction
func CreateTokenIdenManager ¶
func CreateTokenIdenManager(conf option.Config) (*TokenIdenAction, error)
CreateTokenIdenManager token identification
func (*TokenIdenAction) AddAPIManager ¶
func (t *TokenIdenAction) AddAPIManager(am *api_model.APIManager) *util.APIHandleError
AddAPIManager AddAPIManager
func (*TokenIdenAction) AddTokenIntoMap ¶
func (t *TokenIdenAction) AddTokenIntoMap(rui *dbmodel.RegionUserInfo)
AddTokenIntoMap AddTokenIntoMap
func (*TokenIdenAction) CheckToken ¶
func (t *TokenIdenAction) CheckToken(token, uri string) bool
CheckToken CheckToken
func (*TokenIdenAction) DeleteAPIManager ¶
func (t *TokenIdenAction) DeleteAPIManager(am *api_model.APIManager) *util.APIHandleError
DeleteAPIManager DeleteAPIManager
func (*TokenIdenAction) DeleteTokenFromMap ¶
func (t *TokenIdenAction) DeleteTokenFromMap(oldtoken string, rui *dbmodel.RegionUserInfo)
DeleteTokenFromMap DeleteTokenFromMap
func (*TokenIdenAction) GetAPIManager ¶
func (t *TokenIdenAction) GetAPIManager() map[string][]*dbmodel.RegionAPIClass
GetAPIManager GetAPIManager
func (*TokenIdenAction) InitTokenMap ¶
func (t *TokenIdenAction) InitTokenMap() error
InitTokenMap InitTokenMap
type TokenMapHandler ¶
type TokenMapHandler interface { AddTokenIntoMap(rui *dbmodel.RegionUserInfo) DeleteTokenFromMap(oldtoken string, rui *dbmodel.RegionUserInfo) CheckToken(token, uri string) bool GetAPIManager() map[string][]*dbmodel.RegionAPIClass AddAPIManager(am *api_model.APIManager) *util.APIHandleError DeleteAPIManager(am *api_model.APIManager) *util.APIHandleError InitTokenMap() error }
TokenMapHandler DefaultTokenMapHandler
func GetTokenIdenHandler ¶
func GetTokenIdenHandler() TokenMapHandler
GetTokenIdenHandler GetTokenIdenHandler
type VersionInfo ¶
type VersionInfo struct {
Version []*LangInfo `json:"version"`
}
VersionInfo VersionInfo
Source Files ¶
- LicenseHandler.go
- PluginHandler.go
- app.go
- app_restore_action.go
- app_restore_handler.go
- cloud.go
- cloudHandler.go
- event.go
- eventLog.go
- eventlog_interface.go
- gateway_action.go
- gateway_handler.go
- handler.go
- license.go
- license_pack.go
- netRules.go
- netRulesHandler.go
- plugin.go
- pod_action.go
- pod_handler.go
- proxy.go
- rootFunc.go
- rootFuncHandler.go
- service.go
- service_batch_operation.go
- service_check.go
- service_handler.go
- service_operation.go
- service_plugin.go
- tenant.go
- tenant_handler.go
- tenantsResource.go
- third_party_service_handler.go
- tokenIden.go
- tokenIdenHandler.go
- types.go