service

package
v2.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 53 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddProject2CurrentGroup

func AddProject2CurrentGroup(groupName, projectKey, projectDisplayName, deployType, user string) error

func CreateProductTemplate

func CreateProductTemplate(args *template.Product, log *zap.SugaredLogger) (err error)

CreateProductTemplate 创建产品模板

func CreateProjectCodeHost

func CreateProjectCodeHost(projectName string, codehost *models.CodeHost, _ *zap.SugaredLogger) (*models.CodeHost, error)

func CreateProjectGroup

func CreateProjectGroup(args *ProjectGroupArgs, user string, logger *zap.SugaredLogger) error

func CreateProjectOpenAPI

func CreateProjectOpenAPI(userID, username string, args *OpenAPICreateProductReq, logger *zap.SugaredLogger) error

func CreateVariableSet

func CreateVariableSet(args *CreateVariableSetRequest) error

func DeleteCollabrationMode

func DeleteCollabrationMode(productName string, userName string, log *zap.SugaredLogger) error

func DeleteLabels

func DeleteLabels(productName string, log *zap.SugaredLogger) error

func DeleteProductTemplate

func DeleteProductTemplate(userName, productName, requestID string, isDelete bool, log *zap.SugaredLogger) (err error)

DeleteProductTemplate 删除产品模板

func DeleteProductsAsync

func DeleteProductsAsync(userName, productName, requestID string, isDelete bool, log *zap.SugaredLogger) error

func DeleteProjectCodeHost

func DeleteProjectCodeHost(projectName string, id int, _ *zap.SugaredLogger) error

func DeleteProjectGroup

func DeleteProjectGroup(name string, logger *zap.SugaredLogger) error

func DeleteProjectOpenAPI

func DeleteProjectOpenAPI(userName, requestID, projectName string, isDelete bool, logger *zap.SugaredLogger) error

func DeleteScanningModules

func DeleteScanningModules(productName string, log *zap.SugaredLogger) error

func DeleteTestModules

func DeleteTestModules(productName, requestID string, log *zap.SugaredLogger) error

func DeleteVariableSet

func DeleteVariableSet(id, projectName string, log *zap.SugaredLogger) error

func GetAvailableCodehostList

func GetAvailableCodehostList(projectName, encryptedKey string, log *zap.SugaredLogger) ([]*models.CodeHost, error)

func GetBizDirProjectServices

func GetBizDirProjectServices(projectName string) ([]string, error)

func GetGlobalVariables

func GetGlobalVariables(productName string, production bool, log *zap.SugaredLogger) ([]*commontypes.ServiceVariableKV, error)

func GetProductTemplateServices

func GetProductTemplateServices(productName string, envType types.EnvType, isBaseEnv bool, baseEnvName string, log *zap.SugaredLogger) (*template.Product, error)

func GetProjectCodeHost

func GetProjectCodeHost(id int, projectName string, ignoreDelete bool, _ *zap.SugaredLogger) (*models.CodeHost, error)

func GetProjectCodehostList

func GetProjectCodehostList(projectName, encryptedKey, address, owner, source string, log *zap.SugaredLogger) ([]*models.CodeHost, error)

func GetUnGroupedProjectKeys

func GetUnGroupedProjectKeys() ([]string, error)

func GetVariableSet

func GetVariableSet(idStr string, log *zap.SugaredLogger) (*commonmodels.VariableSet, error)

func InitializeYAMLProject

func InitializeYAMLProject(userID, username, requestID string, args *OpenAPIInitializeProjectReq, logger *zap.SugaredLogger) error

func ListProjectGroupNames

func ListProjectGroupNames() ([]string, error)

func ListProjects

func ListProjects(opts *ProjectListOptions, logger *zap.SugaredLogger) (interface{}, error)

func OpenAPIGetGlobalVariables

func OpenAPIGetGlobalVariables(projectName string, logger *zap.SugaredLogger) (*commontypes.GlobalVariables, error)

func OpenAPIInitializeHelmProject

func OpenAPIInitializeHelmProject(userID, username, requestID string, args *OpenAPIInitializeProjectReq, logger *zap.SugaredLogger) error

