mongodb

package
v2.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrNoDocuments

func IsErrNoDocuments(err error) bool

Types

type BasicImageColl

type BasicImageColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewBasicImageColl

func NewBasicImageColl() *BasicImageColl

func (*BasicImageColl) Create

func (c *BasicImageColl) Create(args *models.BasicImage) error

func (*BasicImageColl) Delete

func (c *BasicImageColl) Delete(id string) error

func (*BasicImageColl) EnsureIndex

func (c *BasicImageColl) EnsureIndex(ctx context.Context) error

func (*BasicImageColl) Find

func (c *BasicImageColl) Find(id string) (*models.BasicImage, error)

func (*BasicImageColl) FindByImageName

func (c *BasicImageColl) FindByImageName(name string) (*models.BasicImage, error)

func (*BasicImageColl) GetCollectionName

func (c *BasicImageColl) GetCollectionName() string

func (*BasicImageColl) InitBasicImageData

func (c *BasicImageColl) InitBasicImageData(basicImageInfos []*models.BasicImage)

func (*BasicImageColl) List

func (c *BasicImageColl) List(opt *BasicImageOpt) ([]*models.BasicImage, error)

func (*BasicImageColl) Update

func (c *BasicImageColl) Update(id string, args *models.BasicImage) error

type BasicImageOpt

type BasicImageOpt struct {
	Value     string `bson:"value"`
	Label     string `bson:"label"`
	ImageFrom string `bson:"image_from"`
	ImageType string `bson:"image_type"`
}

type BuildColl

type BuildColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewBuildColl

func NewBuildColl() *BuildColl

func (*BuildColl) Create

func (c *BuildColl) Create(build *models.Build) error

func (*BuildColl) Delete

func (c *BuildColl) Delete(name, productName string) error

func (*BuildColl) DistinctTargets

func (c *BuildColl) DistinctTargets(excludeModule []string, productName string) (map[string]bool, error)

DistinctTargets finds modules distinct service templates

func (*BuildColl) EnsureIndex

func (c *BuildColl) EnsureIndex(ctx context.Context) error

func (*BuildColl) Find

func (c *BuildColl) Find(opt *BuildFindOption) (*models.Build, error)

func (*BuildColl) GetBuildTemplateReference

func (c *BuildColl) GetBuildTemplateReference(templateID string) ([]*models.Build, error)

func (*BuildColl) GetCollectionName

func (c *BuildColl) GetCollectionName() string

func (*BuildColl) GetDockerfileTemplateReference

func (c *BuildColl) GetDockerfileTemplateReference(templateID string) ([]*models.Build, error)

func (*BuildColl) List

func (c *BuildColl) List(opt *BuildListOption) ([]*models.Build, error)

func (*BuildColl) ListByCursor

func (c *BuildColl) ListByCursor(opt *BuildListOption) (*mongo.Cursor, error)

func (*BuildColl) ListByOptions

func (c *BuildColl) ListByOptions(opt *BuildListOption) ([]*models.Build, int64, error)

func (*BuildColl) Update

func (c *BuildColl) Update(build *models.Build) error

func (*BuildColl) UpdateBuildParam

func (c *BuildColl) UpdateBuildParam(name, productName string, params []*models.Parameter) error

func (*BuildColl) UpdateTargets

func (c *BuildColl) UpdateTargets(name, productName string, targets []*models.ServiceModuleTarget) error

type BuildFindOption

type BuildFindOption struct {
	Name        string
	Targets     []string
	ServiceName string
	ProductName string
}

FindOption ...

type BuildListOption

type BuildListOption struct {
	Name         string
	Targets      []string
	ProductName  string
	ServiceName  string
	IsSort       bool
	BuildOS      string
	BasicImageID string
	PrivateKeyID string
	TemplateID   string
	PageNum      int64
	PageSize     int64
}

type BuildStage

type BuildStage struct {
	SubTasks map[string]task.Build `bson:"sub_tasks"                    json:"-"`
}

type BuildTemplateColl

type BuildTemplateColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewBuildTemplateColl

func NewBuildTemplateColl() *BuildTemplateColl

func (*BuildTemplateColl) Create

func (c *BuildTemplateColl) Create(obj *models.BuildTemplate) error

func (*BuildTemplateColl) DeleteByID

func (c *BuildTemplateColl) DeleteByID(idStr string) error

func (*BuildTemplateColl) DeleteByName

func (c *BuildTemplateColl) DeleteByName(name string) error

func (*BuildTemplateColl) EnsureIndex

func (c *BuildTemplateColl) EnsureIndex(ctx context.Context) error

func (*BuildTemplateColl) Find

func (*BuildTemplateColl) GetCollectionName

func (c *BuildTemplateColl) GetCollectionName() string

func (*BuildTemplateColl) List

func (c *BuildTemplateColl) List(pageNum, pageSize int) ([]*models.BuildTemplate, int, error)

func (*BuildTemplateColl) ListByCursor

func (c *BuildTemplateColl) ListByCursor(opts *ListBuildTemplateOption) (*mongo.Cursor, error)

func (*BuildTemplateColl) Update

func (c *BuildTemplateColl) Update(idStr string, obj *models.BuildTemplate) error

type BuildTemplateQueryOption

type BuildTemplateQueryOption struct {
	ID   string
	Name string
}

type CallbackFindOption

type CallbackFindOption struct {
	TaskID       int64
	PipelineName string
	ProjectName  string
}

type CallbackRequestColl

type CallbackRequestColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewCallbackRequestColl

func NewCallbackRequestColl() *CallbackRequestColl

func (*CallbackRequestColl) Create

func (*CallbackRequestColl) EnsureIndex

func (c *CallbackRequestColl) EnsureIndex(ctx context.Context) error

func (*CallbackRequestColl) Find

func (*CallbackRequestColl) GetCollectionName

func (c *CallbackRequestColl) GetCollectionName() string

type ChartColl

type ChartColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewChartColl

func NewChartColl() *ChartColl

func (*ChartColl) Create

func (c *ChartColl) Create(obj *models.Chart) error

func (*ChartColl) Delete

func (c *ChartColl) Delete(name string) error

func (*ChartColl) EnsureIndex

func (c *ChartColl) EnsureIndex(ctx context.Context) error

func (*ChartColl) Exist

func (c *ChartColl) Exist(name string) bool

func (*ChartColl) Get

func (c *ChartColl) Get(name string) (*models.Chart, error)

func (*ChartColl) GetCollectionName

func (c *ChartColl) GetCollectionName() string

func (*ChartColl) List

func (c *ChartColl) List() ([]*models.Chart, error)

func (*ChartColl) Update

func (c *ChartColl) Update(obj *models.Chart) error

type ClusterListOpts

type ClusterListOpts struct {
	IDs []string
}

type CodeInfo

type CodeInfo struct {
	AuthorName    string `json:"author_name"`
	CommitId      string `json:"commit_id"`
	CommitMessage string `json:"commit_message"`
}

type ConfigOption

type ConfigOption struct {
	Type    string `bson:"type"`
	ItemKey string `bson:"item_key"`
}

type ConfigurationManagementColl

type ConfigurationManagementColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewConfigurationManagementColl

func NewConfigurationManagementColl() *ConfigurationManagementColl

func (*ConfigurationManagementColl) Create

func (*ConfigurationManagementColl) DeleteByID

func (c *ConfigurationManagementColl) DeleteByID(ctx context.Context, idString string) error

func (*ConfigurationManagementColl) EnsureIndex

func (c *ConfigurationManagementColl) EnsureIndex(ctx context.Context) error

func (*ConfigurationManagementColl) GetApolloByID

func (c *ConfigurationManagementColl) GetApolloByID(ctx context.Context, idString string) (*models.ApolloConfig, error)

func (*ConfigurationManagementColl) GetByID

func (*ConfigurationManagementColl) GetBySystemIdentity

func (c *ConfigurationManagementColl) GetBySystemIdentity(systemIdentity string) (*models.ConfigurationManagement, error)

func (*ConfigurationManagementColl) GetCollectionName

func (c *ConfigurationManagementColl) GetCollectionName() string

func (*ConfigurationManagementColl) GetNacosByID

func (c *ConfigurationManagementColl) GetNacosByID(ctx context.Context, idString string) (*models.NacosConfig, error)

func (*ConfigurationManagementColl) List

func (*ConfigurationManagementColl) Update

type CountTaskOption

type CountTaskOption struct {
	PipelineNames []string
	Statuses      []string
	Status        config.TaskStatus
	TaskCreators  []string
	Committers    []string
	ServiceModule []string
	Type          config.PipelineType
}

type CounterColl

type CounterColl struct {
	*mongo.Collection
	mongo.Session
	// contains filtered or unexported fields
}

func NewCounterColl

func NewCounterColl() *CounterColl

func NewCounterCollWithSession

func NewCounterCollWithSession(session mongo.Session) *CounterColl

func (*CounterColl) Delete

func (c *CounterColl) Delete(counterName string) error

func (*CounterColl) EnsureIndex

func (c *CounterColl) EnsureIndex(_ context.Context) error

func (*CounterColl) Find

func (c *CounterColl) Find(name string) (*models.Counter, error)

func (*CounterColl) GetCollectionName

func (c *CounterColl) GetCollectionName() string

func (*CounterColl) GetNextSeq

func (c *CounterColl) GetNextSeq(counterName string) (int64, error)

func (*CounterColl) Rename

func (c *CounterColl) Rename(oldName, newName string) error

func (*CounterColl) UpsertCounter

func (c *CounterColl) UpsertCounter(counterName string, number int64) error

type CronjobColl

type CronjobColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewCronjobColl

func NewCronjobColl() *CronjobColl

func (*CronjobColl) Create

func (c *CronjobColl) Create(args *models.Cronjob) error

func (*CronjobColl) Delete

func (c *CronjobColl) Delete(param *CronjobDeleteOption) error

func (*CronjobColl) EnsureIndex

func (c *CronjobColl) EnsureIndex(ctx context.Context) error

func (*CronjobColl) GetByID

func (c *CronjobColl) GetByID(id primitive.ObjectID) (*models.Cronjob, error)

func (*CronjobColl) GetByName

func (c *CronjobColl) GetByName(name, cronType string) (*models.Cronjob, error)

func (*CronjobColl) GetCollectionName

func (c *CronjobColl) GetCollectionName() string

func (*CronjobColl) List

func (c *CronjobColl) List(param *ListCronjobParam) ([]*models.Cronjob, error)

func (*CronjobColl) ListActiveJob

func (c *CronjobColl) ListActiveJob() ([]*models.Cronjob, error)

func (*CronjobColl) Update

func (c *CronjobColl) Update(job *models.Cronjob) error

func (*CronjobColl) Upsert

func (c *CronjobColl) Upsert(args *models.Cronjob) error

type CronjobDeleteOption

type CronjobDeleteOption struct {
	IDList     []string
	ParentName string
	ParentType string
}

type CustomWorkflowTestReportColl

type CustomWorkflowTestReportColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewCustomWorkflowTestReportColl

func NewCustomWorkflowTestReportColl() *CustomWorkflowTestReportColl

func (*CustomWorkflowTestReportColl) Create

func (*CustomWorkflowTestReportColl) EnsureIndex

func (c *CustomWorkflowTestReportColl) EnsureIndex(ctx context.Context) error

func (*CustomWorkflowTestReportColl) GetCollectionName

func (c *CustomWorkflowTestReportColl) GetCollectionName() string

func (*CustomWorkflowTestReportColl) ListByWorkflow

func (c *CustomWorkflowTestReportColl) ListByWorkflow(workflowName, jobName string, taskID int64) ([]*models.CustomWorkflowTestReport, error)

type DBInstanceColl

type DBInstanceColl struct {
	*mongo.Collection
}

func NewDBInstanceColl

func NewDBInstanceColl() *DBInstanceColl

func (*DBInstanceColl) Create

func (c *DBInstanceColl) Create(args *models.DBInstance) error

func (*DBInstanceColl) Delete

func (c *DBInstanceColl) Delete(id string) error

func (*DBInstanceColl) EnsureIndex

func (c *DBInstanceColl) EnsureIndex(ctx context.Context) error

func (*DBInstanceColl) Find

func (*DBInstanceColl) GetCollectionName

func (c *DBInstanceColl) GetCollectionName() string

func (*DBInstanceColl) List

func (c *DBInstanceColl) List() ([]*models.DBInstance, error)

func (*DBInstanceColl) ListByProject

func (c *DBInstanceColl) ListByProject(projectName string) ([]*models.DBInstance, error)

func (*DBInstanceColl) Update

func (c *DBInstanceColl) Update(id string, args *models.DBInstance) error

type DBInstanceCollFindOption

type DBInstanceCollFindOption struct {
	Id   string
	Name string
}

type DashboardConfigColl

type DashboardConfigColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDashboardConfigColl

func NewDashboardConfigColl() *DashboardConfigColl

func (*DashboardConfigColl) CreateOrUpdate

func (c *DashboardConfigColl) CreateOrUpdate(args *models.DashboardConfig) error

func (*DashboardConfigColl) EnsureIndex

func (c *DashboardConfigColl) EnsureIndex(ctx context.Context) error

func (*DashboardConfigColl) GetByUser

func (c *DashboardConfigColl) GetByUser(userName, userID string) (*models.DashboardConfig, error)

func (*DashboardConfigColl) GetCollectionName

func (c *DashboardConfigColl) GetCollectionName() string

type DeleteEnvSvcDependOption

type DeleteEnvSvcDependOption struct {
	Id            string
	CreateTime    string
	ProductName   string
	Namespace     string
	EnvName       string
	ServiceName   string
	ServiceModule string
}

type DeliveryActivityArgs

type DeliveryActivityArgs struct {
	ArtifactID string `json:"artifact_id"`
	RepoName   string `json:"repo_name"`
	Branch     string `json:"branch"`
	PerPage    int    `json:"per_page"`
	Page       int    `json:"page"`
}

type DeliveryActivityColl

type DeliveryActivityColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliveryActivityColl

func NewDeliveryActivityColl() *DeliveryActivityColl

func (*DeliveryActivityColl) EnsureIndex

func (c *DeliveryActivityColl) EnsureIndex(ctx context.Context) error

func (*DeliveryActivityColl) GetCollectionName

func (c *DeliveryActivityColl) GetCollectionName() string

func (*DeliveryActivityColl) Insert

func (*DeliveryActivityColl) InsertWithID

func (c *DeliveryActivityColl) InsertWithID(id string, args *models.DeliveryActivity) error

func (*DeliveryActivityColl) List

type DeliveryArtifactArgs

