service

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 66 Imported by: 0

Documentation

Overview

Copyright 2023 The KodeRover Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2023 The KodeRover Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	CardNameRunningWorkflow        = "运行中的工作流"
	CardNameServiceUpdateFrequency = "服务热力图"
)
View Source
const (
	CardTypeRunningWorkflow        = "running_workflow"
	CardTypeServiceUpdateFrequency = "service_update_frequency"
	CardTypeMyWorkflow             = "my_workflow"
	CardTypeMyEnv                  = "my_env"
)
View Source
const (
	PERPAGE = 100
	PAGE    = 1
)
View Source
const (
	CleanStatusUnStart  = "unStart"
	CleanStatusSuccess  = "success"
	CleanStatusCleaning = "cleaning"
	CleanStatusFailed   = "failed"
)

Variables

View Source
var ClusterProviderValueNames map[int8]string = map[int8]string{
	1: "阿里云 ACK",
	2: "腾讯云 TKE",
	3: "华为云 CCE",
	4: "Amazon EKS",
	5: "腾讯云 TKE Serverless",
	0: "其它",
}
View Source
var ImageTagsReqStatus = struct {
	M    sync.Mutex
	List map[string]struct{}
}{
	M:    sync.Mutex{},
	List: make(map[string]struct{}),
}

ImageTagsReqStatus its a global map to store the status of the image list request

Functions

func BatchCreatePrivateKey added in v1.6.0

func BatchCreatePrivateKey(args []*commonmodels.PrivateKey, option, username string, log *zap.SugaredLogger) error

override: Full coverage (temporarily reserved) increment: Incremental coverage patch: Overwrite existing

func CheckLLMIntegration added in v1.9.9

func CheckLLMIntegration(ctx context.Context) (bool, error)

func CheckReqLimit added in v1.9.9

func CheckReqLimit(key string) bool

func CleanCache added in v1.2.0

func CleanCache() error

func CleanImageCache

func CleanImageCache(logger *zap.SugaredLogger) error

func CreateAnnouncement added in v1.4.0

func CreateAnnouncement(creater string, ctx *systemmodel.Announcement, log *zap.SugaredLogger) error

func CreateBasicImage

func CreateBasicImage(args *commonmodels.BasicImage, log *zap.SugaredLogger) error

func CreateConfigurationManagement added in v1.9.9

func CreateConfigurationManagement(args *commonmodels.ConfigurationManagement, log *zap.SugaredLogger) error
func CreateExternalLink(args *commonmodels.ExternalLink, log *zap.SugaredLogger) error

func CreateExternalSystem added in v1.8.0

func CreateExternalSystem(args *ExternalSystemDetail, log *zap.SugaredLogger) error

func CreateHelmRepo added in v1.2.0

func CreateHelmRepo(args *commonmodels.HelmRepo, log *zap.SugaredLogger) error

func CreateIMApp added in v1.9.9

func CreateIMApp(args *commonmodels.IMApp, log *zap.SugaredLogger) error

func CreateInstall

func CreateInstall(args *commonmodels.Install, log *zap.SugaredLogger) error

func CreateJenkinsIntegration

func CreateJenkinsIntegration(args *commonmodels.JenkinsIntegration, log *zap.SugaredLogger) error

func CreateLLMIntegration added in v1.9.9

func CreateLLMIntegration(ctx context.Context, args *commonmodels.LLMIntegration) error

func CreateOrUpdateDashboardConfiguration added in v1.9.9

func CreateOrUpdateDashboardConfiguration(username, userID string, config *DashBoardConfig, log *zap.SugaredLogger) error

func CreatePrivateKey added in v1.2.0

func CreatePrivateKey(args *commonmodels.PrivateKey, log *zap.SugaredLogger) error

func CreateProjectManagement added in v1.9.9

func CreateProjectManagement(pm *models.ProjectManagement, log *zap.SugaredLogger) error

