Documentation ¶
Index ¶
- func CreateK8sWorkLoads(ctx context.Context, requestID, userName string, args *K8sWorkloadsArgs, ...) error
- func CreatePMService(username string, args *ServiceTmplBuildObject, log *zap.SugaredLogger) error
- func CreateWorkloadTemplate(userName string, args *commonmodels.Service, log *zap.SugaredLogger) error
- func DeleteServiceTemplate(serviceName, serviceType, productName, isEnvTemplate, visibility string, ...) error
- func EditFileContent(serviceName, productName, createdBy, requestID string, ...) error
- func GetDeployableEnvs(svcName, projectName string) ([]string, error)
- func GetFileContent(serviceName, productName string, param *GetFileContentParam, ...) (string, error)
- func GetFilePath(serviceName, productName string, revision int64, dir string, ...) ([]*types.FileInfo, error)
- func GetGerritServiceYaml(args *commonmodels.Service, log *zap.SugaredLogger) error
- func GetHarborURL(path string) (string, error)
- func ListAvailablePublicServices(productName string, log *zap.SugaredLogger) ([]*svcInfo, error)
- func ListServicePort(serviceName, serviceType, productName, excludeStatus string, revision int64, ...) ([]int, error)
- func ListServicesInExtenalEnv(tmpResp *commonservice.ServiceTmplResp, log *zap.SugaredLogger)
- func LoadKubeWorkloadsYaml(username string, params *LoadKubeWorkloadsYamlReq, force bool, ...) error
- func LoadServiceFromCodeHost(username string, codehostID int, ...) error
- func LoadServiceFromYamlTemplate(username string, req *LoadServiceFromYamlTemplateReq, force bool, ...) error
- func PreloadServiceFromCodeHost(codehostID int, ...) ([]string, error)
- func PreviewServiceFromYamlTemplate(req *LoadServiceFromYamlTemplateReq, logger *zap.SugaredLogger) (string, error)
- func ReloadServiceFromYamlTemplate(username string, req *LoadServiceFromYamlTemplateReq, ...) error
- func SplitYaml(yaml string) []string
- func SyncServiceFromTemplate(userName, source, templateId, templateName string, logger *zap.SugaredLogger) error
- func UpdateReleaseNamingRule(userName, requestID, projectName string, args *ReleaseNamingRule, ...) error
- func UpdateServiceHealthCheckStatus(args *commonservice.ServiceTmplObject) error
- func UpdateServiceVisibility(args *commonservice.ServiceTmplObject) error
- func UpdateWorkloads(ctx context.Context, requestID, username, productName, envName string, ...) error
- func ValidateServiceUpdate(codehostID int, ...) error
- func YamlValidator(args *YamlValidatorReq) []string
- func YamlViewServiceTemplate(args *YamlViewServiceTemplateReq) (string, error)
- type BulkHelmServiceCreationArgs
- type BulkHelmServiceCreationResponse
- func CreateOrUpdateBulkHelmService(projectName string, args *BulkHelmServiceCreationArgs, force bool, ...) (*BulkHelmServiceCreationResponse, error)
- func CreateOrUpdateBulkHelmServiceFromTemplate(projectName string, args *BulkHelmServiceCreationArgs, force bool, ...) (*BulkHelmServiceCreationResponse, error)
- func CreateOrUpdateHelmService(projectName string, args *HelmServiceCreationArgs, force bool, ...) (*BulkHelmServiceCreationResponse, error)
- func CreateOrUpdateHelmServiceFromChartRepo(projectName string, args *HelmServiceCreationArgs, force bool, ...) (*BulkHelmServiceCreationResponse, error)
- func CreateOrUpdateHelmServiceFromChartTemplate(projectName string, args *HelmServiceCreationArgs, force bool, ...) (*BulkHelmServiceCreationResponse, error)
- func CreateOrUpdateHelmServiceFromGitRepo(projectName string, args *HelmServiceCreationArgs, force bool, ...) (*BulkHelmServiceCreationResponse, error)
- func CreateOrUpdateHelmServiceFromRepo(projectName string, args *HelmServiceCreationArgs, force bool, ...) (*BulkHelmServiceCreationResponse, error)
- type Chart
- type ChartTemplateData
- type CreateFromChartRepo
- type CreateFromChartTemplate
- type CreateFromPublicRepo
- type CreateFromRepo
- type CronjobResource
- type FailedService
- type GetFileContentParam
- type GetKubeWorkloadsResp
- type GetKubeWorkloadsYamlResp
- type HarborChartDetail
- type HarborChartRepo
- type HarborChartVersion
- type HarborProject
- type HelmChartEditInfo
- type HelmLoadSource
- type HelmService
- type HelmServiceCreationArgs
- type HelmServiceModule
- type K8sWorkloadsArgs
- type KubeResource
- type KubeResourceKind
- type LoadKubeWorkloadsYamlReq
- type LoadServiceFromYamlTemplateReq
- type LoadServiceReq
- type LoadSource
- type ReleaseNamingRule
- type ServiceModule
- type ServiceOption
- func CreateServiceTemplate(userName string, args *commonmodels.Service, force bool, ...) (*ServiceOption, error)
- func GetServiceOption(args *commonmodels.Service, log *zap.SugaredLogger) (*ServiceOption, error)
- func GetServiceTemplateOption(serviceName, productName string, revision int64, log *zap.SugaredLogger) (*ServiceOption, error)
- type ServiceTmplBuildObject
- type ServiceWorkloads
- type ServiceWorkloadsUpdateAction
- type ServiceYaml
- type UpdateWorkloadsArgs
- type Variable
- type YamlPreview
- type YamlPreviewForPorts
- type YamlValidatorReq
- type YamlViewServiceTemplateReq
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateK8sWorkLoads ¶ added in v1.5.0
func CreateK8sWorkLoads(ctx context.Context, requestID, userName string, args *K8sWorkloadsArgs, log *zap.SugaredLogger) error
func CreatePMService ¶ added in v1.2.0
func CreatePMService(username string, args *ServiceTmplBuildObject, log *zap.SugaredLogger) error
func CreateWorkloadTemplate ¶ added in v1.5.0
func CreateWorkloadTemplate(userName string, args *commonmodels.Service, log *zap.SugaredLogger) error
CreateWorkloadTemplate only use for workload
func DeleteServiceTemplate ¶
func DeleteServiceTemplate(serviceName, serviceType, productName, isEnvTemplate, visibility string, log *zap.SugaredLogger) error
func EditFileContent ¶ added in v1.9.9
func EditFileContent(serviceName, productName, createdBy, requestID string, param *HelmChartEditInfo, logger *zap.SugaredLogger) error
func GetDeployableEnvs ¶ added in v1.9.9
The service can be deployed only in the following situations:
- All general environments are deployable.
- All base environments are deployable.
- If the service has been deployed in the baseline environment, all sub-environments of the baseline environment can deploy the service. Otherwise, all sub-environments of the baseline environment cannot deploy the service.
func GetFileContent ¶ added in v1.2.0
func GetFileContent(serviceName, productName string, param *GetFileContentParam, log *zap.SugaredLogger) (string, error)
func GetFilePath ¶ added in v1.2.0
func GetGerritServiceYaml ¶
func GetGerritServiceYaml(args *commonmodels.Service, log *zap.SugaredLogger) error
func GetHarborURL ¶ added in v1.2.0
func ListAvailablePublicServices ¶ added in v1.3.1
func ListAvailablePublicServices(productName string, log *zap.SugaredLogger) ([]*svcInfo, error)
ListAvailablePublicServices returns all public services which are not shared in the given project.
func ListServicePort ¶
func ListServicesInExtenalEnv ¶
func ListServicesInExtenalEnv(tmpResp *commonservice.ServiceTmplResp, log *zap.SugaredLogger)
func LoadKubeWorkloadsYaml ¶ added in v1.9.9
func LoadKubeWorkloadsYaml(username string, params *LoadKubeWorkloadsYamlReq, force bool, log *zap.SugaredLogger) error
func LoadServiceFromCodeHost ¶
func LoadServiceFromCodeHost(username string, codehostID int, repoOwner, namespace, repoName, repoUUID, branchName, remoteName string, args *LoadServiceReq, force bool, log *zap.SugaredLogger) error
LoadServiceFromCodeHost 根据提供的codehost信息加载服务
func LoadServiceFromYamlTemplate ¶ added in v1.6.0
func LoadServiceFromYamlTemplate(username string, req *LoadServiceFromYamlTemplateReq, force bool, logger *zap.SugaredLogger) error
func PreviewServiceFromYamlTemplate ¶ added in v1.9.9
func PreviewServiceFromYamlTemplate(req *LoadServiceFromYamlTemplateReq, logger *zap.SugaredLogger) (string, error)
func ReloadServiceFromYamlTemplate ¶ added in v1.6.0
func ReloadServiceFromYamlTemplate(username string, req *LoadServiceFromYamlTemplateReq, logger *zap.SugaredLogger) error
func SyncServiceFromTemplate ¶ added in v1.9.9
func SyncServiceFromTemplate(userName, source, templateId, templateName string, logger *zap.SugaredLogger) error
SyncServiceFromTemplate syncs services from (yaml|chart)template
func UpdateReleaseNamingRule ¶ added in v1.9.9
func UpdateReleaseNamingRule(userName, requestID, projectName string, args *ReleaseNamingRule, log *zap.SugaredLogger) error
func UpdateServiceHealthCheckStatus ¶ added in v1.8.0
func UpdateServiceHealthCheckStatus(args *commonservice.ServiceTmplObject) error
func UpdateServiceVisibility ¶ added in v1.8.0
func UpdateServiceVisibility(args *commonservice.ServiceTmplObject) error
func UpdateWorkloads ¶ added in v1.5.0
func UpdateWorkloads(ctx context.Context, requestID, username, productName, envName string, args UpdateWorkloadsArgs, log *zap.SugaredLogger) error
func ValidateServiceUpdate ¶
func ValidateServiceUpdate(codehostID int, serviceName, repoOwner, repoName, repoUUID, branchName, remoteName, path string, isDir bool, log *zap.SugaredLogger) error
ValidateServiceUpdate 根据服务名和提供的加载信息确认是否可以更新服务加载地址
func YamlValidator ¶
func YamlValidator(args *YamlValidatorReq) []string
func YamlViewServiceTemplate ¶ added in v1.12.0
func YamlViewServiceTemplate(args *YamlViewServiceTemplateReq) (string, error)
Types ¶
type BulkHelmServiceCreationArgs ¶ added in v1.6.0
type BulkHelmServiceCreationArgs struct { HelmLoadSource CreateFrom interface{} `json:"createFrom"` CreatedBy string `json:"createdBy"` RequestID string `json:"-"` ValuesData *service.ValuesDataArgs `json:"valuesData"` AutoSync bool `json:"auto_sync"` }
func (*BulkHelmServiceCreationArgs) UnmarshalJSON ¶ added in v1.6.0
func (a *BulkHelmServiceCreationArgs) UnmarshalJSON(data []byte) error
type BulkHelmServiceCreationResponse ¶ added in v1.6.0
type BulkHelmServiceCreationResponse struct { SuccessServices []string `json:"successServices"` FailedServices []*FailedService `json:"failedServices"` }
func CreateOrUpdateBulkHelmService ¶ added in v1.6.0
func CreateOrUpdateBulkHelmService(projectName string, args *BulkHelmServiceCreationArgs, force bool, logger *zap.SugaredLogger) (*BulkHelmServiceCreationResponse, error)
func CreateOrUpdateBulkHelmServiceFromTemplate ¶ added in v1.6.0
func CreateOrUpdateBulkHelmServiceFromTemplate(projectName string, args *BulkHelmServiceCreationArgs, force bool, logger *zap.SugaredLogger) (*BulkHelmServiceCreationResponse, error)
func CreateOrUpdateHelmService ¶ added in v1.4.0
func CreateOrUpdateHelmService(projectName string, args *HelmServiceCreationArgs, force bool, logger *zap.SugaredLogger) (*BulkHelmServiceCreationResponse, error)
func CreateOrUpdateHelmServiceFromChartRepo ¶ added in v1.9.9
func CreateOrUpdateHelmServiceFromChartRepo(projectName string, args *HelmServiceCreationArgs, force bool, log *zap.SugaredLogger) (*BulkHelmServiceCreationResponse, error)
func CreateOrUpdateHelmServiceFromChartTemplate ¶ added in v1.5.0
func CreateOrUpdateHelmServiceFromChartTemplate(projectName string, args *HelmServiceCreationArgs, force bool, logger *zap.SugaredLogger) (*BulkHelmServiceCreationResponse, error)
func CreateOrUpdateHelmServiceFromGitRepo ¶ added in v1.5.0
func CreateOrUpdateHelmServiceFromGitRepo(projectName string, args *HelmServiceCreationArgs, force bool, log *zap.SugaredLogger) (*BulkHelmServiceCreationResponse, error)
func CreateOrUpdateHelmServiceFromRepo ¶ added in v1.9.9
func CreateOrUpdateHelmServiceFromRepo(projectName string, args *HelmServiceCreationArgs, force bool, log *zap.SugaredLogger) (*BulkHelmServiceCreationResponse, error)
type ChartTemplateData ¶ added in v1.6.0
type CreateFromChartRepo ¶ added in v1.9.9
type CreateFromChartTemplate ¶ added in v1.5.0
type CreateFromPublicRepo ¶ added in v1.5.0
type CreateFromRepo ¶ added in v1.5.0
type CreateFromRepo struct { CodehostID int `json:"codehostID"` Owner string `json:"owner"` Namespace string `json:"namespace"` Repo string `json:"repo"` Branch string `json:"branch"` Paths []string `json:"paths"` }
func PublicRepoToPrivateRepoArgs ¶ added in v1.5.0
func PublicRepoToPrivateRepoArgs(args *CreateFromPublicRepo) (*CreateFromRepo, error)
type CronjobResource ¶
type CronjobResource struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata struct { Name string `yaml:"name"` } `yaml:"metadata"` Spec struct { Template struct { Spec struct { Template struct { Spec struct { Containers []map[string]interface{} `yaml:"containers"` } `yaml:"spec"` } `yaml:"template"` } `yaml:"spec"` } `yaml:"jobTemplate"` } `yaml:"spec"` }
type FailedService ¶ added in v1.6.0
type GetFileContentParam ¶ added in v1.8.0
type GetKubeWorkloadsResp ¶ added in v1.9.9
func GetKubeWorkloads ¶ added in v1.9.9
func GetKubeWorkloads(namespace, clusterID string, log *zap.SugaredLogger) (*GetKubeWorkloadsResp, error)
type GetKubeWorkloadsYamlResp ¶ added in v1.9.9
type GetKubeWorkloadsYamlResp struct {
Services []ServiceYaml `json:"services"`
}
type HarborChartDetail ¶ added in v1.2.0
type HarborChartDetail struct { Metadata struct { Name string `json:"name"` Version string `json:"version"` Description string `json:"description"` APIVersion string `json:"apiVersion"` AppVersion string `json:"appVersion"` Urls []string `json:"urls"` Created time.Time `json:"created"` Digest string `json:"digest"` } `json:"metadata"` Dependencies []string `json:"dependencies"` YamlValues map[string]interface{} `json:"yaml_values"` Files struct { ValuesYaml string `json:"values.yaml"` } `json:"files"` Security struct { Signature struct { Signed bool `json:"signed"` ProvFile string `json:"prov_file"` } `json:"signature"` } `json:"security"` Labels []string `json:"labels"` }
func FindHarborChartDetail ¶ added in v1.2.0
func FindHarborChartDetail(project, chartName, version string, log *zap.SugaredLogger) (*HarborChartDetail, error)
type HarborChartRepo ¶ added in v1.2.0
type HarborChartRepo struct { Updated string `json:"updated"` Name string `json:"name"` Created string `json:"created"` Deprecated bool `json:"deprecated"` TotalVersions int `json:"total_versions"` LatestVersion string `json:"latest_version"` Home string `json:"home"` Icon string `json:"icon"` }
func ListHarborChartRepos ¶ added in v1.2.0
func ListHarborChartRepos(project string, log *zap.SugaredLogger) ([]*HarborChartRepo, error)
type HarborChartVersion ¶ added in v1.2.0
type HarborChartVersion struct { Name string `json:"name"` Version string `json:"version"` Description string `json:"description"` APIVersion string `json:"apiVersion"` AppVersion string `json:"appVersion"` Urls []string `json:"urls"` Created time.Time `json:"created"` Digest string `json:"digest"` Labels []string `json:"labels"` }
func ListHarborChartVersions ¶ added in v1.2.0
func ListHarborChartVersions(project, chartName string, log *zap.SugaredLogger) ([]*HarborChartVersion, error)
type HarborProject ¶ added in v1.2.0
type HarborProject struct { UpdateTime string `json:"update_time"` OwnerName string `json:"owner_name"` Name string `json:"name"` Deleted bool `json:"deleted"` OwnerID int `json:"owner_id"` RepoCount int `json:"repo_count"` CreationTime string `json:"creation_time"` Togglable bool `json:"togglable"` ProjectID int `json:"project_id"` CurrentUserRoleID int `json:"current_user_role_id"` ChartCount int `json:"chart_count"` CveWhitelist struct { Items []struct { CveID string `json:"cve_id"` } `json:"items"` ProjectID int `json:"project_id"` ID int `json:"id"` ExpiresAt int `json:"expires_at"` } `json:"cve_whitelist"` Metadata struct { EnableContentTrust string `json:"enable_content_trust"` AutoScan string `json:"auto_scan"` Severity string `json:"severity"` ReuseSysCveWhitelist string `json:"reuse_sys_cve_whitelist"` Public string `json:"public"` PreventVul string `json:"prevent_vul"` } `json:"metadata"` }
func ListHarborProjects ¶ added in v1.2.0
func ListHarborProjects(page, pageSize int, log *zap.SugaredLogger) ([]*HarborProject, error)
type HelmChartEditInfo ¶ added in v1.9.9
type HelmLoadSource ¶ added in v1.5.0
type HelmLoadSource struct {
Source LoadSource `json:"source"`
}
type HelmService ¶ added in v1.2.0
type HelmService struct { ServiceInfos []*commonmodels.Service `json:"service_infos"` FileInfos []*types.FileInfo `json:"file_infos"` Services [][]string `json:"services"` }
func ListHelmServices ¶ added in v1.2.0
func ListHelmServices(productName string, log *zap.SugaredLogger) (*HelmService, error)
type HelmServiceCreationArgs ¶ added in v1.5.0
type HelmServiceCreationArgs struct { HelmLoadSource Name string `json:"name"` CreatedBy string `json:"createdBy"` RequestID string `json:"-"` AutoSync bool `json:"auto_sync"` CreateFrom interface{} `json:"createFrom"` ValuesData *service.ValuesDataArgs `json:"valuesData"` CreationDetail interface{} `json:"-"` }
func (*HelmServiceCreationArgs) UnmarshalJSON ¶ added in v1.5.0
func (a *HelmServiceCreationArgs) UnmarshalJSON(data []byte) error
type HelmServiceModule ¶ added in v1.2.0
type HelmServiceModule struct { ServiceModules []*ServiceModule `json:"service_modules"` Service *commonmodels.Service `json:"service,omitempty"` }
func GetHelmServiceModule ¶ added in v1.2.0
func GetHelmServiceModule(serviceName, productName string, revision int64, log *zap.SugaredLogger) (*HelmServiceModule, error)
type K8sWorkloadsArgs ¶ added in v1.9.9
type KubeResource ¶
type KubeResource struct { APIVersion string `yaml:"apiVersion"` Kind string `yaml:"kind"` Metadata struct { Name string `yaml:"name"` } `yaml:"metadata"` Spec struct { Template struct { Spec struct { Containers []map[string]interface{} `yaml:"containers"` } `yaml:"spec"` } `yaml:"template"` } `yaml:"spec"` }
type KubeResourceKind ¶
type LoadKubeWorkloadsYamlReq ¶ added in v1.9.9
type LoadServiceFromYamlTemplateReq ¶ added in v1.9.9
type LoadServiceReq ¶
type LoadSource ¶ added in v1.5.0
type LoadSource string
const ( LoadFromRepo LoadSource = "repo" //exclude gerrit LoadFromGerrit LoadSource = "gerrit" LoadFromPublicRepo LoadSource = "publicRepo" LoadFromChartTemplate LoadSource = "chartTemplate" LoadFromChartRepo LoadSource = "chartRepo" )
type ReleaseNamingRule ¶ added in v1.9.9
type ServiceModule ¶
type ServiceModule struct { *commonmodels.Container BuildNames []string `json:"build_names"` }
type ServiceOption ¶
type ServiceOption struct { ServiceModules []*ServiceModule `json:"service_module"` SystemVariable []*Variable `json:"system_variable"` CustomVariable []*templatemodels.RenderKV `json:"custom_variable"` TemplateVariable []*Variable `json:"template_variable"` VariableYaml string `json:"variable_yaml"` Yaml string `json:"yaml"` Service *commonmodels.Service `json:"service,omitempty"` }
func CreateServiceTemplate ¶
func CreateServiceTemplate(userName string, args *commonmodels.Service, force bool, log *zap.SugaredLogger) (*ServiceOption, error)
func GetServiceOption ¶
func GetServiceOption(args *commonmodels.Service, log *zap.SugaredLogger) (*ServiceOption, error)
func GetServiceTemplateOption ¶
func GetServiceTemplateOption(serviceName, productName string, revision int64, log *zap.SugaredLogger) (*ServiceOption, error)
type ServiceTmplBuildObject ¶ added in v1.2.0
type ServiceTmplBuildObject struct { ServiceTmplObject *commonservice.ServiceTmplObject `json:"pm_service_tmpl"` Build *commonmodels.Build `json:"build"` }
type ServiceWorkloads ¶ added in v1.9.9
type ServiceWorkloadsUpdateAction ¶ added in v1.5.0
type ServiceYaml ¶ added in v1.9.9
type UpdateWorkloadsArgs ¶ added in v1.5.0
type UpdateWorkloadsArgs struct { WorkLoads []commonmodels.Workload `json:"workLoads"` ClusterID string `json:"cluster_id"` Namespace string `json:"namespace"` }
type Variable ¶
type Variable struct { Key string `json:"key"` Value string `json:"value"` Description string `json:"description,omitempty"` }
func GetTemplateVariables ¶ added in v1.12.0
func GetTemplateVariables(args *commonmodels.Service) ([]*Variable, string)
type YamlPreview ¶
type YamlPreview struct {
Kind string `bson:"-" json:"kind"`
}
type YamlPreviewForPorts ¶
type YamlValidatorReq ¶
type YamlViewServiceTemplateReq ¶ added in v1.9.9
type YamlViewServiceTemplateReq struct { ServiceName string `json:"service_name"` ProjectName string `json:"project_name"` EnvName string `json:"env_name"` Variables []*templatemodels.RenderKV `json:"variables"` }
Click to show internal directories.
Click to hide internal directories.