func TransferHostProject

func TransferHostProject(user, projectName string, log *zap.SugaredLogger) (err error)

func UpdateCodeHostByToken

func UpdateCodeHostByToken(host *models.CodeHost, _ *zap.SugaredLogger) (*models.CodeHost, error)

func UpdateCustomMatchRules

func UpdateCustomMatchRules(productName, userName, requestID string, matchRules []*ImageParseData) error

func UpdateGlobalVariables

func UpdateGlobalVariables(productName, userName string, globalVariables []*commontypes.ServiceVariableKV, production bool) error

func UpdateProductTemplate

func UpdateProductTemplate(name string, args *template.Product, log *zap.SugaredLogger) (err error)

UpdateProductTemplate 更新产品模板

func UpdateProductTmplStatus

func UpdateProductTmplStatus(productName, onboardingStatus string, log *zap.SugaredLogger) (err error)

UpdateProductTmplStatus 更新项目onboarding状态

func UpdateProductionServiceOrchestration

func UpdateProductionServiceOrchestration(name string, services [][]string, updateBy string, log *zap.SugaredLogger) (err error)

func UpdateProject

func UpdateProject(name string, args *template.Product, log *zap.SugaredLogger) (err error)

UpdateProject 更新项目

func UpdateProjectGroup

func UpdateProjectGroup(args *ProjectGroupArgs, user string, logger *zap.SugaredLogger) error

func UpdateProjectSystemCodeHost

func UpdateProjectSystemCodeHost(projectName string, host *models.CodeHost, _ *zap.SugaredLogger) (*models.CodeHost, error)

func UpdateServiceOrchestration

func UpdateServiceOrchestration(name string, services [][]string, updateBy string, log *zap.SugaredLogger) (err error)

func UpdateVariableSet

func UpdateVariableSet(args *CreateVariableSetRequest, requestID string, log *zap.SugaredLogger) error

Types

type ContainerInfo

type ContainerInfo struct {
	Value string `bson:"value"              json:"value"`
	Label string `bson:"label"              json:"label"`
}

ContainerInfo ...

type CreateVariableSetRequest

type CreateVariableSetRequest struct {
	ID           string `json:"id"`
	Name         string `json:"name"`
	Description  string `json:"description"`
	ProjectName  string `json:"project_name"`
	VariableYaml string `json:"variable_yaml"`
	UserName     string
}

type CustomParseDataArgs

type CustomParseDataArgs struct {
	Rules []*ImageParseData `json:"rules"`
}

type EnvDefinition

type EnvDefinition struct {
	EnvName     string `json:"env_key"`
	ClusterName string `json:"cluster_name"`
	Namespace   string `json:"namespace"`
}

type EnvInfo

type EnvInfo struct {
	Name       string `json:"name"`
	Production bool   `json:"production"`
	Status     string `json:"status"`
}

type GetBizDirServiceDetailResponse

type GetBizDirServiceDetailResponse struct {
	ProjectName  string   `json:"project_name"`
	EnvName      string   `json:"env_name"`
	Production   bool     `json:"production"`
	Name         string   `json:"name"`
	Type         string   `json:"type"`
	Status       string   `json:"status"`
	Images       []string `json:"images"`
	ChartVersion string   `json:"chart_version"`
	UpdateTime   int64    `json:"update_time"`
	Error        string   `json:"error"`
}

func GetBizDirServiceDetail

func GetBizDirServiceDetail(projectName, serviceName string) ([]GetBizDirServiceDetailResponse, error)

type GetGlobalVariableCandidatesRespone

type GetGlobalVariableCandidatesRespone struct {
	KeyName        string   `json:"key_name"`
	RelatedService []string `json:"related_service"`
}

func GetGlobalVariableCandidates

func GetGlobalVariableCandidates(productName string, production bool, log *zap.SugaredLogger) ([]*GetGlobalVariableCandidatesRespone, error)

type GroupDetail

type GroupDetail struct {
	GroupName string                        `json:"group_name"`
	Projects  []*commonmodels.ProjectDetail `json:"projects"`
}

func GetBizDirProject