func CreateProxy

func CreateProxy(args *commonmodels.Proxy, log *zap.SugaredLogger) error

func CreateRegistryNamespace

func CreateRegistryNamespace(username string, args *commonmodels.RegistryNamespace, log *zap.SugaredLogger) error

func CreateS3Storage

func CreateS3Storage(updateBy string, storage *commonmodels.S3Storage, logger *zap.SugaredLogger) error

func CreateSonarIntegration added in v1.9.9

func CreateSonarIntegration(args *SonarIntegration, log *zap.SugaredLogger) error

func DeleteAnnouncement added in v1.4.0

func DeleteAnnouncement(user, id string, log *zap.SugaredLogger) error

func DeleteBasicImage

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

func DeleteConfigurationManagement added in v1.9.9

func DeleteConfigurationManagement(id string, log *zap.SugaredLogger) error
func DeleteExternalLink(id string, log *zap.SugaredLogger) error

func DeleteExternalSystem added in v1.8.0

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

func DeleteHelmRepo added in v1.2.0

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

func DeleteIMApp added in v1.9.9

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

func DeleteInstall

func DeleteInstall(name, version string, log *zap.SugaredLogger) error

func DeleteJenkinsIntegration

func DeleteJenkinsIntegration(ID string, log *zap.SugaredLogger) error

func DeleteLLMIntegration added in v1.9.9

func DeleteLLMIntegration(ctx context.Context, ID string) error

func DeleteNotifies added in v1.2.0

func DeleteNotifies(user string, notifyIDs []string, log *zap.SugaredLogger) error

func DeletePrivateKey added in v1.2.0

func DeletePrivateKey(id, userName string, log *zap.SugaredLogger) error

func DeleteProjectManagement added in v1.9.9

func DeleteProjectManagement(idHex string, log *zap.SugaredLogger) error

func DeleteProxy

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

func DeleteRegistryNamespace

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

func DeleteS3Storage

func DeleteS3Storage(deleteBy string, id string, logger *zap.SugaredLogger) error

func DeleteSonarIntegration added in v1.9.9

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

func FindOperation added in v1.4.0

func FindOperation(args *OperationLogArgs, log *zap.SugaredLogger) ([]*models.OperationLog, int, error)

func GetBasicImage

func GetBasicImage(id string, log *zap.SugaredLogger) (*commonmodels.BasicImage, error)

func GetCapacityStrategy added in v1.2.0

func GetCapacityStrategy(target commonmodels.CapacityTarget) (*commonmodels.CapacityStrategy, error)

func GetConfigurationManagement added in v1.9.9

func GetConfigurationManagement(id string, log *zap.SugaredLogger) (*commonmodels.ConfigurationManagement, error)

func GetInstall

func GetInstall(name, version string, log *zap.SugaredLogger) (*commonmodels.Install, error)

func GetJiraAllStatus added in v1.9.9

func GetJiraAllStatus(project string) ([]string, error)

func GetJiraTypes added in v1.9.9

func GetJiraTypes(project string) ([]*jira.IssueTypeWithStatus, error)

func GetLLMIntegration added in v1.9.9

func GetLLMIntegration(ctx context.Context, id string) (*commonmodels.LLMIntegration, error)

func GetOrCreateCleanCacheState

func GetOrCreateCleanCacheState() (*commonmodels.DindClean, error)

GetOrCreateCleanCacheState 获取清理镜像缓存状态,如果数据库中没有数据返回一个临时对象

func GetPrivateKey added in v1.2.0

func GetPrivateKey(id string, log *zap.SugaredLogger) (*commonmodels.PrivateKey, error)

func GetProxy

func GetProxy(id string, log *zap.SugaredLogger) (*commonmodels.Proxy, error)

func GetRepoTags

func GetRepoTags(registryInfo *commonmodels.RegistryNamespace, name string, log *zap.SugaredLogger) (*registry.ImagesResp, error)

