handler

package
v3.7.0-rc.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2018 License: LGPL-3.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePack

func BasePack(text []byte) (string, error)

BasePack base pack

func CheckLabel

func CheckLabel(serviceID string) bool

CheckLabel check label

func CheckMapKey

func CheckMapKey(rebody map[string]interface{}, key string, defaultValue interface{}) map[string]interface{}

CheckMapKey CheckMapKey

func CreateDefaultTokenMap

func CreateDefaultTokenMap(conf option.Config)

CreateDefaultTokenMap CreateDefaultTokenMap

func CreateLicenseManger

func CreateLicenseManger() error

CreateLicenseManger create service manager

func CreateLicensesInfoManager

func CreateLicensesInfoManager() error

CreateLicensesInfoManager CreateLicensesInfoManager

func CreateRootFuncHandler

func CreateRootFuncHandler(conf option.Config) error

CreateRootFuncHandler create root func handler

func CreateTokenIdenHandler

func CreateTokenIdenHandler(conf option.Config) error

CreateTokenIdenHandler create token identification handler

func GetAPPBackupHandler

func GetAPPBackupHandler() *group.BackupHandle

GetAPPBackupHandler GetAPPBackupHandler

func GetBuilderProxy

func GetBuilderProxy() proxy.Proxy

GetBuilderProxy GetNodeProxy

func GetDefaultSourceURI

func GetDefaultSourceURI() map[string][]*dbmodel.RegionAPIClass

GetDefaultSourceURI GetDefaultSourceURI

func GetDefaultTokenMap

func GetDefaultTokenMap() map[string]*dbmodel.RegionUserInfo

GetDefaultTokenMap GetDefaultTokenMap

func GetMonitorProxy

func GetMonitorProxy() proxy.Proxy

GetMonitorProxy GetMonitorProxy

func GetNodeProxy

func GetNodeProxy() proxy.Proxy

GetNodeProxy GetNodeProxy

func GetPluginShareHandle

func GetPluginShareHandle() *share.PluginShareHandle

GetPluginShareHandle get plugin share handle

func GetPodList

func GetPodList(namespace, serviceAlias string, cli *kubernetes.Clientset) (*v1.PodList, error)

GetPodList Get pod list

func GetPrometheusProxy

func GetPrometheusProxy() proxy.Proxy

GetPrometheusProxy GetPrometheusProxy

func GetShareHandle

func GetShareHandle() *share.ServiceShareHandle

GetShareHandle get share handle

func InitHandle

func InitHandle(conf option.Config, statusCli *client.AppRuntimeSyncClient) error

InitHandle 初始化handle

func InitProxy

func InitProxy(conf option.Config)

InitProxy 初始化

func ListLicense

func ListLicense() (map[string]*api_model.LicenseInfo, error)

ListLicense lise license

func SetTokenCache

func SetTokenCache(info *dbmodel.RegionUserInfo)

SetTokenCache SetTokenCache

func TransStatus

func TransStatus(eStatus string) string

TransStatus trans service status

Types

type AppAction

type AppAction struct {
	MQClient pb.TaskQueueClient
	// contains filtered or unexported fields
}

func CreateAppManager

func CreateAppManager(mqClient pb.TaskQueueClient) *AppAction

func GetAppHandler

func GetAppHandler() *AppAction

GetAppHandler GetAppHandler

func (*AppAction) Complete

func (a *AppAction) Complete(tr *model.ExportAppStruct) error

func (*AppAction) ExportApp

func (a *AppAction) ExportApp(tr *model.ExportAppStruct) error

ExportApp ExportApp

func (*AppAction) GetStaticDir

func (a *AppAction) GetStaticDir() string

func (*AppAction) ImportApp

func (a *AppAction) ImportApp(importApp *model.ImportAppStruct) error

type CloudAction

type CloudAction struct {
	RegionTag string
	APISSL    bool
	CAPath    string
	KeyPath   string
}

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

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

func GetCloudManager

func GetCloudManager() CloudHandler

GetCloudManager get manager

type EventHandler

type EventHandler interface {
	GetLinesLogs(alias string, n int) ([]byte, error)
	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)
}

EventHandler event handler interface

func GetEventHandler

func GetEventHandler() EventHandler

GetEventHandler get event handler

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

func ReadLicenseFromConsole(token string, defaultLicense string) (Info, error)

ReadLicenseFromConsole 从控制台api获取license

func ReadLicenseFromFile

func ReadLicenseFromFile(licenseFile string) (Info, error)

ReadLicenseFromFile 从文件获取license

type LangInfo

type LangInfo struct {
	Lang  string `json:"lang"`
	Major []*MajorInfo
}