func GetBizDirProject() ([]GroupDetail, error)

func SearchBizDirByProject

func SearchBizDirByProject(projectKeyword string) ([]GroupDetail, error)

type ImageParseData

type ImageParseData struct {
	Repo      string `json:"repo,omitempty"`
	Namespace string `json:"namespace,omitempty"`
	Image     string `json:"image,omitempty"`
	Tag       string `json:"tag,omitempty"`
	InUse     bool   `json:"inUse,omitempty"`
	PresetId  int    `json:"presetId,omitempty"`
}

func GetCustomMatchRules

func GetCustomMatchRules(productName string, log *zap.SugaredLogger) ([]*ImageParseData, error)

type OpenAPICreateProductReq

type OpenAPICreateProductReq struct {
	ProjectName string             `json:"project_name"`
	ProjectKey  string             `json:"project_key"`
	IsPublic    bool               `json:"is_public"`
	Description string             `json:"description"`
	ProjectType config.ProjectType `json:"project_type"`
}

func (OpenAPICreateProductReq) Validate

func (req OpenAPICreateProductReq) Validate() error

type OpenAPIInitializeProjectReq

type OpenAPIInitializeProjectReq struct {
	ProjectName string               `json:"project_name"`
	ProjectKey  string               `json:"project_key"`
	IsPublic    bool                 `json:"is_public"`
	Description string               `json:"description"`
	ServiceList []*ServiceDefinition `json:"service_list"`
	EnvList     []*EnvDefinition     `json:"env_list"`
}

func (OpenAPIInitializeProjectReq) Validate

func (req OpenAPIInitializeProjectReq) Validate() error

type OpenAPIListProjectReq

type OpenAPIListProjectReq struct {
	PageSize int64 `json:"pageSize" form:"pageSize,default=20"`
	PageNum  int64 `json:"pageNum"  form:"pageNum,default=1"`
}

type OpenAPIProjectDetailResp

type OpenAPIProjectDetailResp struct {
	ProjectName string `json:"project_name"`
	ProjectKey  string `json:"project_key"`
	IsPublic    bool   `json:"is_public"`
	Desc        string `json:"desc"`
	DeployType  string `json:"deploy_type"`
	CreateTime  int64  `json:"create_time"`
	CreatedBy   string `json:"created_by"`
}

func GetProjectDetailOpenAPI

func GetProjectDetailOpenAPI(projectName string, logger *zap.SugaredLogger) (*OpenAPIProjectDetailResp, error)

type OpenAPIProjectListResp

type OpenAPIProjectListResp struct {
	Total    int             `json:"total"`
	Projects []*ProjectBrief `json:"projects"`
}

func ListProjectOpenAPI

func ListProjectOpenAPI(authorizedProjectList []string, pageSize, pageNum int64, logger *zap.SugaredLogger) (*OpenAPIProjectListResp, error)

type ProductInfo

type ProductInfo struct {
	Value       string         `bson:"value"              json:"value"`
	Label       string         `bson:"label"              json:"label"`
	ServiceInfo []*ServiceInfo `bson:"services"           json:"services"`
}

func ListTemplatesHierachy

func ListTemplatesHierachy(userName string, log *zap.SugaredLogger) ([]*ProductInfo, error)

type ProjectBrief

type ProjectBrief struct {
	ProjectName string `json:"project_name"`
	ProjectKey  string `json:"project_key"`
	Description string `json:"description"`
	DeployType  string `json:"deploy_type"`
}

type ProjectBriefRepresentation

type ProjectBriefRepresentation struct {
	*ProjectMinimalRepresentation
	Envs []string `json:"envs"`
}

type ProjectBriefResponse

type ProjectBriefResponse struct {
	ProjectBriefRepresentation []*ProjectBriefRepresentation `json:"projects"`
	Total                      int                           `json:"total"`
}

type ProjectDetailedRepresentation

type ProjectDetailedRepresentation struct {
	*ProjectBriefRepresentation
	Alias      string `json:"alias"`
	Desc       string `json:"desc"`
	UpdatedAt  int64  `json:"updatedAt"`
	UpdatedBy  string `json:"updatedBy"`
	Onboard    bool   `json:"onboard"`
	Public     bool   `json:"public"`
	DeployType string `json:"deployType"`
}