func GetS3Storage

func GetS3Storage(id string, logger *zap.SugaredLogger) (*commonmodels.S3Storage, error)

func GetThemeInfos added in v1.9.9

func GetThemeInfos(log *zap.SugaredLogger) (*types.Theme, error)

func GithubAppAdd

func GithubAppAdd(args *commonmodels.GithubApp) error

func GithubAppDelete

func GithubAppDelete(id string) error

func GithubAppList

func GithubAppList() ([]*commonmodels.GithubApp, error)

func HandleJiraHookEvent added in v1.9.9

func HandleJiraHookEvent(workflowName, hookName string, event *jira.Event, logger *zap.SugaredLogger) error

func HandleMeegoHookEvent added in v1.9.9

func HandleMeegoHookEvent(workflowName, hookName string, event *meego.GeneralWebhookRequest, logger *zap.SugaredLogger) error

func HandleSystemGC added in v1.2.0

func HandleSystemGC(dryRun bool) error

func InitInstallMap

func InitInstallMap() map[string]*commonmodels.Install

func InitbasicImageInfos

func InitbasicImageInfos() []*commonmodels.BasicImage

func ListApolloApps added in v1.9.9

func ListApolloApps(id string, log *zap.SugaredLogger) ([]string, error)

func ListApolloEnvAndClusters added in v1.9.9

func ListApolloEnvAndClusters(id string, appID string, log *zap.SugaredLogger) ([]*apollo.EnvAndCluster, error)

func ListApolloNamespaces added in v1.9.9

func ListApolloNamespaces(id string, appID string, env string, cluster string, log *zap.SugaredLogger) ([]string, error)

func ListAvaiableInstalls

func ListAvaiableInstalls(log *zap.SugaredLogger) ([]*commonmodels.Install, error)

func ListBasicImages

func ListBasicImages(imageFrom string, imageType string, log *zap.SugaredLogger) ([]*commonmodels.BasicImage, error)

func ListConfigurationManagement added in v1.9.9

func ListConfigurationManagement(_type string, log *zap.SugaredLogger) ([]*commonmodels.ConfigurationManagement, error)
func ListExternalLinks(log *zap.SugaredLogger) ([]*commonmodels.ExternalLink, error)

func ListHelmRepos added in v1.2.0

func ListHelmRepos(log *zap.SugaredLogger) ([]*commonmodels.HelmRepo, error)

func ListIMApp added in v1.9.9

func ListIMApp(_type string, log *zap.SugaredLogger) ([]*commonmodels.IMApp, error)

func ListInstalls

func ListInstalls(log *zap.SugaredLogger) ([]*commonmodels.Install, error)

func ListJenkinsIntegration

func ListJenkinsIntegration(encryptedKey string, log *zap.SugaredLogger) ([]*commonmodels.JenkinsIntegration, error)

func ListJobNames

func ListJobNames(id string, log *zap.SugaredLogger) ([]string, error)

func ListLLMIntegration added in v1.9.9

func ListLLMIntegration(ctx context.Context) ([]*commonmodels.LLMIntegration, error)

func ListLabels added in v1.6.0

func ListLabels() ([]string, error)

func ListPrivateKeys added in v1.2.0

func ListPrivateKeys(encryptedKey, projectName, keyword string, systemOnly bool, log *zap.SugaredLogger) ([]*commonmodels.PrivateKey, error)

func ListPrivateKeysInternal added in v1.9.9

func ListPrivateKeysInternal(log *zap.SugaredLogger) ([]*commonmodels.PrivateKey, error)

func ListProjectManagement added in v1.9.9

func ListProjectManagement(log *zap.SugaredLogger) ([]*models.ProjectManagement, error)

func ListProxies

func ListProxies(log *zap.SugaredLogger) ([]*commonmodels.Proxy, error)

func ListRegistries