LangInfo LangInfo

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
}

LogAction log action struct

func CreateLogManager

func CreateLogManager(etcdEndpoint []string) *LogAction

CreateLogManager get log manager

func (*LogAction) GetLevelLog

func (l *LogAction) GetLevelLog(eventID string, level string) (*api_model.DataLog, error)

GetLevelLog 获取指定操作的操作日志

func (*LogAction) GetLinesLogs

func (l *LogAction) GetLinesLogs(alias string, n int) ([]byte, error)

GetLinesLogs GetLinesLogs

func (*LogAction) GetLogFile

func (l *LogAction) GetLogFile(serviceAlias, fileName string) (string, string, error)

GetLogFile GetLogFile

func (*LogAction) GetLogInstance

func (l *LogAction) GetLogInstance(serviceID string) (string, error)

GetLogInstance get log web socket instance

func (*LogAction) GetLogList

func (l *LogAction) GetLogList(serviceAlias string) ([]string, error)

GetLogList get log list

type MajorInfo

type MajorInfo struct {
	Major int `json:"major"`
	Minor []*MinorInfo
}

MajorInfo MajorInfo

type MinorInfo

type MinorInfo struct {
	Minor int   `json:"minor"`
	Patch []int `json:"patch"`
}

MinorInfo MinorInfo

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

func GetRulesManager

func GetRulesManager() NetRulesHandler

GetRulesManager get manager

type PluginAction

type PluginAction struct {
	MQClient pb.TaskQueueClient
}

PluginAction plugin action struct

func CreatePluginManager

func CreatePluginManager(mqClient pb.TaskQueueClient) *PluginAction

CreatePluginManager get plugin manager

func (*PluginAction) AddDefaultEnv

func (p *PluginAction) AddDefaultEnv(est *api_model.ENVStruct) *util.APIHandleError

AddDefaultEnv AddDefaultEnv

func (*PluginAction) BuildPluginManual

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

func GetPluginManager

func GetPluginManager() PluginHandler

GetPluginManager get manager

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   pb.TaskQueueClient
	KubeClient *kubernetes.Clientset
	EtcdCli    *clientv3.Client
	// contains filtered or unexported fields
}

ServiceAction service act

func CreateManager

func CreateManager(mqClient pb.TaskQueueClient,
	kubeClient *kubernetes.Clientset,
	etcdCli *clientv3.Client, statusCli *client.AppRuntimeSyncClient) *ServiceAction

CreateManager create Manger

func (*ServiceAction) AddLabel

func (s *ServiceAction) AddLabel(kind, serviceID string, amp []string) error

AddLabel add labels

func (*ServiceAction) ChangeLBPort

func (s *ServiceAction) ChangeLBPort(tenantID, serviceID string, containerPort, changelbPort int) (*dbmodel.TenantServiceLBMappingPort, *util.APIHandleError)

ChangeLBPort change lb mapping port only support change to existing port in this tenants

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

func (s *ServiceAction) DeleteComplexEnvs(tenantID, serviceAlias, pluginID string) *util.APIHandleError

DeleteComplexEnvs DeleteComplexEnvs

func (*ServiceAction) DeleteLabel

func (s *ServiceAction) DeleteLabel(kind, serviceID string, amp []string) error

DeleteLabel delete label

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

func (s *ServiceAction) GetPods(serviceID string) ([]*dbmodel.K8sPod, 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 获取应用源检测信息

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

func (s *ServiceAction) PortInner(tenantName, serviceID, operation string, port int) error

PortInner 端口对内服务操作

func (*ServiceAction) PortOuter

func (s *ServiceAction) PortOuter(tenantName, serviceID, operation string, port int) (*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) ServiceBuild

func (s *ServiceAction) ServiceBuild(tenantID, serviceID string, r *api_model.BuildServiceStruct) error

ServiceBuild service build

func (*ServiceAction) ServiceCheck

ServiceCheck 应用构建源检测

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.ServiceProbe, 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) ShareCloud

func (s *ServiceAction) ShareCloud(c *api_model.CloudShareStruct) error

ShareCloud share cloud

func (*ServiceAction) StartStopService

func (s *ServiceAction) StartStopService(sss *api_model.StartStopStruct) error

StartStopService start service

func (*ServiceAction) TenantServiceDeletePluginRelation

func (s *ServiceAction) TenantServiceDeletePluginRelation(serviceID, pluginID string) *util.APIHandleError

TenantServiceDeletePluginRelation uninstall plugin for app

func (*ServiceAction) TransServieToDelete

func (s *ServiceAction) TransServieToDelete(serviceID string) error

TransServieToDelete trans service info to delete table

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, action string) *util.APIHandleError

