service

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PERPAGE = 100
	PAGE    = 1
)
View Source
const (
	CleanStatusUnStart  = "unStart"
	CleanStatusSuccess  = "success"
	CleanStatusCleaning = "cleaning"
	CleanStatusFailed   = "failed"
)

Variables

This section is empty.

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

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

func CreateJenkinsIntegration

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

func CreatePrivateKey added in v1.2.0

func CreatePrivateKey(args *commonmodels.PrivateKey, 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 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 DeleteInstall

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

func DeleteJenkinsIntegration

func DeleteJenkinsIntegration(ID string, log *zap.SugaredLogger) 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 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 GetInstall

func GetInstall(name, version string, log *zap.SugaredLogger) (*commonmodels.Install, 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 GithubAppAdd

func GithubAppAdd(args *commonmodels.GithubApp) error

func GithubAppDelete

func GithubAppDelete(id string) error

func GithubAppList

func GithubAppList() ([]*commonmodels.GithubApp, 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 ListAvaiableInstalls

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

func ListBasicImages

func ListBasicImages(imageFrom string, imageType string, log *zap.SugaredLogger) ([]*commonmodels.BasicImage, 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 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 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 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 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 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 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 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 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 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 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 ExternalSystemDetail added in v1.8.0

type ExternalSystemDetail struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Server   string `json:"server"`
	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 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 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 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 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"`
}

func ListReposTags

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

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

Jump to

Keyboard shortcuts

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