func ListRegistries(log *zap.SugaredLogger) ([]*commonmodels.RegistryNamespace, error)

ListRegistries 为了抹掉ak和sk的数据

func ListS3Storage

func ListS3Storage(encryptedKey string, logger *zap.SugaredLogger) ([]*commonmodels.S3Storage, error)

func ListSubscriptions added in v1.2.0

func ListSubscriptions(user string, log *zap.SugaredLogger) ([]*commonmodels.Subscription, error)

func ListTars added in v1.6.0

func ListTars(id, kind string, serviceNames []string, logger *zap.SugaredLogger) ([]*commonmodels.TarInfo, error)

func OpenAPICreateRegistry added in v1.9.9

func OpenAPICreateRegistry(username string, req *OpenAPICreateRegistryReq, logger *zap.SugaredLogger) error

func PullAllAnnouncement added in v1.4.0

func PullAllAnnouncement(user string, log *zap.SugaredLogger) ([]*systemmodel.Announcement, error)

func PullNotify added in v1.2.0

func PullNotify(user string, log *zap.SugaredLogger) ([]*commonmodels.Notify, error)

func PullNotifyAnnouncement added in v1.4.0

func PullNotifyAnnouncement(user string, log *zap.SugaredLogger) ([]*systemmodel.Announcement, error)

func ReadNotify added in v1.2.0

func ReadNotify(user string, notifyIDs []string, log *zap.SugaredLogger) error

func SearchJiraIssues added in v1.9.9

func SearchJiraIssues(project, _type, status, summary string, ne bool) ([]*jira.Issue, error)

func SearchJiraProjectIssuesWithJQL added in v1.9.9

func SearchJiraProjectIssuesWithJQL(project, jql, summary string) ([]*jira.Issue, error)

func SetCron added in v1.9.9

func SetCron(cron string, cronEnabled bool, logger *zap.SugaredLogger) error

SetCron set the docker clean cron

func SetProxyConfig

func SetProxyConfig()

func SyncDinDForRegistries added in v1.9.9

func SyncDinDForRegistries() error

func TestConnection

func TestConnection(args *commonmodels.Proxy, log *zap.SugaredLogger) error

func TestJenkinsConnection

func TestJenkinsConnection(args *JenkinsArgs, log *zap.SugaredLogger) error

func Unsubscribe added in v1.2.0

func Unsubscribe(user string, notifyType int, log *zap.SugaredLogger) error

func UpdateAnnouncement added in v1.4.0

func UpdateAnnouncement(user string, notifyID string, ctx *systemmodel.Announcement, log *zap.SugaredLogger) error

func UpdateBasicImage

func UpdateBasicImage(id string, args *commonmodels.BasicImage, log *zap.SugaredLogger) error

func UpdateConfigurationManagement added in v1.9.9

func UpdateConfigurationManagement(id string, args *commonmodels.ConfigurationManagement, log *zap.SugaredLogger) error

func UpdateDefaultLogin added in v1.9.9

func UpdateDefaultLogin(defaultLogin string, _ *zap.SugaredLogger) error
func UpdateExternalLink(id string, args *commonmodels.ExternalLink, log *zap.SugaredLogger) error

func UpdateExternalSystem added in v1.8.0

func UpdateExternalSystem(id string, system *ExternalSystemDetail, log *zap.SugaredLogger) error

func UpdateHelmRepo added in v1.2.0

func UpdateHelmRepo(id string, args *commonmodels.HelmRepo, log *zap.SugaredLogger) error

func UpdateIMApp added in v1.9.9

func UpdateIMApp(id string, args *commonmodels.IMApp, log *zap.SugaredLogger) error

func UpdateInstall

func UpdateInstall(name, version string, args *commonmodels.Install, log *zap.SugaredLogger) error

func UpdateJenkinsIntegration

func UpdateJenkinsIntegration(ID string, args *commonmodels.JenkinsIntegration, log *zap.SugaredLogger) error