type DeliveryArtifactArgs struct {
	ID                string `json:"id"`
	Image             string `json:"image"`
	Name              string `json:"name"`
	Type              string `json:"type"`
	RepoName          string `json:"repo_name"`
	Branch            string `json:"branch"`
	Source            string `json:"source"`
	ImageHash         string `json:"image_hash"`
	ImageTag          string `json:"image_tag"`
	ImageDigest       string `json:"image_digest"`
	PerPage           int    `json:"per_page"`
	Page              int    `json:"page"`
	IsFuzzyQuery      bool   `json:"is_fuzzy_query"`
	OnlyCount         bool   `json:"only_count"`
	PackageStorageURI string `json:"package_storage_uri"`
}

type DeliveryArtifactColl

type DeliveryArtifactColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliveryArtifactColl

func NewDeliveryArtifactColl() *DeliveryArtifactColl

func (*DeliveryArtifactColl) EnsureIndex

func (c *DeliveryArtifactColl) EnsureIndex(ctx context.Context) error

func (*DeliveryArtifactColl) Get

func (*DeliveryArtifactColl) GetCollectionName

func (c *DeliveryArtifactColl) GetCollectionName() string

func (*DeliveryArtifactColl) Insert

func (*DeliveryArtifactColl) List

func (*DeliveryArtifactColl) ListTars

func (*DeliveryArtifactColl) Update

type DeliveryBuildArgs

type DeliveryBuildArgs struct {
	ID          string `json:"id"`
	ReleaseID   string `json:"releaseId"`
	ServiceName string `json:"serviceName"`
}

type DeliveryBuildColl

type DeliveryBuildColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliveryBuildColl

func NewDeliveryBuildColl() *DeliveryBuildColl

func (*DeliveryBuildColl) Delete

func (c *DeliveryBuildColl) Delete(releaseID string) error

func (*DeliveryBuildColl) EnsureIndex

func (c *DeliveryBuildColl) EnsureIndex(ctx context.Context) error

func (*DeliveryBuildColl) Find

func (*DeliveryBuildColl) GetCollectionName

func (c *DeliveryBuildColl) GetCollectionName() string

func (*DeliveryBuildColl) Insert

func (c *DeliveryBuildColl) Insert(args *models.DeliveryBuild) error

type DeliveryDeployArgs

type DeliveryDeployArgs struct {
	ID          string `json:"id"`
	ReleaseID   string `json:"releaseId"`
	ServiceName string `json:"serviceName"`
}

type DeliveryDeployColl

type DeliveryDeployColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliveryDeployColl

func NewDeliveryDeployColl() *DeliveryDeployColl

func (*DeliveryDeployColl) Delete

func (c *DeliveryDeployColl) Delete(releaseID string) error

func (*DeliveryDeployColl) EnsureIndex

func (c *DeliveryDeployColl) EnsureIndex(ctx context.Context) error

func (*DeliveryDeployColl) Find

func (*DeliveryDeployColl) GetCollectionName

func (c *DeliveryDeployColl) GetCollectionName() string

func (*DeliveryDeployColl) Insert

func (c *DeliveryDeployColl) Insert(args *models.DeliveryDeploy) error

type DeliveryDistributeArgs

type DeliveryDistributeArgs struct {
	ID             string                `json:"id"`
	ReleaseID      string                `json:"releaseId"`
	ServiceName    string                `json:"serviceName"`
	ChartName      string                `json:"chartName"`
	DistributeType config.DistributeType `json:"distributeType"`
}

type DeliveryDistributeColl

type DeliveryDistributeColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliveryDistributeColl

func NewDeliveryDistributeColl() *DeliveryDistributeColl

func (*DeliveryDistributeColl) Delete

func (c *DeliveryDistributeColl) Delete(releaseID string) error

func (*DeliveryDistributeColl) EnsureIndex

func (c *DeliveryDistributeColl) EnsureIndex(ctx context.Context) error

func (*DeliveryDistributeColl) Find

func (*DeliveryDistributeColl) GetCollectionName

func (c *DeliveryDistributeColl) GetCollectionName() string

func (*DeliveryDistributeColl) Insert

type DeliverySecurityArgs

type DeliverySecurityArgs struct {
	ID        string `json:"id"`
	ImageID   string `json:"imageId"`
	ImageName string `json:"imageName"`
	Severity  string `json:"severity"`
}

type DeliverySecurityColl

type DeliverySecurityColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliverySecurityColl

func NewDeliverySecurityColl() *DeliverySecurityColl

func (*DeliverySecurityColl) EnsureIndex

func (c *DeliverySecurityColl) EnsureIndex(ctx context.Context) error

func (*DeliverySecurityColl) Find

func (*DeliverySecurityColl) FindStatistics

func (c *DeliverySecurityColl) FindStatistics(imageID string) (map[string]int, error)

func (*DeliverySecurityColl) GetCollectionName

func (c *DeliverySecurityColl) GetCollectionName() string

func (*DeliverySecurityColl) Insert

type DeliveryTestArgs

type DeliveryTestArgs struct {
	ID        string `json:"id"`
	ReleaseID string `json:"releaseId"`
}

type DeliveryTestColl

type DeliveryTestColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliveryTestColl

func NewDeliveryTestColl() *DeliveryTestColl

func (*DeliveryTestColl) Delete

func (c *DeliveryTestColl) Delete(releaseID string) error

func (*DeliveryTestColl) EnsureIndex

func (c *DeliveryTestColl) EnsureIndex(ctx context.Context) error

func (*DeliveryTestColl) Find

func (*DeliveryTestColl) GetCollectionName

func (c *DeliveryTestColl) GetCollectionName() string

func (*DeliveryTestColl) Insert

func (c *DeliveryTestColl) Insert(args *models.DeliveryTest) error

type DeliveryVersionArgs

type DeliveryVersionArgs struct {
	ID           string `json:"id"`
	ProductName  string `json:"productName"`
	Version      string `json:"version"`
	WorkflowName string `json:"workflowName"`
	TaskID       int    `json:"taskId"`
	PerPage      int    `json:"perPage"`
	Page         int    `json:"page"`
}

type DeliveryVersionColl

type DeliveryVersionColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDeliveryVersionColl

func NewDeliveryVersionColl() *DeliveryVersionColl

func (*DeliveryVersionColl) Delete

func (c *DeliveryVersionColl) Delete(id string) error

func (*DeliveryVersionColl) EnsureIndex

func (c *DeliveryVersionColl) EnsureIndex(ctx context.Context) error

func (*DeliveryVersionColl) Find

func (*DeliveryVersionColl) FindProducts

func (c *DeliveryVersionColl) FindProducts() ([]string, error)

func (*DeliveryVersionColl) Get

func (*DeliveryVersionColl) GetCollectionName

func (c *DeliveryVersionColl) GetCollectionName() string

func (*DeliveryVersionColl) Insert

func (*DeliveryVersionColl) ListDeliveryVersions

func (c *DeliveryVersionColl) ListDeliveryVersions(productName string) ([]*models.DeliveryVersion, error)

func (*DeliveryVersionColl) Update

func (*DeliveryVersionColl) UpdateStatusByName

func (c *DeliveryVersionColl) UpdateStatusByName(versionName, projectName, status, errorStr string) error

func (*DeliveryVersionColl) UpdateTaskID

func (c *DeliveryVersionColl) UpdateTaskID(versionName, projectName string, taskID int32) error

func (*DeliveryVersionColl) UpdateWorkflowTask

func (c *DeliveryVersionColl) UpdateWorkflowTask(versionName, projectName, workflowName string, taskID int32) error

type DiffNoteColl

type DiffNoteColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDiffNoteColl

func NewDiffNoteColl() *DiffNoteColl

func (*DiffNoteColl) Create

func (c *DiffNoteColl) Create(args *models.DiffNote) error

func (*DiffNoteColl) EnsureIndex

func (c *DiffNoteColl) EnsureIndex(ctx context.Context) error

func (*DiffNoteColl) Find

func (c *DiffNoteColl) Find(opt *DiffNoteFindOpt) (*models.DiffNote, error)

func (*DiffNoteColl) GetCollectionName

func (c *DiffNoteColl) GetCollectionName() string

func (*DiffNoteColl) Update

func (c *DiffNoteColl) Update(id, commitID, body string, resolved bool) error

type DiffNoteFindOpt

type DiffNoteFindOpt struct {
	CodehostID     int
	ProjectID      string
	MergeRequestID int
}

type DindCleanColl

type DindCleanColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDindCleanColl

func NewDindCleanColl() *DindCleanColl

func (*DindCleanColl) EnsureIndex

func (c *DindCleanColl) EnsureIndex(ctx context.Context) error

func (*DindCleanColl) GetCollectionName

func (c *DindCleanColl) GetCollectionName() string

func (*DindCleanColl) List

func (c *DindCleanColl) List() ([]*models.DindClean, error)

func (*DindCleanColl) UpdateStatusInfo

func (c *DindCleanColl) UpdateStatusInfo(args *models.DindClean) error

func (*DindCleanColl) Upsert

func (c *DindCleanColl) Upsert(args *models.DindClean) error

type DockerfileTemplateColl

type DockerfileTemplateColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewDockerfileTemplateColl

func NewDockerfileTemplateColl() *DockerfileTemplateColl

func (*DockerfileTemplateColl) Create

func (*DockerfileTemplateColl) DeleteByID

func (c *DockerfileTemplateColl) DeleteByID(idstring string) error

func (*DockerfileTemplateColl) EnsureIndex

func (c *DockerfileTemplateColl) EnsureIndex(ctx context.Context) error

func (*DockerfileTemplateColl) GetById

func (c *DockerfileTemplateColl) GetById(idstring string) (*models.DockerfileTemplate, error)

func (*DockerfileTemplateColl) GetByName

func (*DockerfileTemplateColl) GetCollectionName

func (c *DockerfileTemplateColl) GetCollectionName() string

func (*DockerfileTemplateColl) List

func (c *DockerfileTemplateColl) List(pageNum, pageSize int) ([]*models.DockerfileTemplate, int, error)

func (*DockerfileTemplateColl) Update

func (c *DockerfileTemplateColl) Update(idString string, obj *models.DockerfileTemplate) error

type EnvResourceAggregateData

type EnvResourceAggregateData struct {
	ID         EnvResourceBaseData `bson:"_id"`
	CreateTime int64               `bson:"create_time"`
}

type EnvResourceBaseData

type EnvResourceBaseData struct {
	ProductName string `bson:"product_name"`
	EnvName     string `bson:"env_name"`
	Name        string `bson:"name"`
	Type        string `bson:"type"`
}

type EnvResourceColl

type EnvResourceColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewEnvResourceColl

func NewEnvResourceColl() *EnvResourceColl

func (*EnvResourceColl) Create

func (c *EnvResourceColl) Create(args *models.EnvResource) error

func (*EnvResourceColl) Delete

func (c *EnvResourceColl) Delete(oid primitive.ObjectID) error

func (*EnvResourceColl) EnsureIndex

func (c *EnvResourceColl) EnsureIndex(ctx context.Context) error

func (*EnvResourceColl) Find

func (*EnvResourceColl) GetCollectionName

func (c *EnvResourceColl) GetCollectionName() string

func (*EnvResourceColl) List

func (*EnvResourceColl) ListLatestResource

func (c *EnvResourceColl) ListLatestResource(opt *QueryEnvResourceOption) ([]*EnvResourceAggregateData, error)

type EnvSvcDependColl

type EnvSvcDependColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewEnvSvcDependColl

func NewEnvSvcDependColl() *EnvSvcDependColl

func (*EnvSvcDependColl) Create

func (c *EnvSvcDependColl) Create(args *models.EnvSvcDepend) error

func (*EnvSvcDependColl) CreateOrUpdate

func (c *EnvSvcDependColl) CreateOrUpdate(envSvcDepend *models.EnvSvcDepend) error

func (*EnvSvcDependColl) Delete

func (*EnvSvcDependColl) EnsureIndex

func (c *EnvSvcDependColl) EnsureIndex(ctx context.Context) error

func (*EnvSvcDependColl) Find

func (*EnvSvcDependColl) GetCollectionName

func (c *EnvSvcDependColl) GetCollectionName() string

func (*EnvSvcDependColl) List

func (*EnvSvcDependColl) Update

func (c *EnvSvcDependColl) Update(id string, envSvcDepend *models.EnvSvcDepend) error

type EnvVersionColl

type EnvVersionColl struct {
	*mongo.Collection
	mongo.Session
	// contains filtered or unexported fields
}

func NewEnvServiceVersionColl

func NewEnvServiceVersionColl() *EnvVersionColl

func NewEnvServiceVersionCollWithSession

func NewEnvServiceVersionCollWithSession(session mongo.Session) *EnvVersionColl

func (*EnvVersionColl) Create

func (c *EnvVersionColl) Create(args *models.EnvServiceVersion) error

func (*EnvVersionColl) DeleteRevisions

func (c *EnvVersionColl) DeleteRevisions(productName, envName, serviceName string, isHelmChart, production bool, revision int64) error

func (*EnvVersionColl) EnsureIndex

func (c *EnvVersionColl) EnsureIndex(ctx context.Context) error

func (*EnvVersionColl) Find

func (c *EnvVersionColl) Find(productName, envName, serviceName string, isHelmChart, production bool, revision int64) (*models.EnvServiceVersion, error)

func (*EnvVersionColl) GetCollectionName

func (c *EnvVersionColl) GetCollectionName() string

func (*EnvVersionColl) GetCountAndMaxRevision

func (c *EnvVersionColl) GetCountAndMaxRevision(productName, envName, serviceName string, isHelmChart, production bool) (int64, int64, error)

func (*EnvVersionColl) ListServiceVersions

func (c *EnvVersionColl) ListServiceVersions(productName, envName, serviceName string, isHelmChart, production bool) ([]*models.EnvServiceVersion, error)

type ExternalLinkColl

type ExternalLinkColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewExternalLinkColl

func NewExternalLinkColl() *ExternalLinkColl

func (*ExternalLinkColl) Create

func (c *ExternalLinkColl) Create(args *models.ExternalLink) error

func (*ExternalLinkColl) Delete

func (c *ExternalLinkColl) Delete(id string) error

func (*ExternalLinkColl) EnsureIndex

func (c *ExternalLinkColl) EnsureIndex(ctx context.Context) error

func (*ExternalLinkColl) GetCollectionName

func (c *ExternalLinkColl) GetCollectionName() string

func (*ExternalLinkColl) List

func (c *ExternalLinkColl) List() ([]*models.ExternalLink, error)

func (*ExternalLinkColl) Update

func (c *ExternalLinkColl) Update(id string, args *models.ExternalLink) error

type ExternalSystemColl

type ExternalSystemColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewExternalSystemColl

func NewExternalSystemColl() *ExternalSystemColl

func (*ExternalSystemColl) Create

func (c *ExternalSystemColl) Create(args *models.ExternalSystem) error

func (*ExternalSystemColl) DeleteByID

func (c *ExternalSystemColl) DeleteByID(idstring string) error

func (*ExternalSystemColl) EnsureIndex

func (c *ExternalSystemColl) EnsureIndex(ctx context.Context) error

func (*ExternalSystemColl) GetByID

func (c *ExternalSystemColl) GetByID(idstring string) (*models.ExternalSystem, error)

func (*ExternalSystemColl) GetCollectionName

func (c *ExternalSystemColl) GetCollectionName() string

func (*ExternalSystemColl) List

func (c *ExternalSystemColl) List(pageNum, pageSize int64) ([]*models.ExternalSystem, int64, error)

func (*ExternalSystemColl) Update

func (c *ExternalSystemColl) Update(idString string, obj *models.ExternalSystem) error

type FavoriteArgs

type FavoriteArgs struct {
	UserID      string
	ProductName string
	Name        string
	Type        string
}

type FavoriteColl

type FavoriteColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewFavoriteColl

func NewFavoriteColl() *FavoriteColl

func (*FavoriteColl) Create

func (c *FavoriteColl) Create(args *models.Favorite) error

func (*FavoriteColl) Delete

func (c *FavoriteColl) Delete(args *FavoriteArgs) error

func (*FavoriteColl) DeleteManyByArgs

func (c *FavoriteColl) DeleteManyByArgs(args *FavoriteArgs) error

func (*FavoriteColl) EnsureIndex

func (c *FavoriteColl) EnsureIndex(ctx context.Context) error

func (*FavoriteColl) Find

func (c *FavoriteColl) Find(userID, name, Type string) (*models.Favorite, error)

func (*FavoriteColl) GetCollectionName

func (c *FavoriteColl) GetCollectionName() string

func (*FavoriteColl) List

func (c *FavoriteColl) List(args *FavoriteArgs) ([]*models.Favorite, error)

type FindEnvSvcDependOption

type FindEnvSvcDependOption struct {
	Id            string
	CreateTime    string
	ProductName   string
	Namespace     string
	EnvName       string
	ServiceName   string
	ServiceModule string
}

type FindPrivateKeyOption

type FindPrivateKeyOption struct {
	ID      string
	Address string
	Token   string
	Labels  []string
	Status  string
}

type FindRegOps

type FindRegOps struct {
	ID          string `json:"id"`
	RegAddr     string `json:"reg_addr"`
	RegType     string `json:"reg_type"`
	RegProvider string `json:"reg_provider"`
	IsDefault   bool   `json:"is_default"`
	Namespace   string `json:"namespace"`
}

type FindTaskOption

type FindTaskOption struct {
	PipelineName string
	Status       config.Status
	Type         config.PipelineType
}

type GithubAppColl

type GithubAppColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewGithubAppColl

func NewGithubAppColl() *GithubAppColl

func (*GithubAppColl) Create

func (c *GithubAppColl) Create(args *models.GithubApp) error

func (*GithubAppColl) Delete

func (c *GithubAppColl) Delete(id string) error

func (*GithubAppColl) EnsureIndex

func (c *GithubAppColl) EnsureIndex(ctx context.Context) error

func (*GithubAppColl) Find

func (c *GithubAppColl) Find() ([]*models.GithubApp, error)

func (*GithubAppColl) GetCollectionName

func (c *GithubAppColl) GetCollectionName() string

func (*GithubAppColl) Upsert

func (c *GithubAppColl) Upsert(args *models.GithubApp) error

type HelmRepoColl

type HelmRepoColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewHelmRepoColl

func NewHelmRepoColl() *HelmRepoColl

func (*HelmRepoColl) Create

func (c *HelmRepoColl) Create(args *models.HelmRepo) error

func (*HelmRepoColl) Delete

func (c *HelmRepoColl) Delete(id string) error

func (*HelmRepoColl) EnsureIndex

func (c *HelmRepoColl) EnsureIndex(ctx context.Context) error

func (*HelmRepoColl) Find

func (*HelmRepoColl) GetCollectionName

func (c *HelmRepoColl) GetCollectionName() string

func (*HelmRepoColl) List

func (c *HelmRepoColl) List() ([]*models.HelmRepo, error)

func (*HelmRepoColl) ListByProject

func (c *HelmRepoColl) ListByProject(projectName string) ([]*models.HelmRepo, error)

func (*HelmRepoColl) Update

func (c *HelmRepoColl) Update(id string, args *models.HelmRepo) error

type HelmRepoFindOption

type HelmRepoFindOption struct {
	Id       string
	RepoName string
}

type IMAppColl

type IMAppColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewIMAppColl

func NewIMAppColl() *IMAppColl

func (*IMAppColl) Create

func (c *IMAppColl) Create(ctx context.Context, args *models.IMApp) (string, error)

func (*IMAppColl) DeleteByID

func (c *IMAppColl) DeleteByID(ctx context.Context, idString string) error

func (*IMAppColl) EnsureIndex

func (c *IMAppColl) EnsureIndex(ctx context.Context) error

func (*IMAppColl) GetByID

func (c *IMAppColl) GetByID(ctx context.Context, idString string) (*models.IMApp, error)

func (*IMAppColl) GetCollectionName

func (c *IMAppColl) GetCollectionName() string

func (*IMAppColl) GetDingTalkByAppKey

func (c *IMAppColl) GetDingTalkByAppKey(ctx context.Context, appKey string) (*models.IMApp, error)

func (*IMAppColl) GetLarkByAppID

func (c *IMAppColl) GetLarkByAppID(ctx context.Context, appID string) (*models.IMApp, error)

func (*IMAppColl) List

func (c *IMAppColl) List(ctx context.Context, _type string) ([]*models.IMApp, error)

func (*IMAppColl) Update

func (c *IMAppColl) Update(ctx context.Context, idString string, arg *models.IMApp) error

type ImageTagsColl

type ImageTagsColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewImageTagsCollColl

func NewImageTagsCollColl() *ImageTagsColl

func (*ImageTagsColl) EnsureIndex

func (c *ImageTagsColl) EnsureIndex(ctx context.Context) error

func (*ImageTagsColl) Find

func (*ImageTagsColl) GetCollectionName

func (c *ImageTagsColl) GetCollectionName() string

func (*ImageTagsColl) Insert

func (c *ImageTagsColl) Insert(args *models.ImageTags) error

func (*ImageTagsColl) InsertOrUpdate

func (c *ImageTagsColl) InsertOrUpdate(args *models.ImageTags) error

type ImageTagsFindOption

type ImageTagsFindOption struct {
	RegistryID  string
	RegProvider string
	ImageName   string
	Namespace   string
	TagName     string
}

type InstallColl

type InstallColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewInstallColl

func NewInstallColl() *InstallColl

func (*InstallColl) Create

func (c *InstallColl) Create(args *models.Install) error

func (*InstallColl) Delete

func (c *InstallColl) Delete(name, version string) error

func (*InstallColl) EnsureIndex

func (c *InstallColl) EnsureIndex(ctx context.Context) error

func (*InstallColl) Find

func (c *InstallColl) Find(name, version string) (*models.Install, error)

func (*InstallColl) GetCollectionName

func (c *InstallColl) GetCollectionName() string

func (*InstallColl) InitInstallData

func (c *InstallColl) InitInstallData(installInfoPreset map[string]*models.Install) error

func (*InstallColl) List

func (c *InstallColl) List() ([]*models.Install, error)

func (*InstallColl) Update

func (c *InstallColl) Update(name, version string, args *models.Install) error

func (*InstallColl) UpdateSystemDefault

func (c *InstallColl) UpdateSystemDefault(name, version string, installInfoPreset map[string]*models.Install) error

type ItReportColl

type ItReportColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewItReportColl

func NewItReportColl() *ItReportColl

func (*ItReportColl) EnsureIndex

func (c *ItReportColl) EnsureIndex(ctx context.Context) error

func (*ItReportColl) GetCollectionName

func (c *ItReportColl) GetCollectionName() string

func (*ItReportColl) Upsert

func (c *ItReportColl) Upsert(args *models.ItReport) error

type JenkinsIntegrationColl

type JenkinsIntegrationColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewJenkinsIntegrationColl

func NewJenkinsIntegrationColl() *JenkinsIntegrationColl

func (*JenkinsIntegrationColl) Create

func (*JenkinsIntegrationColl) Delete

func (c *JenkinsIntegrationColl) Delete(ID string) error

func (*JenkinsIntegrationColl) EnsureIndex

func (c *JenkinsIntegrationColl) EnsureIndex(ctx context.Context) error

func (*JenkinsIntegrationColl) Get

func (*JenkinsIntegrationColl) GetCollectionName

func (c *JenkinsIntegrationColl) GetCollectionName() string

func (*JenkinsIntegrationColl) List

func (*JenkinsIntegrationColl) Update

type JobBuildTrendInfos

type JobBuildTrendInfos struct {
	ProjectName string            `bson:"_id" json:"product_name"`
	Documents   []*models.JobInfo `bson:"documents" json:"documents"`
}

type JobInfoCoarseGrainedData

type JobInfoCoarseGrainedData struct {
	StartTime   int64             `json:"start_time"`
	EndTime     int64             `json:"end_time"`
	MonthlyStat []*MonthlyJobInfo `json:"monthly_stat"`
}

type JobInfoColl

type JobInfoColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewJobInfoColl

func NewJobInfoColl() *JobInfoColl

func (*JobInfoColl) Create

func (c *JobInfoColl) Create(ctx context.Context, args *models.JobInfo) error

func (*JobInfoColl) EnsureIndex

func (c *JobInfoColl) EnsureIndex(ctx context.Context) error

func (*JobInfoColl) GetAllProjectNameByTypeName

func (c *JobInfoColl) GetAllProjectNameByTypeName(startTime, endTime int64, typeName string) ([]string, error)

func (*JobInfoColl) GetBuildJobs