type ProjectDetailedResponse

type ProjectDetailedResponse struct {
	ProjectDetailedRepresentation []*ProjectDetailedRepresentation `json:"projects"`
	Total                         int                              `json:"total"`
}

type ProjectGroupArgs

type ProjectGroupArgs struct {
	GroupID     string   `json:"group_id"`
	GroupName   string   `json:"group_name"`
	ProjectKeys []string `json:"project_keys"`
}

func (*ProjectGroupArgs) Validate

func (args *ProjectGroupArgs) Validate() error

type ProjectGroupPreset

type ProjectGroupPreset struct {
	GroupID   string                  `json:"group_id"`
	GroupName string                  `json:"group_name"`
	Projects  []*ProjectGroupRelation `json:"projects"`
}

func GetProjectGroupRelation

func GetProjectGroupRelation(name string, logger *zap.SugaredLogger) (resp *ProjectGroupPreset, err error)

type ProjectGroupRelation

type ProjectGroupRelation struct {
	ProjectName string `json:"project_name"`
	ProjectKey  string `json:"project_key"`
	DeployType  string `json:"deploy_type"`
	Enabled     bool   `json:"enabled"`
}

type ProjectListOptions

type ProjectListOptions struct {
	IgnoreNoEnvs     bool
	IgnoreNoVersions bool
	Verbosity        QueryVerbosity
	Names            []string
	PageSize         int64
	PageNum          int64
	Filter           string
	GroupName        string
	Ungrouped        bool
}

type ProjectMinimalRepresentation

type ProjectMinimalRepresentation struct {
	Name string `json:"name"`
}

type QueryVerbosity

type QueryVerbosity string
const (
	VerbosityDetailed QueryVerbosity = "detailed" // all information
	VerbosityBrief    QueryVerbosity = "brief"    // short information or a summary
	VerbosityMinimal  QueryVerbosity = "minimal"  // very little information, usually only a resource identifier
)

type SearchBizDirByServiceGroup

type SearchBizDirByServiceGroup struct {
	GroupName string                          `json:"group_name"`
	Projects  []*SearchBizDirByServiceProject `json:"projects"`
}

func SearchBizDirByService

func SearchBizDirByService(serviceName string) ([]*SearchBizDirByServiceGroup, error)

type SearchBizDirByServiceProject

type SearchBizDirByServiceProject struct {
	Project  *commonmodels.ProjectDetail `json:"project"`
	Services []string                    `json:"services"`
}

type Service

type Service struct {
	Name       string `json:"name"`
	CreatedBy  string `json:"created_by"`
	CreateTime int64  `json:"create_time"`
	Source     string `json:"source"`
	Production bool   `json:"production"`
}

type ServiceDefinition

type ServiceDefinition struct {
	Source       string       `json:"source"`
	ServiceName  string       `json:"service_name"`
	TemplateName string       `json:"template_name"`
	VariableYaml util.KVInput `json:"variable_yaml"`
	AutoSync     bool         `json:"auto_sync"`
	Yaml         string       `json:"yaml"`
	ValuesYaml   string       `json:"values_yaml"`
}

type ServiceInfo

type ServiceInfo struct {
	Value         string           `bson:"value"              json:"value"`
	Label         string           `bson:"label"              json:"label"`
	ContainerInfo []*ContainerInfo `bson:"containers"         json:"containers"`
}

type VariableSetFindOption

type VariableSetFindOption struct {
	ID          string `json:"id" form:"id"`
	PerPage     int    `json:"perPage" form:"perPage"`
	Page        int    `json:"page" form:"page"`
	ProjectName string `json:"projectName" form:"projectName"`
}

type VariableSetListResp

type VariableSetListResp struct {
	VariableSetList []*commonmodels.VariableSet `json:"variable_set_list"`
	Total           int64                       `json:"total"`
}

func ListVariableSets

func ListVariableSets(option *VariableSetFindOption, log *zap.SugaredLogger) (*VariableSetListResp, error)

Jump to

Keyboard shortcuts

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