func UpdateLLMIntegration added in v1.9.9

func UpdateLLMIntegration(ctx context.Context, ID string, args *commonmodels.LLMIntegration) error

func UpdateOperation added in v1.4.0

func UpdateOperation(id string, status int, log *zap.SugaredLogger) error

func UpdatePrivateKey added in v1.2.0

func UpdatePrivateKey(id string, args *commonmodels.PrivateKey, log *zap.SugaredLogger) error

func UpdateProjectManagement added in v1.9.9

func UpdateProjectManagement(idHex string, pm *models.ProjectManagement, log *zap.SugaredLogger) error

func UpdateProxy

func UpdateProxy(id string, args *commonmodels.Proxy, log *zap.SugaredLogger) error

func UpdateRegistryNamespace

func UpdateRegistryNamespace(username, id string, args *commonmodels.RegistryNamespace, log *zap.SugaredLogger) error

func UpdateRegistryNamespaceDefault

func UpdateRegistryNamespaceDefault(args *commonmodels.RegistryNamespace, log *zap.SugaredLogger) error

func UpdateS3Storage

func UpdateS3Storage(updateBy, id string, storage *commonmodels.S3Storage, logger *zap.SugaredLogger) error

func UpdateSonarIntegration added in v1.9.9

func UpdateSonarIntegration(id string, integration *SonarIntegration, log *zap.SugaredLogger) error

func UpdateSubscribe added in v1.2.0

func UpdateSubscribe(user string, notifyType int, subscription *commonmodels.Subscription, log *zap.SugaredLogger) error

func UpdateSysCapStrategy added in v1.2.0

func UpdateSysCapStrategy(strategy *commonmodels.CapacityStrategy) error

func UpdateThemeInfo added in v1.9.9

func UpdateThemeInfo(theme *models.Theme, log *zap.SugaredLogger) error

func UpdateWorkflowConcurrency added in v1.9.9

func UpdateWorkflowConcurrency(workflowConcurrency, buildConcurrency int64, log *zap.SugaredLogger) error

func UpsertSubscription added in v1.2.0

func UpsertSubscription(user string, subscription *commonmodels.Subscription, log *zap.SugaredLogger) error

func ValidateConfigurationManagement added in v1.9.9

func ValidateConfigurationManagement(rawData string, log *zap.SugaredLogger) error

func ValidateIMApp added in v1.9.9

func ValidateIMApp(im *commonmodels.IMApp, log *zap.SugaredLogger) error

func ValidateJira added in v1.9.9

func ValidateJira(info *models.ProjectManagement) error

func ValidateMeego added in v1.9.9

func ValidateMeego(info *models.ProjectManagement) error

func ValidateSonarIntegration added in v1.9.9

func ValidateSonarIntegration(arg *SonarIntegration, log *zap.SugaredLogger) error

Types

type AddAuditLogResp added in v1.4.0

type AddAuditLogResp struct {
	OperationLogID string `json:"id"`
}

func InsertOperation added in v1.4.0

func InsertOperation(args *models.OperationLog, log *zap.SugaredLogger) (*AddAuditLogResp, error)

type ChartVersion added in v1.9.9

type ChartVersion struct {
	ChartName string `json:"chartName"`
	Version   string `json:"version"`
}

type DashBoardCardConfig added in v1.9.9

type DashBoardCardConfig struct {
	ID     string      `json:"id"`
	Name   string      `json:"name"`
	Type   string      `json:"type"`
	Config interface{} `json:"config"`
}

type DashBoardConfig added in v1.9.9

type DashBoardConfig struct {
	Cards []*DashBoardCardConfig `json:"cards"`
}

func GetDashboardConfiguration added in v1.9.9

func GetDashboardConfiguration(username, userID string, log *zap.SugaredLogger) (*DashBoardConfig, error)

type EnvResponse added in v1.9.9