func (c *JobInfoColl) GetBuildJobs(startTime, endTime int64, projectName string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetBuildTrend

func (c *JobInfoColl) GetBuildTrend(startTime, endTime int64, projectName []string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetCollectionName

func (c *JobInfoColl) GetCollectionName() string

func (*JobInfoColl) GetDeployJobs

func (c *JobInfoColl) GetDeployJobs(startTime, endTime int64, projectName string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetDeployTrend

func (c *JobInfoColl) GetDeployTrend(startTime, endTime int64, projectName []string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetJobBuildTrendInfos

func (c *JobInfoColl) GetJobBuildTrendInfos(startTime, endTime int64, projectName []string) ([]*JobBuildTrendInfos, error)

func (*JobInfoColl) GetJobInfos

func (c *JobInfoColl) GetJobInfos(startTime, endTime int64, projectName []string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetProductionDeployJobs

func (c *JobInfoColl) GetProductionDeployJobs(startTime, endTime int64, projectName string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetTestJobs

func (c *JobInfoColl) GetTestJobs(startTime, endTime int64, projectName string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetTestJobsByWorkflow

func (c *JobInfoColl) GetTestJobsByWorkflow(workflowName string) ([]*models.JobInfo, error)

func (*JobInfoColl) GetTestTrend

func (c *JobInfoColl) GetTestTrend(startTime, endTime int64, projectName []string) ([]*models.JobInfo, error)

type K8SClusterColl

type K8SClusterColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewK8SClusterColl

func NewK8SClusterColl() *K8SClusterColl

func (*K8SClusterColl) Count

func (c *K8SClusterColl) Count() (int64, error)

func (*K8SClusterColl) Create

func (c *K8SClusterColl) Create(cluster *models.K8SCluster, id string) error

func (*K8SClusterColl) Delete

func (c *K8SClusterColl) Delete(id string) error

func (*K8SClusterColl) EnsureIndex

func (c *K8SClusterColl) EnsureIndex(_ context.Context) error

func (*K8SClusterColl) Find

func (c *K8SClusterColl) Find(clusterType string) ([]*models.K8SCluster, error)

func (*K8SClusterColl) FindActiveClusters

func (c *K8SClusterColl) FindActiveClusters() ([]*models.K8SCluster, error)

func (*K8SClusterColl) FindByID

func (c *K8SClusterColl) FindByID(ID string) (*models.K8SCluster, error)

func (*K8SClusterColl) FindByName

func (c *K8SClusterColl) FindByName(name string) (*models.K8SCluster, error)

func (*K8SClusterColl) FindConnectedClusters

func (c *K8SClusterColl) FindConnectedClusters() ([]*models.K8SCluster, error)

func (*K8SClusterColl) Get

func (c *K8SClusterColl) Get(id string) (*models.K8SCluster, error)

Get ...

func (*K8SClusterColl) GetByToken

func (c *K8SClusterColl) GetByToken(token string) (*models.K8SCluster, error)

func (*K8SClusterColl) GetCollectionName

func (c *K8SClusterColl) GetCollectionName() string

func (*K8SClusterColl) HasDuplicateName

func (c *K8SClusterColl) HasDuplicateName(id, name string) (bool, error)

func (*K8SClusterColl) List

func (c *K8SClusterColl) List(opts *ClusterListOpts) ([]*models.K8SCluster, error)

func (*K8SClusterColl) Update

func (c *K8SClusterColl) Update(cluster *models.K8SCluster) error

Update ...

func (*K8SClusterColl) UpdateConnectState

func (c *K8SClusterColl) UpdateConnectState(id string, disconnected bool) error

func (*K8SClusterColl) UpdateMutableFields

func (c *K8SClusterColl) UpdateMutableFields(cluster *models.K8SCluster, id string) error

func (*K8SClusterColl) UpdateScheduleStrategy

func (c *K8SClusterColl) UpdateScheduleStrategy(cluster *models.K8SCluster) error

func (*K8SClusterColl) UpdateStatus

func (c *K8SClusterColl) UpdateStatus(cluster *models.K8SCluster) error

func (*K8SClusterColl) UpdateUpgradeAgentInfo

func (c *K8SClusterColl) UpdateUpgradeAgentInfo(id, updateHubagentErrorMsg string) error

type LLMIntegrationColl

type LLMIntegrationColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewLLMIntegrationColl

func NewLLMIntegrationColl() *LLMIntegrationColl

func (*LLMIntegrationColl) Count

func (c *LLMIntegrationColl) Count(ctx context.Context) (int64, error)

func (*LLMIntegrationColl) Create

func (*LLMIntegrationColl) Delete

func (c *LLMIntegrationColl) Delete(ctx context.Context, id string) error

func (*LLMIntegrationColl) EnsureIndex

func (c *LLMIntegrationColl) EnsureIndex(ctx context.Context) error

func (*LLMIntegrationColl) FindAll

func (*LLMIntegrationColl) FindByID

func (*LLMIntegrationColl) FindByName

func (c *LLMIntegrationColl) FindByName(ctx context.Context, name string) (*models.LLMIntegration, error)

func (*LLMIntegrationColl) GetCollectionName

func (c *LLMIntegrationColl) GetCollectionName() string

func (*LLMIntegrationColl) Update

type ListAllTaskOption

type ListAllTaskOption struct {
	ProductNames    []string
	ProductName     string
	PipelineName    string
	Type            config.PipelineType
	CreateTime      int64
	BeforeCreatTime bool
	Limit           int
	Skip            int
}

type ListBuildTemplateOption

type ListBuildTemplateOption struct {
	Infrastructure string
}

type ListCronjobParam

type ListCronjobParam struct {
	ParentName string
	ParentType string
}

type ListEnvSvcDependOption

type ListEnvSvcDependOption struct {
	IsSort        bool
	ProductName   string
	Namespace     string
	EnvName       string
	ServiceName   string
	ServiceModule string
}

type ListHostIPArgs

type ListHostIPArgs struct {
	IDs    []string `json:"ids"`
	Labels []string `json:"labels"`
}

type ListMsgQueueCommonOption

type ListMsgQueueCommonOption struct {
	QueueType string
}

type ListMsgQueuePipelineTaskOption

type ListMsgQueuePipelineTaskOption struct {
	QueueType   string
	SortQueueID bool
}

type ListProductOpt

type ListProductOpt struct {
	Products []Product
}

type ListQueueOption

type ListQueueOption struct {
	PipelineName   string
	Status         config.Status
	MergeRequestID string
}

type ListReleasePlanLogOption

type ListReleasePlanLogOption struct {
	PlanID string
	IsSort bool
}

type ListReleasePlanOption

type ListReleasePlanOption struct {
	PageNum        int64
	PageSize       int64
	IsSort         bool
	ExcludedFields []string
	Status         config.ReleasePlanStatus
}

type ListStatsOption

type ListStatsOption struct {
	ProductName string
	Event       string
	Limit       int
}

type ListTaskOption

type ListTaskOption struct {
	PipelineName        string
	PipelineNames       []string
	Status              config.Status
	Statuses            []string
	Team                string
	TeamID              int
	Limit               int
	Skip                int
	Detail              bool
	ForWorkflowTaskList bool
	Type                config.PipelineType
	CreateTime          int64
	TaskCreator         string
	TaskCreators        []string
	Source              string
	Committers          []string
	ServiceModule       []string
	MergeRequestID      string
	NeedTriggerBy       bool
	NeedAllData         bool
}

type ListTestOption

type ListTestOption struct {
	ProductName  string
	ProductNames []string
	TestNames    []string
	TestType     string
	IsSort       bool
	BuildOS      string
	BasicImageID string
}

type ListWorfklowQueueOption

type ListWorfklowQueueOption struct {
	WorkflowName string
	Status       config.Status
}

type ListWorkflowOpt

type ListWorkflowOpt struct {
	Workflows []Workflow
}

type ListWorkflowOption

type ListWorkflowOption struct {
	IsSort      bool
	Projects    []string
	Names       []string
	Ids         []string
	DisplayName string
}

type ListWorkflowTaskV4Option

type ListWorkflowTaskV4Option struct {
	WorkflowName    string
	ProjectName     string
	ProjectNames    []string
	WorkflowNames   []string
	CreateTime      int64
	BeforeCreatTime bool
	Limit           int
	Skip            int
	IsSort          bool
}

type ListWorkflowV3Option

type ListWorkflowV3Option struct {
	ProjectName string
}

type ListWorkflowV4Opt

type ListWorkflowV4Opt struct {
	Workflows []WorkflowV4
}

type ListWorkflowV4Option

type ListWorkflowV4Option struct {
	ProjectName    string
	DisplayName    string
	Names          []string
	Category       setting.WorkflowCategory
	JobTypes       []config.JobType
	Infrastructure string
}

type ListWorkflowV4TemplateOption

type ListWorkflowV4TemplateOption struct {
	Names    []string
	Category setting.WorkflowCategory
}

type MonthlyJobInfo

type MonthlyJobInfo struct {
	Month       int `bson:"month" json:"month"`
	BuildCount  int `bson:"build_count" json:"build_count"`
	DeployCount int `bson:"deploy_count" json:"deploy_count"`
	TestCount   int `bson:"test_count" json:"test_count"`
}

type MsgQueueCommonColl

type MsgQueueCommonColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewMsgQueueCommonColl

func NewMsgQueueCommonColl() *MsgQueueCommonColl

func (*MsgQueueCommonColl) Create

func (*MsgQueueCommonColl) Delete

func (*MsgQueueCommonColl) DeleteByQueueType

func (c *MsgQueueCommonColl) DeleteByQueueType(_type string) error

func (*MsgQueueCommonColl) EnsureIndex

func (c *MsgQueueCommonColl) EnsureIndex(ctx context.Context) error

func (*MsgQueueCommonColl) GetCollectionName

func (c *MsgQueueCommonColl) GetCollectionName() string

func (*MsgQueueCommonColl) List

type MsgQueuePipelineTaskColl

type MsgQueuePipelineTaskColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewMsgQueuePipelineTaskColl

func NewMsgQueuePipelineTaskColl() *MsgQueuePipelineTaskColl

func (*MsgQueuePipelineTaskColl) Create

func (*MsgQueuePipelineTaskColl) Delete

func (*MsgQueuePipelineTaskColl) EnsureIndex

func (c *MsgQueuePipelineTaskColl) EnsureIndex(ctx context.Context) error

func (*MsgQueuePipelineTaskColl) GetCollectionName

func (c *MsgQueuePipelineTaskColl) GetCollectionName() string

func (*MsgQueuePipelineTaskColl) List

type NotificationColl

type NotificationColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewNotificationColl

func NewNotificationColl() *NotificationColl

func (*NotificationColl) Create

func (c *NotificationColl) Create(args *models.Notification) error

func (*NotificationColl) EnsureIndex

func (c *NotificationColl) EnsureIndex(_ context.Context) error

func (*NotificationColl) Find

func (*NotificationColl) GetCollectionName

func (c *NotificationColl) GetCollectionName() string

func (*NotificationColl) Upsert

func (c *NotificationColl) Upsert(args *models.Notification) error

type NotifyColl

type NotifyColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewNotifyColl

func NewNotifyColl() *NotifyColl

func (*NotifyColl) Create

func (c *NotifyColl) Create(args *models.Notify) error

func (*NotifyColl) DeleteByID

func (c *NotifyColl) DeleteByID(id string) error

func (*NotifyColl) DeleteByTime

func (c *NotifyColl) DeleteByTime(expireTime int64) error

func (*NotifyColl) EnsureIndex

func (c *NotifyColl) EnsureIndex(_ context.Context) error

func (*NotifyColl) GetCollectionName

func (c *NotifyColl) GetCollectionName() string

func (*NotifyColl) List

func (c *NotifyColl) List(receiver string) ([]*models.Notify, error)

func (*NotifyColl) Read

func (c *NotifyColl) Read(id string) error

func (*NotifyColl) Update

func (c *NotifyColl) Update(id string, args *models.Notify) error

type ObservabilityColl

type ObservabilityColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewObservabilityColl

func NewObservabilityColl() *ObservabilityColl

func (*ObservabilityColl) Create

func (*ObservabilityColl) DeleteByID

func (c *ObservabilityColl) DeleteByID(ctx context.Context, idString string) error

func (*ObservabilityColl) EnsureIndex

func (c *ObservabilityColl) EnsureIndex(ctx context.Context) error

func (*ObservabilityColl) GetByID

func (c *ObservabilityColl) GetByID(ctx context.Context, idString string) (*models.Observability, error)

func (*ObservabilityColl) GetCollectionName

func (c *ObservabilityColl) GetCollectionName() string

func (*ObservabilityColl) List

func (c *ObservabilityColl) List(ctx context.Context, _type string) ([]*models.Observability, error)

func (*ObservabilityColl) Update

func (c *ObservabilityColl) Update(ctx context.Context, idString string, args *models.Observability) error

type PipelineColl

type PipelineColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewPipelineColl

func NewPipelineColl() *PipelineColl

func (*PipelineColl) Delete

func (c *PipelineColl) Delete(name string) error

func (*PipelineColl) EnsureIndex

func (c *PipelineColl) EnsureIndex(ctx context.Context) error

func (*PipelineColl) Find

func (*PipelineColl) GetCollectionName

func (c *PipelineColl) GetCollectionName() string

func (*PipelineColl) List

func (c *PipelineColl) List(opt *PipelineListOption) ([]*models.Pipeline, error)

func (*PipelineColl) Rename

func (c *PipelineColl) Rename(oldName, newName string) error

func (*PipelineColl) Upsert

func (c *PipelineColl) Upsert(args *models.Pipeline) error

type PipelineFindOption

type PipelineFindOption struct {
	Name string
}

type PipelineListOption

type PipelineListOption struct {
	IsPreview   bool
	Targets     []string
	ProductName string
}

type PluginRepoColl

type PluginRepoColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewPluginRepoColl

func NewPluginRepoColl() *PluginRepoColl

func (*PluginRepoColl) Delete

func (c *PluginRepoColl) Delete(id string) error

func (*PluginRepoColl) EnsureIndex

func (c *PluginRepoColl) EnsureIndex(ctx context.Context) error

func (*PluginRepoColl) GetCollectionName

func (c *PluginRepoColl) GetCollectionName() string

func (*PluginRepoColl) List

func (c *PluginRepoColl) List(offical *bool) ([]*models.PluginRepo, error)

func (*PluginRepoColl) Upsert

func (c *PluginRepoColl) Upsert(pluginRepo *models.PluginRepo) error

type PrivateKeyArgs

type PrivateKeyArgs struct {
	Name        string
	ProjectName string
	SystemOnly  bool
}

type PrivateKeyColl

type PrivateKeyColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewPrivateKeyColl

func NewPrivateKeyColl() *PrivateKeyColl

func (*PrivateKeyColl) BulkDelete

func (c *PrivateKeyColl) BulkDelete(projectName string) error

func (*PrivateKeyColl) Create

func (c *PrivateKeyColl) Create(args *models.PrivateKey) error

func (*PrivateKeyColl) Delete

func (c *PrivateKeyColl) Delete(id string) error

func (*PrivateKeyColl) DeleteAll

func (c *PrivateKeyColl) DeleteAll() error

func (*PrivateKeyColl) DistinctLabels

func (c *PrivateKeyColl) DistinctLabels() ([]string, error)

DistinctLabels returns distinct label

func (*PrivateKeyColl) EnsureIndex

func (c *PrivateKeyColl) EnsureIndex(ctx context.Context) error

func (*PrivateKeyColl) Find

func (*PrivateKeyColl) GetCollectionName

func (c *PrivateKeyColl) GetCollectionName() string

func (*PrivateKeyColl) List

func (c *PrivateKeyColl) List(args *PrivateKeyArgs) ([]*models.PrivateKey, error)

func (*PrivateKeyColl) ListHostIPByArgs

func (c *PrivateKeyColl) ListHostIPByArgs(args *ListHostIPArgs) ([]*models.PrivateKey, error)

func (*PrivateKeyColl) Update

func (c *PrivateKeyColl) Update(id string, args *models.PrivateKey) error

type Product

type Product struct {
	Name        string `json:"name"`
	ProjectName string `json:"projectName"`
}

type ProductColl

type ProductColl struct {
	*mongo.Collection
	mongo.Session
	// contains filtered or unexported fields
}

func NewProductColl

func NewProductColl() *ProductColl

func NewProductCollWithSession

func NewProductCollWithSession(session mongo.Session) *ProductColl

func (*ProductColl) Count

func (c *ProductColl) Count(productName string) (int, error)

func (*ProductColl) Create

func (c *ProductColl) Create(args *models.Product) error

func (*ProductColl) Delete

func (c *ProductColl) Delete(owner, productName string) error

func (*ProductColl) EnsureIndex

func (c *ProductColl) EnsureIndex(ctx context.Context) error

func (*ProductColl) EnvCount

func (c *ProductColl) EnvCount() (int64, error)

func (*ProductColl) Find

func (*ProductColl) GetCollectionName

func (c *ProductColl) GetCollectionName() string

func (*ProductColl) List

func (c *ProductColl) List(opt *ProductListOptions) ([]*models.Product, error)

func (*ProductColl) ListByProducts

func (c *ProductColl) ListByProducts(opt ListProductOpt) ([]*models.Product, error)

func (*ProductColl) ListEnvByNamespace

func (c *ProductColl) ListEnvByNamespace(clusterID, namespace string) ([]*models.Product, error)

func (*ProductColl) ListExistedNamespace

func (c *ProductColl) ListExistedNamespace(clusterID string) ([]string, error)

func (*ProductColl) ListNamespace

func (c *ProductColl) ListNamespace(clusterID string) ([]string, error)

func (*ProductColl) ListProductionNamespace

func (c *ProductColl) ListProductionNamespace(clusterID string) ([]string, error)

func (*ProductColl) ListProjectsInNames

func (c *ProductColl) ListProjectsInNames(names []string) ([]*projectEnvs, error)

func (*ProductColl) Update

func (c *ProductColl) Update(args *models.Product) error

Update Cannot update owner & product name

func (*ProductColl) UpdateAll

func (c *ProductColl) UpdateAll(envs []*models.Product) error

UpdateAll updates all envs in a bulk write. Currently only field `services` is supported. Note: A bulk operation can have at most 1000 operations, but the client will do it for us. see https://stackoverflow.com/questions/24237887/what-is-mongodb-batch-operation-max-size

func (*ProductColl) UpdateConfigs

func (c *ProductColl) UpdateConfigs(envName, productName string, analysisConfig *models.AnalysisConfig, notificationConfigs []*models.NotificationConfig) error

func (*ProductColl) UpdateDeployStrategy

func (c *ProductColl) UpdateDeployStrategy(envName, productName string, deployStrategy map[string]string) error

func (*ProductColl) UpdateDeployStrategyAndGlobalVariable

func (c *ProductColl) UpdateDeployStrategyAndGlobalVariable(envName, productName string, deployStrategy map[string]string, globalVariables []*types.GlobalVariableKV) error

func (*ProductColl) UpdateErrors

func (c *ProductColl) UpdateErrors(owner, productName, errorMsg string) error

func (*ProductColl) UpdateGlobalVariable

func (c *ProductColl) UpdateGlobalVariable(args *models.Product) error

func (*ProductColl) UpdateGroup

func (c *ProductColl) UpdateGroup(envName, productName string, groupIndex int, group []*models.ProductService) error

UpdateGroup TODO UpdateGroup needs to be optimized Service info may be override when updating multiple services in same group at the sametime

func (*ProductColl) UpdateIsPublic

func (c *ProductColl) UpdateIsPublic(envName, productName string, isPublic bool) error

func (*ProductColl) UpdateIstioGrayscale

func (c *ProductColl) UpdateIstioGrayscale(envName, productName string, istioGrayscale models.IstioGrayscale) error

func (*ProductColl) UpdateProductAlias

func (c *ProductColl) UpdateProductAlias(envName, productName, alias string) error

func (*ProductColl) UpdateProductRecycleDay

func (c *ProductColl) UpdateProductRecycleDay(envName, productName string, recycleDay int) error

func (*ProductColl) UpdateProductVariables

func (c *ProductColl) UpdateProductVariables(product *models.Product) error

func (*ProductColl) UpdateRegistry

func (c *ProductColl) UpdateRegistry(envName, productName, registryId string) error

func (*ProductColl) UpdateStatus

func (c *ProductColl) UpdateStatus(owner, productName, status string) error

func (*ProductColl) UpdateStatusAndError

func (c *ProductColl) UpdateStatusAndError(envName, projectName, status, errorMsg string) error

type ProductEnvFindOptions

type ProductEnvFindOptions struct {
	Name      string
	Namespace string
}

type ProductFindOptions

type ProductFindOptions struct {
	Name              string
	EnvName           string
	Namespace         string
	Production        *bool
	IgnoreNotFoundErr bool
}

type ProductListOptions

type ProductListOptions struct {
	EnvName             string
	Name                string
	Namespace           string
	IsPublic            bool
	ClusterID           string
	IsSortByUpdateTime  bool
	IsSortByProductName bool
	ExcludeStatus       []string
	ExcludeSource       string
	Source              string
	InProjects          []string
	InEnvs              []string
	InIDs               []string

	// New Since v1.11.0
	ShareEnvEnable  *bool
	ShareEnvIsBase  *bool
	ShareEnvBaseEnv *string

	// New Since v2.1.0
	IstioGrayscaleEnable  *bool
	IstioGrayscaleIsBase  *bool
	IstioGrayscaleBaseEnv *string

	Production *bool
}

ClusterId is a primitive.ObjectID{}.Hex()

type ProductionServiceColl

type ProductionServiceColl struct {
	*mongo.Collection
	mongo.Session
	// contains filtered or unexported fields
}

func NewProductionServiceColl

func NewProductionServiceColl() *ProductionServiceColl

func NewProductionServiceCollWithSession

func NewProductionServiceCollWithSession(session mongo.Session) *ProductionServiceColl

func (*ProductionServiceColl) Create

func (c *ProductionServiceColl) Create(args *models.Service) error

func (*ProductionServiceColl) Delete

func (c *ProductionServiceColl) Delete(serviceName, serviceType, productName, status string, revision int64) error

func (*ProductionServiceColl) DeleteByOptions

func (*ProductionServiceColl) DeleteByProject

func (c *ProductionServiceColl) DeleteByProject(productName string) error

func (*ProductionServiceColl) EnsureIndex

func (c *ProductionServiceColl) EnsureIndex(ctx context.Context) error

func (*ProductionServiceColl) Find

func (*ProductionServiceColl) GetChartTemplateReference

func (c *ProductionServiceColl) GetChartTemplateReference(templateName string) ([]*models.Service, error)

func (*ProductionServiceColl) GetCollectionName

func (c *ProductionServiceColl) GetCollectionName() string

func (*ProductionServiceColl) GetYamlTemplateLatestReference

func (c *ProductionServiceColl) GetYamlTemplateLatestReference(templateID string) ([]*models.Service, error)

func (*ProductionServiceColl) GetYamlTemplateReference

func (c *ProductionServiceColl) GetYamlTemplateReference(templateID string) ([]*models.Service, error)

func (*ProductionServiceColl) ListMaxRevisions

func (c *ProductionServiceColl) ListMaxRevisions(opt *ServiceListOption) ([]*models.Service, error)

func (*ProductionServiceColl) ListMaxRevisionsByProduct

func (c *ProductionServiceColl) ListMaxRevisionsByProduct(productName string) ([]*models.Service, error)

func (*ProductionServiceColl) ListMaxRevisionsByProject

func (c *ProductionServiceColl) ListMaxRevisionsByProject(productName, serviceType string) ([]*models.Service, error)

func (*ProductionServiceColl) ListServiceAllRevisions

func (c *ProductionServiceColl) ListServiceAllRevisions(productName, serviceName string) ([]*models.Service, error)

func (*ProductionServiceColl) ListServiceAllRevisionsAndStatus

func (c *ProductionServiceColl) ListServiceAllRevisionsAndStatus(serviceName, productName string) ([]*models.Service, error)

ListServiceAllRevisionsAndStatus will list all revision include deleting status

func (*ProductionServiceColl) ListServicesWithSRevision

func (c *ProductionServiceColl) ListServicesWithSRevision(opt *SvcRevisionListOption) ([]*models.Service, error)

func (*ProductionServiceColl) SearchMaxRevisionsByService

func (c *ProductionServiceColl) SearchMaxRevisionsByService(serviceName string) ([]*models.Service, error)

func (*ProductionServiceColl) TransferServiceSource added in v2.3.0

func (c *ProductionServiceColl) TransferServiceSource(productName, serviceName, source, newSource, username, yaml string) error

func (*ProductionServiceColl) Update

func (c *ProductionServiceColl) Update(args *models.Service) error

func (*ProductionServiceColl) UpdateServiceContainers

func (c *ProductionServiceColl) UpdateServiceContainers(args *models.Service) error

func (*ProductionServiceColl) UpdateServiceVariables

func (c *ProductionServiceColl) UpdateServiceVariables(args *models.Service) error

func (*ProductionServiceColl) UpdateStatus

func (c *ProductionServiceColl) UpdateStatus(serviceName, productName, status string) error

type ProductionServiceDeleteOption

type ProductionServiceDeleteOption struct {
	ServiceName string
	ProductName string
	Type        string
	Status      string
	Revision    int64
}

type ProductionServiceOption

type ProductionServiceOption struct {
	ProductName   string
	ExcludeStatus string
}

type ProjectClusterRelationColl

type ProjectClusterRelationColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewProjectClusterRelationColl

func NewProjectClusterRelationColl() *ProjectClusterRelationColl

func (*ProjectClusterRelationColl) Create

func (*ProjectClusterRelationColl) Delete

func (*ProjectClusterRelationColl) EnsureIndex

func (c *ProjectClusterRelationColl) EnsureIndex(ctx context.Context) error

func (*ProjectClusterRelationColl) GetCollectionName

func (c *ProjectClusterRelationColl) GetCollectionName() string

func (*ProjectClusterRelationColl) List

type ProjectClusterRelationOption

type ProjectClusterRelationOption struct {
	ProjectName string
	ClusterID   string
}

type ProjectGroupColl

type ProjectGroupColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewProjectGroupColl

func NewProjectGroupColl() *ProjectGroupColl

func (*ProjectGroupColl) Create

func (c *ProjectGroupColl) Create(args *models.ProjectGroup) error

func (*ProjectGroupColl) Delete

func (c *ProjectGroupColl) Delete(name string) error

func (*ProjectGroupColl) EnsureIndex

func (c *ProjectGroupColl) EnsureIndex(ctx context.Context) error

func (*ProjectGroupColl) Find

func (*ProjectGroupColl) GetCollectionName

func (c *ProjectGroupColl) GetCollectionName() string

func (*ProjectGroupColl) List

func (c *ProjectGroupColl) List() ([]*models.ProjectGroup, error)

func (*ProjectGroupColl) ListGroupNames

func (c *ProjectGroupColl) ListGroupNames() ([]string, error)

func (*ProjectGroupColl) Update

func (c *ProjectGroupColl) Update(args *models.ProjectGroup) error

type ProjectGroupOpts

type ProjectGroupOpts struct {
	Name string
	ID   string
}

type ProjectManagementColl

type ProjectManagementColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewProjectManagementColl

func NewProjectManagementColl() *ProjectManagementColl

func (*ProjectManagementColl) Create

func (*ProjectManagementColl) DeleteByID

func (c *ProjectManagementColl) DeleteByID(idHex string) error

func (*ProjectManagementColl) EnsureIndex

func (c *ProjectManagementColl) EnsureIndex(ctx context.Context) error

func (*ProjectManagementColl) GetByID

func (*ProjectManagementColl) GetBySystemIdentity

func (c *ProjectManagementColl) GetBySystemIdentity(systemIdentity string) (*models.ProjectManagement, error)

func (*ProjectManagementColl) GetCollectionName

func (c *ProjectManagementColl) GetCollectionName() string

func (*ProjectManagementColl) GetJira

Deprecated since 1.19.0

func (*ProjectManagementColl) GetJiraByID

func (c *ProjectManagementColl) GetJiraByID(idHex string) (*models.ProjectManagement, error)

func (*ProjectManagementColl) GetMeego

Deprecated since 1.19.0

func (*ProjectManagementColl) GetMeegoByID

func (c *ProjectManagementColl) GetMeegoByID(idHex string) (*models.ProjectManagement, error)

func (*ProjectManagementColl) List

func (*ProjectManagementColl) UpdateByID

func (c *ProjectManagementColl) UpdateByID(idHex string, pm *models.ProjectManagement) error

type ProxyArgs

type ProxyArgs struct {
	Type string
}

type ProxyColl

type ProxyColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewProxyColl

func NewProxyColl() *ProxyColl

func (*ProxyColl) Create

func (c *ProxyColl) Create(args *models.Proxy) error

func (*ProxyColl) Delete

func (c *ProxyColl) Delete(id string) error

func (*ProxyColl) EnsureIndex

func (c *ProxyColl) EnsureIndex(ctx context.Context) error

func (*ProxyColl) Find

func (c *ProxyColl) Find(id string) (*models.Proxy, error)

func (*ProxyColl) GetCollectionName

func (c *ProxyColl) GetCollectionName() string

func (*ProxyColl) List

func (c *ProxyColl) List(args *ProxyArgs) ([]*models.Proxy, error)

func (*ProxyColl) Update

func (c *ProxyColl) Update(id string, args *models.Proxy) error

type QueryEnvResourceOption

type QueryEnvResourceOption struct {
	Id             string
	CreateTime     string
	IsSort         bool
	ProductName    string
	Namespace      string
	EnvName        string
	Name           string
	Type           string
	IgnoreNotFound bool
	AutoSync       bool
	Active         bool
}

type QueueColl

type QueueColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewQueueColl

func NewQueueColl() *QueueColl

func (*QueueColl) Create

func (c *QueueColl) Create(args *models.Queue) error

func (*QueueColl) Delete

func (c *QueueColl) Delete(args *models.Queue) error

func (*QueueColl) EnsureIndex

func (c *QueueColl) EnsureIndex(ctx context.Context) error

func (*QueueColl) GetCollectionName

func (c *QueueColl) GetCollectionName() string

func (*QueueColl) List

func (c *QueueColl) List(opt *ListQueueOption) ([]*models.Queue, error)

func (*QueueColl) Update

func (c *QueueColl) Update(args *models.Queue) error

func (*QueueColl) UpdateAgent

func (c *QueueColl) UpdateAgent(taskID int64, pipelineName string, createTime int64, agentID string) error

type RegistryNamespaceColl

type RegistryNamespaceColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewRegistryNamespaceColl

func NewRegistryNamespaceColl() *RegistryNamespaceColl

func (*RegistryNamespaceColl) Create

func (*RegistryNamespaceColl) Delete

func (r *RegistryNamespaceColl) Delete(id string) error

func (*RegistryNamespaceColl) EnsureIndex

func (r *RegistryNamespaceColl) EnsureIndex(ctx context.Context) error

func (*RegistryNamespaceColl) Find

func (*RegistryNamespaceColl) FindAll

func (*RegistryNamespaceColl) FindByProject

func (r *RegistryNamespaceColl) FindByProject(projectName string) ([]*models.RegistryNamespace, error)

func (*RegistryNamespaceColl) GetCollectionName

func (r *RegistryNamespaceColl) GetCollectionName() string

func (*RegistryNamespaceColl) Update

type ReleasePlanColl

type ReleasePlanColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewReleasePlanColl

func NewReleasePlanColl() *ReleasePlanColl

func (*ReleasePlanColl) Create

func (c *ReleasePlanColl) Create(args *models.ReleasePlan) (string, error)

func (*ReleasePlanColl) DeleteByID

func (c *ReleasePlanColl) DeleteByID(ctx context.Context, idString string) error

func (*ReleasePlanColl) EnsureIndex

func (c *ReleasePlanColl) EnsureIndex(ctx context.Context) error

func (*ReleasePlanColl) GetByID

func (c *ReleasePlanColl) GetByID(ctx context.Context, idString string) (*models.ReleasePlan, error)

func (*ReleasePlanColl) GetCollectionName

func (c *ReleasePlanColl) GetCollectionName() string

func (*ReleasePlanColl) ListByOptions

func (c *ReleasePlanColl) ListByOptions(opt *ListReleasePlanOption) ([]*models.ReleasePlan, int64, error)

func (*ReleasePlanColl) UpdateByID

func (c *ReleasePlanColl) UpdateByID(ctx context.Context, idString string, args *models.ReleasePlan) error

type ReleasePlanLogColl

type ReleasePlanLogColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewReleasePlanLogColl

func NewReleasePlanLogColl() *ReleasePlanLogColl

func (*ReleasePlanLogColl) Create

func (c *ReleasePlanLogColl) Create(args *models.ReleasePlanLog) error

func (*ReleasePlanLogColl) EnsureIndex

func (c *ReleasePlanLogColl) EnsureIndex(ctx context.Context) error

func (*ReleasePlanLogColl) GetCollectionName

func (c *ReleasePlanLogColl) GetCollectionName() string

func (*ReleasePlanLogColl) ListByOptions

type RenderSetColl

type RenderSetColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewRenderSetColl

func NewRenderSetColl() *RenderSetColl

func (*RenderSetColl) Create

func (c *RenderSetColl) Create(args *models.RenderSet) error

func (*RenderSetColl) EnsureIndex

func (c *RenderSetColl) EnsureIndex(ctx context.Context) error

func (*RenderSetColl) Find

func (*RenderSetColl) GetCollectionName

func (c *RenderSetColl) GetCollectionName() string

type RenderSetFindOption

type RenderSetFindOption struct {
	// if Revision == 0 then search max revision of RenderSet
	ProductTmpl       string
	EnvName           string
	IsDefault         bool
	Revision          int64
	Name              string
	YamlVariableSetID string
}

RenderSetFindOption ...

type RenderSetPipeResp

type RenderSetPipeResp struct {
	RenderSet struct {
		Name        string `bson:"name"                     json:"name"`
		ProductTmpl string `bson:"product_tmpl"             json:"product_tmpl"`
	} `bson:"_id"      json:"render_set"`
	Revision int64 `bson:"revision"     json:"revision"`
}

type S3StorageColl

type S3StorageColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewS3StorageColl

func NewS3StorageColl() *S3StorageColl

func (*S3StorageColl) Create

func (c *S3StorageColl) Create(args *models.S3Storage) error

Create if the crated storage is default, all other default storage will be set as not default

func (*S3StorageColl) Delete

func (c *S3StorageColl) Delete(id string) error

func (*S3StorageColl) EnsureIndex

func (c *S3StorageColl) EnsureIndex(ctx context.Context) error

func (*S3StorageColl) Find

func (c *S3StorageColl) Find(id string) (*models.S3Storage, error)

func (*S3StorageColl) FindAll

func (c *S3StorageColl) FindAll() ([]*models.S3Storage, error)

func (*S3StorageColl) FindByProject

func (c *S3StorageColl) FindByProject(projectName string) ([]*models.S3Storage, error)

func (*S3StorageColl) FindDefault

func (c *S3StorageColl) FindDefault() (*models.S3Storage, error)

func (*S3StorageColl) GetCollectionName

func (c *S3StorageColl) GetCollectionName() string

func (*S3StorageColl) GetS3Storage

func (c *S3StorageColl) GetS3Storage() (*models.S3Storage, error)

func (*S3StorageColl) InitData

func (c *S3StorageColl) InitData() error

func (*S3StorageColl) Update

func (c *S3StorageColl) Update(id string, args *models.S3Storage) error

Upsert if the updated storage is default, all other default storage will be set as not default

type ScanningColl

type ScanningColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewScanningColl

func NewScanningColl() *ScanningColl

func (*ScanningColl) Create

func (c *ScanningColl) Create(scanning *models.Scanning) error

func (*ScanningColl) DeleteByID

func (c *ScanningColl) DeleteByID(idstring string) error

func (*ScanningColl) EnsureIndex

func (c *ScanningColl) EnsureIndex(ctx context.Context) error

func (*ScanningColl) Find

func (c *ScanningColl) Find(projectName, name string) (*models.Scanning, error)

func (*ScanningColl) GetByID

func (c *ScanningColl) GetByID(idstring string) (*models.Scanning, error)

func (*ScanningColl) GetCollectionName

func (c *ScanningColl) GetCollectionName() string

func (*ScanningColl) GetScanningTemplateReference

func (c *ScanningColl) GetScanningTemplateReference(templateID string) ([]*models.Scanning, error)

func (*ScanningColl) List

func (c *ScanningColl) List(listOption *ScanningListOption, pageNum, pageSize int64) ([]*models.Scanning, int64, error)

func (*ScanningColl) Update

func (c *ScanningColl) Update(idString string, scanning *models.Scanning) error

type ScanningListOption

type ScanningListOption struct {
	ProjectName   string
	ScanningNames []string
	TemplateID    string
}

type ScanningTemplateColl

type ScanningTemplateColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewScanningTemplateColl

func NewScanningTemplateColl() *ScanningTemplateColl

func (*ScanningTemplateColl) Create

func (*ScanningTemplateColl) DeleteByID

func (c *ScanningTemplateColl) DeleteByID(idStr string) error

func (*ScanningTemplateColl) EnsureIndex

func (c *ScanningTemplateColl) EnsureIndex(ctx context.Context) error

func (*ScanningTemplateColl) Find

func (*ScanningTemplateColl) GetCollectionName

func (c *ScanningTemplateColl) GetCollectionName() string

func (*ScanningTemplateColl) List

func (c *ScanningTemplateColl) List(pageNum, pageSize int) ([]*models.ScanningTemplate, int, error)

func (*ScanningTemplateColl) Update

func (c *ScanningTemplateColl) Update(idStr string, obj *models.ScanningTemplate) error

type ScanningTemplateQueryOption

type ScanningTemplateQueryOption struct {
	ID   string
	Name string
}

type ServiceAggregateResult

type ServiceAggregateResult struct {
	ServiceID primitive.ObjectID `bson:"service_id"`
}

type ServiceColl

type ServiceColl struct {
	*mongo.Collection
	mongo.Session
	// contains filtered or unexported fields
}

func NewServiceColl

func NewServiceColl() *ServiceColl

func NewServiceCollWithSession

func NewServiceCollWithSession(session mongo.Session) *ServiceColl

func (*ServiceColl) BatchUpdateExternalServicesStatus

func (c *ServiceColl) BatchUpdateExternalServicesStatus(productName, envName, status string, serviceNames []string) error

func (*ServiceColl) Count

func (c *ServiceColl) Count(productName string) (int, error)

func (*ServiceColl) Create

func (c *ServiceColl) Create(args *models.Service) error

func (*ServiceColl) Delete

func (c *ServiceColl) Delete(serviceName, serviceType, productName, status string, revision int64) error

func (*ServiceColl) EnsureIndex

func (c *ServiceColl) EnsureIndex(ctx context.Context) error

func (*ServiceColl) Find

func (c *ServiceColl) Find(opt *ServiceFindOption) (*models.Service, error)

Find 根据service_name和type查询特定版本的配置模板 如果 Revision == 0 查询最大版本的配置模板

func (*ServiceColl) GetChartTemplateReference

func (c *ServiceColl) GetChartTemplateReference(templateName string) ([]*models.Service, error)

func (*ServiceColl) GetCollectionName

func (c *ServiceColl) GetCollectionName() string

func (*ServiceColl) GetYamlTemplateLatestReference

func (c *ServiceColl) GetYamlTemplateLatestReference(templateID string) ([]*models.Service, error)

func (*ServiceColl) GetYamlTemplateReference

func (c *ServiceColl) GetYamlTemplateReference(templateID string) ([]*models.Service, error)

func (*ServiceColl) ListAllRevisions

func (c *ServiceColl) ListAllRevisions() ([]*models.Service, error)

ListAllRevisions 列出历史所有的service TODO 返回k8s所有service

func (*ServiceColl) ListExternalWorkloadsBy

func (c *ServiceColl) ListExternalWorkloadsBy(productName, envName string, serviceNames ...string) ([]*models.Service, error)

ListExternalWorkloadsBy list service only for external services , other service type not use before refactor

func (*ServiceColl) ListMaxRevisions

func (c *ServiceColl) ListMaxRevisions(opt *ServiceListOption) ([]*models.Service, error)

func (*ServiceColl) ListMaxRevisionsAllSvcByProduct

func (c *ServiceColl) ListMaxRevisionsAllSvcByProduct(productName string) ([]*models.Service, error)

func (*ServiceColl) ListMaxRevisionsByProduct

func (c *ServiceColl) ListMaxRevisionsByProduct(productName string) ([]*models.Service, error)

func (*ServiceColl) ListMaxRevisionsByProject

func (c *ServiceColl) ListMaxRevisionsByProject(serviceName, serviceType string) ([]*models.Service, error)

func (*ServiceColl) ListMaxRevisionsForServices

func (c *ServiceColl) ListMaxRevisionsForServices(services []*templatemodels.ServiceInfo, serviceType string) ([]*models.Service, error)

func (*ServiceColl) ListServiceAllRevisionsAndStatus

func (c *ServiceColl) ListServiceAllRevisionsAndStatus(serviceName, productName string) ([]*models.Service, error)

ListServiceAllRevisionsAndStatus will list all revision include deleting status

func (*ServiceColl) ListServicesWithSRevision

func (c *ServiceColl) ListServicesWithSRevision(opt *SvcRevisionListOption) ([]*models.Service, error)

func (*ServiceColl) SearchMaxRevisionsByService

func (c *ServiceColl) SearchMaxRevisionsByService(serviceName string) ([]*models.Service, error)

func (*ServiceColl) TransferServiceSource

func (c *ServiceColl) TransferServiceSource(productName, serviceName, source, newSource, username, yaml string) error

func (*ServiceColl) Update

func (c *ServiceColl) Update(args *models.Service) error

func (*ServiceColl) UpdateExternalServiceEnvName

func (c *ServiceColl) UpdateExternalServiceEnvName(serviceName, productName, envName string) error

UpdateExternalServiceEnvName only used by external services

func (*ServiceColl) UpdateExternalServicesStatus

func (c *ServiceColl) UpdateExternalServicesStatus(serviceName, productName, status, envName string) error

UpdateExternalServicesStatus only used by external services

func (*ServiceColl) UpdateServiceContainers

func (c *ServiceColl) UpdateServiceContainers(args *models.Service) error

func (*ServiceColl) UpdateServiceEnvConfigs added in v2.3.0

func (c *ServiceColl) UpdateServiceEnvConfigs(args *models.Service) error

func (*ServiceColl) UpdateServiceHealthCheckStatus

func (c *ServiceColl) UpdateServiceHealthCheckStatus(args *models.Service) error

func (*ServiceColl) UpdateServiceVariables

func (c *ServiceColl) UpdateServiceVariables(args *models.Service) error

func (*ServiceColl) UpdateStatus

func (c *ServiceColl) UpdateStatus(serviceName, productName, status string) error

type ServiceFindOption

type ServiceFindOption struct {
	ServiceName         string
	Revision            int64
	Type                string
	Source              string
	ProductName         string
	ExcludeStatus       string
	CodehostID          int
	RepoName            string
	BranchName          string
	IgnoreNoDocumentErr bool
}

type ServiceListOption

type ServiceListOption struct {
	ProductName    string
	ServiceName    string
	BuildName      string
	Type           string
	Source         string
	ExcludeProject string
	InServices     []*templatemodels.ServiceInfo
	NotInServices  []*templatemodels.ServiceInfo
}

type ServiceModule

type ServiceModule struct {
	ServiceModule string              `json:"service_module"`
	ServiceName   string              `json:"service_name"`
	CodeInfo      []*types.Repository `json:"code_info"`
}

type ServiceRevision

type ServiceRevision struct {
	ServiceName string
	Revision    int64
}

type ServicesInExternalEnvArgs

type ServicesInExternalEnvArgs struct {
	ProductName    string
	ServiceName    string
	EnvName        string
	Namespace      string
	ClusterID      string
	ExcludeEnvName string
}

type ServicesInExternalEnvColl

type ServicesInExternalEnvColl struct {
	*mongo.Collection
	mongo.Session
	// contains filtered or unexported fields
}

func NewServiceInExternalEnvWithSess

func NewServiceInExternalEnvWithSess(session mongo.Session) *ServicesInExternalEnvColl

func NewServicesInExternalEnvColl

func NewServicesInExternalEnvColl() *ServicesInExternalEnvColl

func (*ServicesInExternalEnvColl) Create

Create ...

func (*ServicesInExternalEnvColl) Delete

func (*ServicesInExternalEnvColl) EnsureIndex

func (c *ServicesInExternalEnvColl) EnsureIndex(ctx context.Context) error

func (*ServicesInExternalEnvColl) GetCollectionName

func (c *ServicesInExternalEnvColl) GetCollectionName() string

func (*ServicesInExternalEnvColl) List

type SetCustomFieldsOptions

type SetCustomFieldsOptions struct {
	ProjectName  string
	WorkflowName string
}

type SonarIntegrationColl

type SonarIntegrationColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewSonarIntegrationColl

func NewSonarIntegrationColl() *SonarIntegrationColl

func (*SonarIntegrationColl) Create

func (*SonarIntegrationColl) DeleteByID

func (c *SonarIntegrationColl) DeleteByID(ctx context.Context, idstring string) error

func (*SonarIntegrationColl) EnsureIndex

func (c *SonarIntegrationColl) EnsureIndex(ctx context.Context) error

func (*SonarIntegrationColl) GetByID

func (c *SonarIntegrationColl) GetByID(ctx context.Context, idstring string) (*models.SonarIntegration, error)

func (*SonarIntegrationColl) GetBySystemIdentity

func (c *SonarIntegrationColl) GetBySystemIdentity(systemIdentity string) (*models.SonarIntegration, error)

func (*SonarIntegrationColl) GetCollectionName

func (c *SonarIntegrationColl) GetCollectionName() string

func (*SonarIntegrationColl) List

func (c *SonarIntegrationColl) List(ctx context.Context, pageNum, pageSize int64) ([]*models.SonarIntegration, int64, error)

func (*SonarIntegrationColl) Update

func (c *SonarIntegrationColl) Update(ctx context.Context, idString string, obj *models.SonarIntegration) error

type StatDashboardConfigColl

type StatDashboardConfigColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewStatDashboardConfigColl

func NewStatDashboardConfigColl() *StatDashboardConfigColl

func (*StatDashboardConfigColl) BulkCreate

func (*StatDashboardConfigColl) Create

func (*StatDashboardConfigColl) Delete

func (c *StatDashboardConfigColl) Delete(ctx context.Context, key string) error

func (*StatDashboardConfigColl) EnsureIndex

func (c *StatDashboardConfigColl) EnsureIndex(ctx context.Context) error

func (*StatDashboardConfigColl) FindByOptions

func (*StatDashboardConfigColl) GetCollectionName

func (c *StatDashboardConfigColl) GetCollectionName() string

func (*StatDashboardConfigColl) List

func (*StatDashboardConfigColl) Update

type StatsColl

type StatsColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewStatsColl

func NewStatsColl() *StatsColl

func (*StatsColl) Create

func (c *StatsColl) Create(args *models.Stats) error

Create ...

func (*StatsColl) EnsureIndex

func (c *StatsColl) EnsureIndex(ctx context.Context) error

func (*StatsColl) GetCollectionName

func (c *StatsColl) GetCollectionName() string

func (*StatsColl) List

func (c *StatsColl) List(option ListStatsOption) ([]*models.Stats, error)

List ...

type StrategyColl

type StrategyColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewStrategyColl

func NewStrategyColl() *StrategyColl

func (*StrategyColl) EnsureIndex

func (c *StrategyColl) EnsureIndex(ctx context.Context) error

func (*StrategyColl) GetByTarget

func (c *StrategyColl) GetByTarget(target models.CapacityTarget) (*models.CapacityStrategy, error)

GetByTarget returns either one selected CapacityStrategy or error

func (*StrategyColl) GetCollectionName

func (c *StrategyColl) GetCollectionName() string

func (*StrategyColl) Upsert

func (c *StrategyColl) Upsert(strategy *models.CapacityStrategy) error

type SubscriptionColl

type SubscriptionColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewSubscriptionColl

func NewSubscriptionColl() *SubscriptionColl

func (*SubscriptionColl) Delete

func (c *SubscriptionColl) Delete(subscriber string, notifyType int) error

func (*SubscriptionColl) EnsureIndex

func (c *SubscriptionColl) EnsureIndex(ctx context.Context) error

func (*SubscriptionColl) GetCollectionName

func (c *SubscriptionColl) GetCollectionName() string

func (*SubscriptionColl) List

func (c *SubscriptionColl) List(subscriber string) ([]*models.Subscription, error)

func (*SubscriptionColl) Update

func (c *SubscriptionColl) Update(subscriber string, notifyType int, args *models.Subscription) error

func (*SubscriptionColl) Upsert

func (c *SubscriptionColl) Upsert(args *models.Subscription) error

type SvcRevisionListOption

type SvcRevisionListOption struct {
	ProductName      string
	ServiceRevisions []*ServiceRevision
}

type SystemSettingColl

type SystemSettingColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewSystemSettingColl

func NewSystemSettingColl() *SystemSettingColl

func (*SystemSettingColl) CreateOrUpdate

func (c *SystemSettingColl) CreateOrUpdate(id string, args *models.SystemSetting) error

func (*SystemSettingColl) EnsureIndex

func (c *SystemSettingColl) EnsureIndex(ctx context.Context) error

func (*SystemSettingColl) Get

func (*SystemSettingColl) GetCollectionName

func (c *SystemSettingColl) GetCollectionName() string

func (*SystemSettingColl) InitSystemSettings

func (c *SystemSettingColl) InitSystemSettings() error

func (*SystemSettingColl) UpdateConcurrencySetting

func (c *SystemSettingColl) UpdateConcurrencySetting(workflowConcurrency, buildConcurrency int64) error

func (*SystemSettingColl) UpdateDefaultLoginSetting

func (c *SystemSettingColl) UpdateDefaultLoginSetting(defaultLogin string) error

func (*SystemSettingColl) UpdatePrivacySetting

func (c *SystemSettingColl) UpdatePrivacySetting(improvementPlan bool) error

func (*SystemSettingColl) UpdateSecuritySetting

func (c *SystemSettingColl) UpdateSecuritySetting(tokenExpirationTime int64) error

func (*SystemSettingColl) UpdateTheme

func (c *SystemSettingColl) UpdateTheme(theme *models.Theme) error

type TaskColl

type TaskColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewTaskColl

func NewTaskColl() *TaskColl

func (*TaskColl) ArchiveHistoryPipelineTask

func (c *TaskColl) ArchiveHistoryPipelineTask(pipelineName string, taskType config.PipelineType, remain, remainDays int) error

func (*TaskColl) Count

func (c *TaskColl) Count(option *CountTaskOption) (ret int, err error)

func (*TaskColl) Create

func (c *TaskColl) Create(args *task.Task) error

func (*TaskColl) DeleteByPipelineNameAndType

func (c *TaskColl) DeleteByPipelineNameAndType(pipelineName string, typeString config.PipelineType) error

func (*TaskColl) DistinctFieldsPipelineTask

func (c *TaskColl) DistinctFieldsPipelineTask(fieldName, projectName, pipelineName string, typeString config.PipelineType, isNeedAllData bool) ([]interface{}, error)

func (*TaskColl) EnsureIndex

func (c *TaskColl) EnsureIndex(ctx context.Context) error

func (*TaskColl) Find

func (c *TaskColl) Find(id int64, pipelineName string, typeString config.PipelineType) (*task.Task, error)

func (*TaskColl) FindLatestTask

func (c *TaskColl) FindLatestTask(args *FindTaskOption) (*task.Task, error)

func (*TaskColl) FindTask

func (c *TaskColl) FindTask(pipelineName string, typeString config.PipelineType) (*task.Task, error)

func (*TaskColl) FindTodoTasks

func (c *TaskColl) FindTodoTasks() ([]*task.Task, error)

func (*TaskColl) GetCollectionName

func (c *TaskColl) GetCollectionName() string

func (*TaskColl) InCompletedTasks

func (c *TaskColl) InCompletedTasks() ([]*task.Task, error)

func (*TaskColl) List

func (c *TaskColl) List(option *ListTaskOption) (ret []*TaskPreview, err error)

func (*TaskColl) ListAllTasks

func (c *TaskColl) ListAllTasks(option *ListAllTaskOption) ([]*task.Task, error)

func (*TaskColl) ListByCursor

func (c *TaskColl) ListByCursor(option *ListAllTaskOption) (*mongo.Cursor, error)

func (*TaskColl) ListPreview

func (c *TaskColl) ListPreview(pipelineNames []string) (ret []*TaskPreview, err error)

func (*TaskColl) ListRecentTasks

func (c *TaskColl) ListRecentTasks(args *ListTaskOption) ([]*TaskInfo, error)

func (*TaskColl) ListTasks

func (c *TaskColl) ListTasks(option *ListAllTaskOption) ([]*task.Task, error)

func (*TaskColl) Rename

func (c *TaskColl) Rename(oldName, newName string, taskType config.PipelineType) error

func (*TaskColl) Update

func (c *TaskColl) Update(args *task.Task) error

func (*TaskColl) UpdateStatus

func (c *TaskColl) UpdateStatus(taskID int64, pipelineName, userName string, status config.Status) error

func (*TaskColl) UpdateUnfinishedTask

func (c *TaskColl) UpdateUnfinishedTask(args *task.Task) error

type TaskInfo

type TaskInfo struct {
	ID           taskGrouped `bson:"_id"`
	TaskID       int64       `bson:"task_id"`
	PipelineName string      `bson:"pipeline_name"`
	Status       string      `bson:"status"`
}

type TaskPreview

type TaskPreview struct {
	TaskID         int64                     `bson:"task_id"               json:"task_id"`
	TaskCreator    string                    `bson:"task_creator"          json:"task_creator"`
	ProductName    string                    `bson:"product_name"          json:"product_name"`
	PipelineName   string                    `bson:"pipeline_name"         json:"pipeline_name"`
	Namespace      string                    `bson:"namespace"             json:"namespace"`
	ServiceName    string                    `bson:"service_name"          json:"service_name"`
	Status         config.Status             `bson:"status"                json:"status"`
	CreateTime     int64                     `bson:"create_time"           json:"create_time,omitempty"`
	StartTime      int64                     `bson:"start_time"            json:"start_time,omitempty"`
	EndTime        int64                     `bson:"end_time"              json:"end_time,omitempty"`
	SubTasks       []*map[string]interface{} `bson:"sub_tasks,omitempty"   json:"sub_tasks,omitempty"`
	TaskArgs       *models.TaskArgs          `bson:"task_args"             json:"task_args"`
	WorkflowArgs   *models.WorkflowTaskArgs  `bson:"workflow_args"         json:"workflow_args"`
	TestReports    map[string]interface{}    `bson:"test_reports,omitempty" json:"test_reports,omitempty"`
	Type           config.PipelineType       `bson:"type"                  json:"type"`
	Stages         []*models.Stage           `bson:"stages"                json:"stages,omitempty"`
	ServiceModules []*ServiceModule          `bson:"-"                     json:"service_modules"`
	TriggerBy      *models.TriggerBy         `bson:"trigger_by,omitempty"  json:"trigger_by,omitempty"`
}

type TestTaskStatColl

type TestTaskStatColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewTestTaskStatColl

func NewTestTaskStatColl() *TestTaskStatColl

func (*TestTaskStatColl) Create

func (c *TestTaskStatColl) Create(args *models.TestTaskStat) error

func (*TestTaskStatColl) Delete

func (c *TestTaskStatColl) Delete(name string) error

func (*TestTaskStatColl) EnsureIndex

func (c *TestTaskStatColl) EnsureIndex(ctx context.Context) error

func (*TestTaskStatColl) FindTestTaskStat

func (c *TestTaskStatColl) FindTestTaskStat(option *TestTaskStatOption) (*models.TestTaskStat, error)

func (*TestTaskStatColl) GetCollectionName

func (c *TestTaskStatColl) GetCollectionName() string

func (*TestTaskStatColl) GetTestTasks

func (c *TestTaskStatColl) GetTestTasks(startTime, endTime int64) ([]*models.TestTaskStat, error)

func (*TestTaskStatColl) ListTestTask

func (c *TestTaskStatColl) ListTestTask() ([]*models.TestTaskStat, error)

func (*TestTaskStatColl) Update

func (c *TestTaskStatColl) Update(args *models.TestTaskStat) error

type TestTaskStatOption

type TestTaskStatOption struct {
	Name string
}

type TestingColl

type TestingColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewTestingColl

func NewTestingColl() *TestingColl

func (*TestingColl) Create

func (c *TestingColl) Create(testing *models.Testing) error

func (*TestingColl) Delete

func (c *TestingColl) Delete(name, productName string) error

func (*TestingColl) EnsureIndex

func (c *TestingColl) EnsureIndex(ctx context.Context) error

func (*TestingColl) Find

func (c *TestingColl) Find(name, productName string) (*models.Testing, error)

func (*TestingColl) GetCollectionName

func (c *TestingColl) GetCollectionName() string

func (*TestingColl) List

func (c *TestingColl) List(opt *ListTestOption) ([]*models.Testing, error)

func (*TestingColl) ListWithScheduleEnabled

func (c *TestingColl) ListWithScheduleEnabled() ([]*models.Testing, error)

func (*TestingColl) Update

func (c *TestingColl) Update(testing *models.Testing) error

type VariableSetColl

type VariableSetColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewVariableSetColl

func NewVariableSetColl() *VariableSetColl

func (*VariableSetColl) Create

func (c *VariableSetColl) Create(args *models.VariableSet) error

func (*VariableSetColl) Delete

func (c *VariableSetColl) Delete(id string) error

func (*VariableSetColl) EnsureIndex

func (c *VariableSetColl) EnsureIndex(ctx context.Context) error

func (*VariableSetColl) Find

func (*VariableSetColl) GetCollectionName

func (c *VariableSetColl) GetCollectionName() string

func (*VariableSetColl) List

func (*VariableSetColl) Update

func (c *VariableSetColl) Update(id string, args *models.VariableSet) error

type VariableSetFindOption

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

type WebHookColl

type WebHookColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWebHookColl

func NewWebHookColl() *WebHookColl

func (*WebHookColl) AddReferenceOrCreate

func (c *WebHookColl) AddReferenceOrCreate(owner, repo, address, ref string) (bool, error)

AddReferenceOrCreate updates the existing record by adding a new reference if there is a matching record, otherwise, it will create a new record and return true. It is an atomic operation and is safe cross goroutines (because of the unique index).

func (*WebHookColl) Delete

func (c *WebHookColl) Delete(owner, repo, address string) error

Delete deletes the webhook record

func (*WebHookColl) EnsureIndex

func (c *WebHookColl) EnsureIndex(ctx context.Context) error

func (*WebHookColl) Find

func (c *WebHookColl) Find(owner, repo, address string) (*models.WebHook, error)

Find find webhook

func (*WebHookColl) GetCollectionName

func (c *WebHookColl) GetCollectionName() string

func (*WebHookColl) List

func (c *WebHookColl) List() ([]*models.WebHook, error)

func (*WebHookColl) RemoveReference

func (c *WebHookColl) RemoveReference(owner, repo, address, ref string) (*models.WebHook, error)

RemoveReference removes a reference in the webhook record

func (*WebHookColl) Update

func (c *WebHookColl) Update(owner, repo, address, hookID string) error

Update update hookID

type WebHookUserColl

type WebHookUserColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWebHookUserColl

func NewWebHookUserColl() *WebHookUserColl

func (*WebHookUserColl) Create

func (c *WebHookUserColl) Create(args *models.WebHookUser) error

func (*WebHookUserColl) EnsureIndex

func (c *WebHookUserColl) EnsureIndex(ctx context.Context) error

func (*WebHookUserColl) FindWebHookUserCount

func (c *WebHookUserColl) FindWebHookUserCount() (int, error)

func (*WebHookUserColl) GetCollectionName

func (c *WebHookUserColl) GetCollectionName() string

func (*WebHookUserColl) List

func (c *WebHookUserColl) List() ([]*models.WebHookUser, error)

func (*WebHookUserColl) Upsert

func (c *WebHookUserColl) Upsert(args *models.WebHookUser) error

func (*WebHookUserColl) UserExists

func (c *WebHookUserColl) UserExists(args *WebHookUserOption) (int, error)

type WebHookUserOption

type WebHookUserOption struct {
	Email    string
	UserName string
}

type WorkFlowOptions

type WorkFlowOptions struct {
	ProjectName  string
	WorkflowName string
}

type WorkFlowTaskFilter

type WorkFlowTaskFilter struct {
	WorkflowName string   `json:"workflow_name"`
	ProjectName  string   `json:"project_name"`
	JobName      string   `json:"job_name"`
	StartTime    int64    `json:"start_time"`
	EndTime      int64    `json:"end_time"`
	Creator      []string `json:"creator"`
	Service      []string `json:"service"`
	Env          []string `json:"env"`
	Status       []string `json:"status"`
}

type WorkLoadsStatColl

type WorkLoadsStatColl struct {
	*mongo.Collection
	mongo.Session
	// contains filtered or unexported fields
}

func NewWorkLoadsStatColl

func NewWorkLoadsStatColl() *WorkLoadsStatColl

func NewWorkLoadsStatCollWithSession

func NewWorkLoadsStatCollWithSession(session mongo.Session) *WorkLoadsStatColl

func (*WorkLoadsStatColl) Create

func (c *WorkLoadsStatColl) Create(args *models.WorkloadStat) error

func (*WorkLoadsStatColl) EnsureIndex

func (c *WorkLoadsStatColl) EnsureIndex(ctx context.Context) error

func (*WorkLoadsStatColl) Find

func (c *WorkLoadsStatColl) Find(clusterID string, namespace string) (*models.WorkloadStat, error)

func (*WorkLoadsStatColl) FindByProductName

func (c *WorkLoadsStatColl) FindByProductName(productName string) ([]*models.WorkloadStat, error)

func (*WorkLoadsStatColl) GetCollectionName

func (c *WorkLoadsStatColl) GetCollectionName() string

func (*WorkLoadsStatColl) UpdateWorkloads

func (c *WorkLoadsStatColl) UpdateWorkloads(args *models.WorkloadStat) error

type Workflow

type Workflow struct {
	Name        string `json:"name"`
	ProjectName string `json:"projectName"`
}

type WorkflowColl

type WorkflowColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWorkflowColl

func NewWorkflowColl() *WorkflowColl

func (*WorkflowColl) BulkCreate

func (c *WorkflowColl) BulkCreate(args []*models.Workflow) error

func (*WorkflowColl) Count

func (c *WorkflowColl) Count() (int64, error)

func (*WorkflowColl) Create

func (c *WorkflowColl) Create(args *models.Workflow) error

func (*WorkflowColl) Delete

func (c *WorkflowColl) Delete(name string) error

func (*WorkflowColl) EnsureIndex

func (c *WorkflowColl) EnsureIndex(ctx context.Context) error

func (*WorkflowColl) Find

func (c *WorkflowColl) Find(name string) (*models.Workflow, error)

func (*WorkflowColl) GetCollectionName

func (c *WorkflowColl) GetCollectionName() string

func (*WorkflowColl) List

func (c *WorkflowColl) List(opt *ListWorkflowOption) ([]*models.Workflow, error)

func (*WorkflowColl) ListByCursor

func (c *WorkflowColl) ListByCursor(opt *ListWorkflowOption) (*mongo.Cursor, error)

func (*WorkflowColl) ListByTestName

func (c *WorkflowColl) ListByTestName(testName string) ([]*models.Workflow, error)

func (*WorkflowColl) ListByWorkflows

func (c *WorkflowColl) ListByWorkflows(opt ListWorkflowOpt) ([]*models.Workflow, error)

func (*WorkflowColl) ListWithScheduleEnabled

func (c *WorkflowColl) ListWithScheduleEnabled() ([]*models.Workflow, error)

func (*WorkflowColl) ListWorkflowsByProjects

func (c *WorkflowColl) ListWorkflowsByProjects(projects []string) ([]*models.Workflow, error)

func (*WorkflowColl) Replace

func (c *WorkflowColl) Replace(args *models.Workflow) error

type WorkflowQueueColl

type WorkflowQueueColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWorkflowQueueColl

func NewWorkflowQueueColl() *WorkflowQueueColl

func (*WorkflowQueueColl) Create

func (c *WorkflowQueueColl) Create(args *models.WorkflowQueue) error

func (*WorkflowQueueColl) Delete

func (c *WorkflowQueueColl) Delete(args *models.WorkflowQueue) error

func (*WorkflowQueueColl) EnsureIndex

func (c *WorkflowQueueColl) EnsureIndex(ctx context.Context) error

func (*WorkflowQueueColl) GetCollectionName

func (c *WorkflowQueueColl) GetCollectionName() string

func (*WorkflowQueueColl) List

func (*WorkflowQueueColl) Update

func (c *WorkflowQueueColl) Update(args *models.WorkflowQueue) error

type WorkflowStatArgs

type WorkflowStatArgs struct {
	Names []string
	Type  string
}

type WorkflowStatColl

type WorkflowStatColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWorkflowStatColl

func NewWorkflowStatColl() *WorkflowStatColl

func (*WorkflowStatColl) Create

func (c *WorkflowStatColl) Create(args *models.WorkflowStat) error

func (*WorkflowStatColl) Delete

func (c *WorkflowStatColl) Delete(name, workflowType string) error

func (*WorkflowStatColl) EnsureIndex

func (c *WorkflowStatColl) EnsureIndex(ctx context.Context) error

func (*WorkflowStatColl) FindWorkflowStat

func (c *WorkflowStatColl) FindWorkflowStat(args *WorkflowStatArgs) ([]*models.WorkflowStat, error)

func (*WorkflowStatColl) GetCollectionName

func (c *WorkflowStatColl) GetCollectionName() string

func (*WorkflowStatColl) Upsert

func (c *WorkflowStatColl) Upsert(args *models.WorkflowStat) error

type WorkflowTaskv4Coll

type WorkflowTaskv4Coll struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewworkflowTaskv4Coll

func NewworkflowTaskv4Coll() *WorkflowTaskv4Coll

func (*WorkflowTaskv4Coll) ArchiveHistoryWorkflowTask

func (c *WorkflowTaskv4Coll) ArchiveHistoryWorkflowTask(workflowName string, remain, remainDays int) error

func (*WorkflowTaskv4Coll) Create

func (c *WorkflowTaskv4Coll) Create(obj *models.WorkflowTask) (string, error)

func (*WorkflowTaskv4Coll) DeleteByWorkflowName

func (c *WorkflowTaskv4Coll) DeleteByWorkflowName(workflowName string) error

func (*WorkflowTaskv4Coll) EnsureIndex

func (c *WorkflowTaskv4Coll) EnsureIndex(ctx context.Context) error

func (*WorkflowTaskv4Coll) Find

func (c *WorkflowTaskv4Coll) Find(workflowName string, taskID int64) (*models.WorkflowTask, error)

func (*WorkflowTaskv4Coll) FindPreviousTask

func (c *WorkflowTaskv4Coll) FindPreviousTask(workflowName, username string) (*models.WorkflowTask, error)

func (*WorkflowTaskv4Coll) FindTodoTasksByWorkflowName

func (c *WorkflowTaskv4Coll) FindTodoTasksByWorkflowName(workflowName string) ([]*models.WorkflowTask, error)

func (*WorkflowTaskv4Coll) GetByID

func (c *WorkflowTaskv4Coll) GetByID(idstring string) (*models.WorkflowTask, error)

func (*WorkflowTaskv4Coll) GetCollectionName

func (c *WorkflowTaskv4Coll) GetCollectionName() string

func (*WorkflowTaskv4Coll) GetLatest

func (c *WorkflowTaskv4Coll) GetLatest(workflowName string) (*models.WorkflowTask, error)

func (*WorkflowTaskv4Coll) InCompletedTasks

func (c *WorkflowTaskv4Coll) InCompletedTasks() ([]*models.WorkflowTask, error)

func (*WorkflowTaskv4Coll) List

func (*WorkflowTaskv4Coll) ListByCursor

func (c *WorkflowTaskv4Coll) ListByCursor(opt *ListWorkflowTaskV4Option) (*mongo.Cursor, error)

func (*WorkflowTaskv4Coll) ListByFilter

func (c *WorkflowTaskv4Coll) ListByFilter(filter *WorkFlowTaskFilter, pageNum, pageSize int64) ([]*models.WorkflowTask, int64, error)

func (*WorkflowTaskv4Coll) ListCreator

func (c *WorkflowTaskv4Coll) ListCreator(projectName, name string) ([]string, error)

func (*WorkflowTaskv4Coll) Update

func (c *WorkflowTaskv4Coll) Update(idString string, obj *models.WorkflowTask) error

type WorkflowTemplateListOption

type WorkflowTemplateListOption struct {
	CreatedBy      string
	Category       string
	ExcludeBuildIn bool
}

type WorkflowTemplateQueryOption

type WorkflowTemplateQueryOption struct {
	ID   string
	Name string
}

type WorkflowV3Coll

type WorkflowV3Coll struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWorkflowV3Coll

func NewWorkflowV3Coll() *WorkflowV3Coll

func (*WorkflowV3Coll) Create

func (c *WorkflowV3Coll) Create(obj *models.WorkflowV3) (string, error)

func (*WorkflowV3Coll) DeleteByID

func (c *WorkflowV3Coll) DeleteByID(idString string) error

func (*WorkflowV3Coll) EnsureIndex

func (c *WorkflowV3Coll) EnsureIndex(ctx context.Context) error

func (*WorkflowV3Coll) Find

func (c *WorkflowV3Coll) Find(name string) (*models.WorkflowV3, error)

func (*WorkflowV3Coll) GetByID

func (c *WorkflowV3Coll) GetByID(idstring string) (*models.WorkflowV3, error)

func (*WorkflowV3Coll) GetCollectionName

func (c *WorkflowV3Coll) GetCollectionName() string

func (*WorkflowV3Coll) List

func (c *WorkflowV3Coll) List(opt *ListWorkflowV3Option, pageNum, pageSize int64) ([]*models.WorkflowV3, int64, error)

func (*WorkflowV3Coll) Update

func (c *WorkflowV3Coll) Update(idString string, obj *models.WorkflowV3) error

type WorkflowV4

type WorkflowV4 struct {
	Name        string `json:"name"`
	ProjectName string `json:"projectName"`
}

type WorkflowV4Coll

type WorkflowV4Coll struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWorkflowV4Coll

func NewWorkflowV4Coll() *WorkflowV4Coll

func (*WorkflowV4Coll) BulkCreate

func (c *WorkflowV4Coll) BulkCreate(args []*models.WorkflowV4) error

func (*WorkflowV4Coll) Count

func (c *WorkflowV4Coll) Count() (int64, error)

func (*WorkflowV4Coll) Create

func (c *WorkflowV4Coll) Create(obj *models.WorkflowV4) (string, error)

func (*WorkflowV4Coll) DeleteByID

func (c *WorkflowV4Coll) DeleteByID(idString string) error

func (*WorkflowV4Coll) EnsureIndex

func (c *WorkflowV4Coll) EnsureIndex(ctx context.Context) error

func (*WorkflowV4Coll) Find

func (c *WorkflowV4Coll) Find(name string) (*models.WorkflowV4, error)

func (*WorkflowV4Coll) FindByOptions

func (c *WorkflowV4Coll) FindByOptions(opts WorkFlowOptions) (*models.WorkflowV4, error)

func (*WorkflowV4Coll) GetByID

func (c *WorkflowV4Coll) GetByID(idstring string) (*models.WorkflowV4, error)

func (*WorkflowV4Coll) GetCollectionName

func (c *WorkflowV4Coll) GetCollectionName() string

func (*WorkflowV4Coll) GetJobNameList

func (c *WorkflowV4Coll) GetJobNameList(projectName, workflowName, jobType string) ([]string, error)

func (*WorkflowV4Coll) List

func (c *WorkflowV4Coll) List(opt *ListWorkflowV4Option, pageNum, pageSize int64) ([]*models.WorkflowV4, int64, error)

func (*WorkflowV4Coll) ListByCursor

func (c *WorkflowV4Coll) ListByCursor(opt *ListWorkflowV4Option) (*mongo.Cursor, error)

func (*WorkflowV4Coll) ListByProjectNames

func (c *WorkflowV4Coll) ListByProjectNames(projects []string) ([]*models.WorkflowV4, error)

func (*WorkflowV4Coll) ListByWorkflows

func (c *WorkflowV4Coll) ListByWorkflows(opt ListWorkflowV4Opt) ([]*models.WorkflowV4, error)

func (*WorkflowV4Coll) SetCustomFields

func (c *WorkflowV4Coll) SetCustomFields(opts SetCustomFieldsOptions, args *models.CustomField) error

func (*WorkflowV4Coll) Update

func (c *WorkflowV4Coll) Update(idString string, obj *models.WorkflowV4) error

type WorkflowV4TemplateColl

type WorkflowV4TemplateColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWorkflowV4TemplateColl

func NewWorkflowV4TemplateColl() *WorkflowV4TemplateColl

func (*WorkflowV4TemplateColl) Create

func (*WorkflowV4TemplateColl) DeleteByID

func (c *WorkflowV4TemplateColl) DeleteByID(idStr string) error

func (*WorkflowV4TemplateColl) DeleteInternalByName

func (c *WorkflowV4TemplateColl) DeleteInternalByName(name string) error

func (*WorkflowV4TemplateColl) EnsureIndex

func (c *WorkflowV4TemplateColl) EnsureIndex(ctx context.Context) error

func (*WorkflowV4TemplateColl) Find

func (*WorkflowV4TemplateColl) GetCollectionName

func (c *WorkflowV4TemplateColl) GetCollectionName() string

func (*WorkflowV4TemplateColl) List

func (*WorkflowV4TemplateColl) ListByCursor

func (*WorkflowV4TemplateColl) Update

func (*WorkflowV4TemplateColl) UpsertByName

func (c *WorkflowV4TemplateColl) UpsertByName(obj *models.WorkflowV4Template) error

type WorkflowViewColl

type WorkflowViewColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewWorkflowViewColl

func NewWorkflowViewColl() *WorkflowViewColl

func (*WorkflowViewColl) Create

func (c *WorkflowViewColl) Create(args *models.WorkflowView) error

func (*WorkflowViewColl) DeleteByID

func (c *WorkflowViewColl) DeleteByID(idString string) error

func (*WorkflowViewColl) EnsureIndex

func (c *WorkflowViewColl) EnsureIndex(ctx context.Context) error

func (*WorkflowViewColl) Find

func (c *WorkflowViewColl) Find(projectName, viewName string) (*models.WorkflowView, error)

func (*WorkflowViewColl) FindByID

func (c *WorkflowViewColl) FindByID(idString string) (*models.WorkflowView, error)

func (*WorkflowViewColl) GetCollectionName

func (c *WorkflowViewColl) GetCollectionName() string

func (*WorkflowViewColl) ListByProject

func (c *WorkflowViewColl) ListByProject(projectName string) ([]*models.WorkflowView, error)

func (*WorkflowViewColl) ListNamesByProject

func (c *WorkflowViewColl) ListNamesByProject(projectName string) ([]string, error)

func (*WorkflowViewColl) Update

func (c *WorkflowViewColl) Update(args *models.WorkflowView) error

type YamlTemplateColl

type YamlTemplateColl struct {
	*mongo.Collection
	// contains filtered or unexported fields
}

func NewYamlTemplateColl

func NewYamlTemplateColl() *YamlTemplateColl

func (*YamlTemplateColl) Create

func (c *YamlTemplateColl) Create(obj *models.YamlTemplate) error

func (*YamlTemplateColl) DeleteByID

func (c *YamlTemplateColl) DeleteByID(idstring string) error

func (*YamlTemplateColl) EnsureIndex

func (c *YamlTemplateColl) EnsureIndex(ctx context.Context) error

func (*YamlTemplateColl) GetById

func (c *YamlTemplateColl) GetById(idstring string) (*models.YamlTemplate, error)

func (*YamlTemplateColl) GetByName

func (c *YamlTemplateColl) GetByName(name string) (*models.YamlTemplate, error)

func (*YamlTemplateColl) GetCollectionName

func (c *YamlTemplateColl) GetCollectionName() string

func (*YamlTemplateColl) List

func (c *YamlTemplateColl) List(pageNum, pageSize int) ([]*models.YamlTemplate, int, error)

func (*YamlTemplateColl) Update

func (c *YamlTemplateColl) Update(idString string, obj *models.YamlTemplate) error

func (*YamlTemplateColl) UpdateVariable

func (c *YamlTemplateColl) UpdateVariable(idString string, variable string, serviceVariableKVs []*commontypes.ServiceVariableKV) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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