VolumnVar var volumn

type ServiceHandler

type ServiceHandler interface {
	ServiceBuild(tenantID, serviceID string, r *api_model.BuildServiceStruct) error
	AddLabel(kind, serviceID string, valueList []string) error
	DeleteLabel(kind, serviceID string, amp []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
	ShareCloud(c *api_model.CloudShareStruct) 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, operation string, port int) (*dbmodel.TenantServiceLBMappingPort, string, error)
	PortInner(tenantName, serviceID, operation string, port int) error
	ChangeLBPort(tenantID, serviceID string, containerPort, changelbPort int) (*dbmodel.TenantServiceLBMappingPort, *util.APIHandleError)
	VolumnVar(tsv *dbmodel.TenantServiceVolume, tenantID, action string) *util.APIHandleError
	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.ServiceProbe, 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) ([]*dbmodel.K8sPod, error)
	TransServieToDelete(serviceID string) error
	TenantServiceDeletePluginRelation(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
	DeleteComplexEnvs(tenantID, serviceAlias, pluginID string) *util.APIHandleError
	ServiceCheck(*api_model.ServiceCheckStruct) (string, string, *util.APIHandleError)
	GetServiceCheckInfo(uuid string) (*exector.ServiceCheckResult, *util.APIHandleError)
}

ServiceHandler service handler

func GetServiceManager

func GetServiceManager() ServiceHandler

GetServiceManager get manager

type SourcesAction

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

SourcesAction sources action struct

func CreateSourcesManager

func CreateSourcesManager(etcdCli *clientv3.Client) *SourcesAction

CreateSourcesManager get sources manager

func (*SourcesAction) CreateDefineSources

func (s *SourcesAction) CreateDefineSources(
	tenantID string, ss *api_model.SetDefineSourcesStruct) *util.APIHandleError

CreateDefineSources CreateDefineSources

func (*SourcesAction) DeleteDefineSources

func (s *SourcesAction) DeleteDefineSources(tenantID, sourceAlias, envName string) *util.APIHandleError

DeleteDefineSources DeleteDefineSources

func (*SourcesAction) GetDefineSources

func (s *SourcesAction) GetDefineSources(
	tenantID,
	sourceAlias,
	envName string) (*api_model.SourceSpec, *util.APIHandleError)

GetDefineSources GetDefineSources

func (*SourcesAction) UpdateDefineSources

func (s *SourcesAction) UpdateDefineSources(
	tenantID string, ss *api_model.SetDefineSourcesStruct) *util.APIHandleError

UpdateDefineSources UpdateDefineSources

type SourcesHandler

type SourcesHandler interface {
	CreateDefineSources(
		tenantID string,
		ss *api_model.SetDefineSourcesStruct) *util.APIHandleError
	DeleteDefineSources(
		tenantID,
		sourceAlias,
		envName string) *util.APIHandleError
	GetDefineSources(
		tenantID,
		sourceAlias,
		envName string) (*api_model.SourceSpec, *util.APIHandleError)
	UpdateDefineSources(
		tenantID string,
		ss *api_model.SetDefineSourcesStruct) *util.APIHandleError
}

SourcesHandler define source handler

func GetSourcesManager

func GetSourcesManager() SourcesHandler

GetSourcesManager get manager

type TenantAction

type TenantAction struct {
	MQClient   pb.TaskQueueClient
	KubeClient *kubernetes.Clientset
	// contains filtered or unexported fields
}

TenantAction tenant act

func CreateTenManager

func CreateTenManager(MQClient pb.TaskQueueClient, KubeClient *kubernetes.Clientset, statusCli *client.AppRuntimeSyncClient) *TenantAction

CreateTenManager create Manger

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

func (t *TenantAction) GetTenants() ([]*dbmodel.Tenants, error)

GetTenants get tenants

func (*TenantAction) GetTenantsByEid

func (t *TenantAction) GetTenantsByEid(eid 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) GetTenantsPaged

func (t *TenantAction) GetTenantsPaged(offset, len int) ([]*dbmodel.Tenants, error)

GetTenantsPaged GetTenantsPaged

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

type TenantHandler

type TenantHandler interface {
	GetTenants() ([]*dbmodel.Tenants, error)
	GetTenantsPaged(offset, len int) ([]*dbmodel.Tenants, error)
	GetTenantsByName(name string) (*dbmodel.Tenants, error)
	GetTenantsByEid(eid 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)
	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
}

TenantHandler tenant handler

func GetTenantManager

func GetTenantManager() TenantHandler

GetTenantManager get manager

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 TokenMap

type TokenMap map[string]*dbmodel.RegionUserInfo

TokenMap TokenMap

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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