type EnvResponse struct {
	Name        string          `json:"name"`
	ProjectName string          `json:"project_name"`
	UpdateTime  int64           `json:"update_time"`
	UpdatedBy   string          `json:"updated_by"`
	ClusterID   string          `json:"cluster_id"`
	Services    []*EnvService   `json:"services,omitempty"`
	VMServices  []*VMEnvService `json:"vm_services,omitempty"`
}

func GetMyEnvironment added in v1.9.9

func GetMyEnvironment(projectName, envName, username, userID string, log *zap.SugaredLogger) (*EnvResponse, error)

type EnvService added in v1.9.9

type EnvService struct {
	ServiceName string `json:"service_name"`
	Status      string `json:"status"`
	Image       string `json:"image"`
}

type ExternalSystemDetail added in v1.8.0

type ExternalSystemDetail struct {
	ID      string           `json:"id"`
	Name    string           `json:"name"`
	Server  string           `json:"server"`
	Headers []*util.KeyValue `json:"headers,omitempty"`
	// @2023-04-14 APIToken is deprecated after 1.4.0-ee
	APIToken string `json:"api_token,omitempty"`
}

func GetExternalSystemDetail added in v1.8.0

func GetExternalSystemDetail(id string, log *zap.SugaredLogger) (*ExternalSystemDetail, error)

func ListExternalSystem added in v1.8.0

func ListExternalSystem(encryptedKey string, pageNum, pageSize int64, log *zap.SugaredLogger) ([]*ExternalSystemDetail, int64, error)

type GetDefaultLoginResponse added in v1.9.9

type GetDefaultLoginResponse struct {
	DefaultLogin string `json:"default_login"`
}

func GetDefaultLogin added in v1.9.9

func GetDefaultLogin(logger *zap.SugaredLogger) (*GetDefaultLoginResponse, error)

type GetWebhookConfigReponse added in v1.9.9

type GetWebhookConfigReponse struct {
	URL    string `json:"url"`
	Secret string `json:"secret"`
}

func GetWebhookConfig added in v1.9.9

func GetWebhookConfig(ctx context.Context, log *zap.SugaredLogger) (*GetWebhookConfigReponse, error)

type IndexFileResp added in v1.9.9

type IndexFileResp struct {
	Entries map[string][]*ChartVersion `json:"entries"`
}

func ListCharts added in v1.9.9

func ListCharts(name string, log *zap.SugaredLogger) (*IndexFileResp, error)

type JenkinsArgs

type JenkinsArgs struct {
	URL      string `json:"url"`
	Username string `json:"username"`
	Password string `json:"password"`
}

type JenkinsBuildArgs

type JenkinsBuildArgs struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
	Type  string      `json:"type"`
}

func ListJobBuildArgs

func ListJobBuildArgs(id, jobName string, log *zap.SugaredLogger) ([]*JenkinsBuildArgs, error)

type JiraProjectsResp added in v1.9.9

type JiraProjectsResp struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

func ListJiraProjects added in v1.9.9

func ListJiraProjects() ([]JiraProjectsResp, error)

type MeegoProject added in v1.9.9

type MeegoProject struct {
	Name string `json:"name"`
	Key  string `json:"key"`
}

type MeegoProjectResp added in v1.9.9

type MeegoProjectResp struct {
	Projects []*MeegoProject `json:"projects"`
}

func GetMeegoProjects added in v1.9.9

func GetMeegoProjects() (*MeegoProjectResp, error)

type MeegoTransitionResp added in v1.9.9

type MeegoTransitionResp struct {
	TargetStatus []*MeegoWorkItemStatusTransition `json:"target_status"`
}

func ListAvailableWorkItemTransitions added in v1.9.9

func ListAvailableWorkItemTransitions(projectID, typeKey string, workItemID int) (*MeegoTransitionResp, error)

type MeegoWorkItem added in v1.9.9

type MeegoWorkItem struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	CurrentState string `json:"current_state"`
}

type MeegoWorkItemResp added in v1.9.9

type MeegoWorkItemResp struct {
	WorkItems []*MeegoWorkItem `json:"work_items"`
}

func ListMeegoWorkItems added in v1.9.9

func ListMeegoWorkItems(projectID, typeKey, nameQuery string, pageNum, pageSize int) (*MeegoWorkItemResp, error)

type MeegoWorkItemStatusTransition added in v1.9.9

type MeegoWorkItemStatusTransition struct {
	SourceStateKey  string `json:"source_state_key"`
	SourceStateName string `json:"source_state_name"`
	TargetStateKey  string `json:"target_state_key"`
	TargetStateName string `json:"target_state_name"`
	TransitionID    int64  `json:"transition_id"`
}

type MeegoWorkItemType added in v1.9.9

type MeegoWorkItemType struct {
	TypeKey string `json:"type_key"`
	Name    string `json:"name"`
}

type MeegoWorkItemTypeResp added in v1.9.9

type MeegoWorkItemTypeResp struct {
	WorkItemTypes []*MeegoWorkItemType `json:"work_item_types"`
}

func GetWorkItemTypeList added in v1.9.9

func GetWorkItemTypeList(projectID string) (*MeegoWorkItemTypeResp, error)

type MessageCtx added in v1.2.0

type MessageCtx struct {
	ReqID   string `bson:"req_id"                json:"req_id"`
	Title   string `bson:"title"                 json:"title"`   // 消息标题
	Content string `bson:"content"               json:"content"` // 消息内容
}

type MyEnvCardConfig added in v1.9.9

type MyEnvCardConfig struct {
	EnvType        string   `json:"env_type"`
	EnvName        string   `json:"env_name"`
	ProjectName    string   `json:"project_name"`
	ServiceModules []string `json:"service_modules"`
}

type MyWorkflowCardConfig added in v1.9.9

type MyWorkflowCardConfig struct {
	WorkflowList []*WorkflowConfig `json:"workflow_list"`
}

type OpenAPICluster added in v1.9.9

type OpenAPICluster struct {
	ID           string `json:"cluster_id"`
	Name         string `json:"name"`
	Production   bool   `json:"production"`
	Description  string `json:"description"`
	ProviderName string `json:"provider_name"`
	CreatedBy    string `json:"created_by"`
	CreatedTime  int64  `json:"created_time"`
	Local        bool   `json:"local"`
	Status       string `json:"status"`
	Type         string `json:"type"`
}

func OpenAPIListCluster added in v1.9.9

func OpenAPIListCluster(projectName string, logger *zap.SugaredLogger) ([]*OpenAPICluster, error)

type OpenAPICreateRegistryReq added in v1.9.9

type OpenAPICreateRegistryReq struct {
	Address   string                  `json:"address"`
	Provider  config.RegistryProvider `json:"provider"`
	Namespace string                  `json:"namespace"`
	IsDefault bool                    `json:"is_default"`
	AccessKey string                  `json:"access_key"`
	SecretKey string                  `json:"secret_key"`
	EnableTLS bool                    `json:"enable_tls"`
	// Optional field below
	Region  string `json:"region"`
	TLSCert string `json:"tls_cert"`
}

func (OpenAPICreateRegistryReq) Validate added in v1.9.9

func (req OpenAPICreateRegistryReq) Validate() error

type OpenAPIRegistry added in v1.9.9

type OpenAPIRegistry struct {
	ID        string                  `json:"registry_id"`
	Address   string                  `json:"address"`
	Provider  config.RegistryProvider `json:"provider"`
	Region    string                  `json:"region"`
	Namespace string                  `json:"namespace"`
	IsDefault bool                    `json:"is_default"`
}

type OperationLogArgs added in v1.4.0

type OperationLogArgs struct {
	Username     string `json:"username"`
	ProductName  string `json:"product_name"`
	ExactProduct string `json:"exact_product"`
	Function     string `json:"function"`
	Status       int    `json:"status"`
	PerPage      int    `json:"per_page"`
	Page         int    `json:"page"`
	Scene        string `json:"scene"`
	TargetID     string `json:"target_id"`
	Detail       string `json:"detail"`
}

type RepoImgResp

type RepoImgResp struct {
	Host    string `json:"host"`
	Owner   string `json:"owner"`
	Name    string `json:"name"`
	Tag     string `json:"tag"`
	Created string `json:"created"`
	Digest  string `json:"digest"`
}

func ImageListGetter added in v1.9.9

func ImageListGetter(repo *registry.Repo, registryInfo *commonmodels.RegistryNamespace, dbTags map[string]*models.ImageTag, regService registry.Service, logger *zap.SugaredLogger) []*RepoImgResp

func ListReposTags

func ListReposTags(registryInfo *commonmodels.RegistryNamespace, names []string, logger *zap.SugaredLogger) ([]*RepoImgResp, error)

ListReposTags TODO: need to be optimized

type RepoInfo

type RepoInfo struct {
	RegType      string `json:"regType"`
	RegProvider  string `json:"regProvider"`
	RegNamespace string `json:"regNamespace"`
	RegAddr      string `json:"regAddr"`
	ID           string `json:"id"`
}

func ListAllRepos

func ListAllRepos(log *zap.SugaredLogger) ([]*RepoInfo, error)

type SonarIntegration added in v1.9.9

type SonarIntegration struct {
	ID            string `json:"id"`
	ServerAddress string `json:"server_address"`
	Token         string `json:"token"`
}

func GetSonarIntegration added in v1.9.9

func GetSonarIntegration(id string, log *zap.SugaredLogger) (*SonarIntegration, error)

func ListSonarIntegration added in v1.9.9

func ListSonarIntegration(log *zap.SugaredLogger) ([]*SonarIntegration, int64, error)

type UpdateDefaultLoginParams added in v1.9.9

type UpdateDefaultLoginParams struct {
	DefaultLogin string `json:"default_login"`
}

type VMEnvService added in v1.9.9

type VMEnvService struct {
	ServiceName string                    `json:"service_name"`
	EnvStatus   []*commonmodels.EnvStatus `json:"env_status"`
}

type WorkflowConcurrencySettings added in v1.9.9

type WorkflowConcurrencySettings struct {
	WorkflowConcurrency int64 `json:"workflow_concurrency"`
	BuildConcurrency    int64 `json:"build_concurrency"`
}

func GetWorkflowConcurrency added in v1.9.9

func GetWorkflowConcurrency() (*WorkflowConcurrencySettings, error)

type WorkflowConfig added in v1.9.9

type WorkflowConfig struct {
	Name    string `json:"name"`
	Project string `json:"project_name"`
}

type WorkflowResponse added in v1.9.9

type WorkflowResponse struct {
	TaskID      int64  `json:"task_id,omitempty"`
	Name        string `json:"name"`
	Project     string `json:"project"`
	Creator     string `json:"creator"`
	StartTime   int64  `json:"start_time"`
	Status      string `json:"status"`
	DisplayName string `json:"display_name"`
	Type        string `json:"workflow_type"`
	TestName    string `json:"test_name,omitempty"`
	ScanName    string `json:"scan_name,omitempty"`
	ScanID      string `json:"scan_id,omitempty"`
}

func GetMyWorkflow added in v1.9.9

func GetMyWorkflow(header http.Header, username, userID, cardID string, log *zap.SugaredLogger) ([]*WorkflowResponse, error)

func GetRunningWorkflow added in v1.9.9

func GetRunningWorkflow(log *zap.SugaredLogger) ([]*WorkflowResponse, error)

Jump to

Keyboard shortcuts

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