mongodb

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsErrNoDocuments added in v1.8.0

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) 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"`
}

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

func (c *BuildColl) GetCollectionName() string

func (*BuildColl) GetDockerfileTemplateReference added in v1.6.0

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

func (*BuildColl) List

func (c *BuildColl) List(opt *BuildListOption) ([]*models.Build, 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
}

type CallbackFindOption added in v1.8.0

type CallbackFindOption struct {
	TaskID       int64
	PipelineName string
	ProjectName  string
}

type CallbackRequestColl added in v1.8.0

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

func NewCallbackRequestColl added in v1.8.0

func NewCallbackRequestColl() *CallbackRequestColl

func (*CallbackRequestColl) Create added in v1.8.0

func (*CallbackRequestColl) EnsureIndex added in v1.8.0

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

func (*CallbackRequestColl) Find added in v1.8.0

func (*CallbackRequestColl) GetCollectionName added in v1.8.0

func (c *CallbackRequestColl) GetCollectionName() string

type ChartColl added in v1.8.0

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

func NewChartColl added in v1.8.0

func NewChartColl() *ChartColl

func (*ChartColl) Create added in v1.8.0

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

func (*ChartColl) Delete added in v1.8.0

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

func (*ChartColl) EnsureIndex added in v1.8.0

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

func (*ChartColl) Exist added in v1.8.0

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

func (*ChartColl) Get added in v1.8.0

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

func (*ChartColl) GetCollectionName added in v1.8.0

func (c *ChartColl) GetCollectionName() string

func (*ChartColl) List added in v1.8.0

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

func (*ChartColl) Update added in v1.8.0

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

type ClusterListOpts added in v1.7.1

type ClusterListOpts struct {
	IDs []string
}

type CountTaskOption

type CountTaskOption struct {
	PipelineNames []string
	Status        config.TaskStatus
	Type          config.PipelineType
}

type CounterColl

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

func NewCounterColl

func NewCounterColl() *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) SetToNumber

func (c *CounterColl) SetToNumber(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) 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

type CronjobDeleteOption

type CronjobDeleteOption struct {
	IDList     []string
	ParentName string
	ParentType 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"`
	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 added in v1.6.0

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 added in v1.8.0

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

func (*DeliveryVersionColl) UpdateTaskID added in v1.8.0

func (c *DeliveryVersionColl) UpdateTaskID(versionName, projectName 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) Upsert

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

type DockerfileTemplateColl added in v1.8.0

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

func NewDockerfileTemplateColl added in v1.8.0

func NewDockerfileTemplateColl() *DockerfileTemplateColl

func (*DockerfileTemplateColl) Create added in v1.8.0

func (*DockerfileTemplateColl) DeleteByID added in v1.8.0

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

func (*DockerfileTemplateColl) EnsureIndex added in v1.8.0

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

func (*DockerfileTemplateColl) GetById added in v1.8.0

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

func (*DockerfileTemplateColl) GetCollectionName added in v1.8.0

func (c *DockerfileTemplateColl) GetCollectionName() string

func (*DockerfileTemplateColl) List added in v1.8.0

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

func (*DockerfileTemplateColl) Update added in v1.8.0

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

type ExternalLinkColl added in v1.7.0

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

func NewExternalLinkColl added in v1.7.0

func NewExternalLinkColl() *ExternalLinkColl

func (*ExternalLinkColl) Create added in v1.7.0

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

func (*ExternalLinkColl) Delete added in v1.7.0

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

func (*ExternalLinkColl) EnsureIndex added in v1.7.0

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

func (*ExternalLinkColl) GetCollectionName added in v1.7.0

func (c *ExternalLinkColl) GetCollectionName() string

func (*ExternalLinkColl) List added in v1.7.0

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

func (*ExternalLinkColl) Update added in v1.7.0

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

type ExternalSystemColl added in v1.8.0

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

func NewExternalSystemColl added in v1.8.0

func NewExternalSystemColl() *ExternalSystemColl

func (*ExternalSystemColl) Create added in v1.8.0

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

func (*ExternalSystemColl) DeleteByID added in v1.8.0

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

func (*ExternalSystemColl) EnsureIndex added in v1.8.0

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

func (*ExternalSystemColl) GetByID added in v1.8.0

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

func (*ExternalSystemColl) GetCollectionName added in v1.8.0

func (c *ExternalSystemColl) GetCollectionName() string

func (*ExternalSystemColl) List added in v1.8.0

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

func (*ExternalSystemColl) Update added in v1.8.0

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) 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 FindPrivateKeyOption added in v1.4.0

type FindPrivateKeyOption struct {
	ID      string
	Address 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 added in v1.8.0

func (*HelmRepoColl) GetCollectionName

func (c *HelmRepoColl) GetCollectionName() string

func (*HelmRepoColl) List

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

func (*HelmRepoColl) Update

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

type HelmRepoFindOption added in v1.8.0

type HelmRepoFindOption struct {
	Id       string
	RepoName 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) GetCollectionName

func (c *JenkinsIntegrationColl) GetCollectionName() string

func (*JenkinsIntegrationColl) List

func (*JenkinsIntegrationColl) Update

type K8SClusterColl

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

func NewK8SClusterColl

func NewK8SClusterColl() *K8SClusterColl

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) 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 added in v1.7.1

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

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

type ListAllTaskOption

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

type ListCronjobParam

type ListCronjobParam struct {
	ParentName string
	ParentType string
}

type ListHostIPArgs added in v1.6.0

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

type ListQueueOption

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

type ListStatsOption

type ListStatsOption struct {
	ProductName string
	Event       string
	Limit       int
}

type ListTaskOption

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

type ListTestOption

type ListTestOption struct {
	ProductName  string
	TestType     string
	IsSort       bool
	BuildOS      string
	BasicImageID string
}

type ListWorkflowOption

type ListWorkflowOption struct {
	IsSort   bool
	Projects []string
}

type ListWorkflowV3Option added in v1.8.0

type ListWorkflowV3Option struct {
	ProjectName string
}

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

type PrivateKeyArgs struct {
	Name string
}

type PrivateKeyColl

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

func NewPrivateKeyColl

func NewPrivateKeyColl() *PrivateKeyColl

func (*PrivateKeyColl) Create

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

func (*PrivateKeyColl) Delete

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

func (*PrivateKeyColl) DeleteAll added in v1.6.0

func (c *PrivateKeyColl) DeleteAll() error

func (*PrivateKeyColl) DistinctLabels added in v1.6.0

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 added in v1.6.0

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

func (*PrivateKeyColl) Update

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

type ProductColl

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

func NewProductColl

func NewProductColl() *ProductColl

func (*ProductColl) Count added in v1.3.1

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

func (*ProductColl) FindEnv

func (c *ProductColl) FindEnv(opt *ProductEnvFindOptions) (*models.Product, error)

func (*ProductColl) GetCollectionName

func (c *ProductColl) GetCollectionName() string

func (*ProductColl) List

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

func (*ProductColl) ListProjectsInNames added in v1.7.0

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 added in v1.3.1

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

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

func (*ProductColl) UpdateGroup

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

func (*ProductColl) UpdateIsPublic

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

func (*ProductColl) UpdateProductRecycleDay

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

func (*ProductColl) UpdateRegistry added in v1.8.0

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

func (*ProductColl) UpdateRender added in v1.3.0

func (c *ProductColl) UpdateRender(envName, productName string, render *models.RenderInfo) error

func (*ProductColl) UpdateStatus

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

type ProductEnvFindOptions

type ProductEnvFindOptions struct {
	Name      string
	Namespace string
}

type ProductFindOptions

type ProductFindOptions struct {
	Name      string
	EnvName   string
	Namespace string
}

type ProductListOptions

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

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

type ProjectClusterRelationColl added in v1.8.0

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

func NewProjectClusterRelationColl added in v1.8.0

func NewProjectClusterRelationColl() *ProjectClusterRelationColl

func (*ProjectClusterRelationColl) Create added in v1.8.0

func (*ProjectClusterRelationColl) Delete added in v1.8.0

func (*ProjectClusterRelationColl) EnsureIndex added in v1.8.0

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

func (*ProjectClusterRelationColl) GetCollectionName added in v1.8.0

func (c *ProjectClusterRelationColl) GetCollectionName() string

func (*ProjectClusterRelationColl) List added in v1.8.0

type ProjectClusterRelationOption added in v1.8.0

type ProjectClusterRelationOption struct {
	ProjectName string
	ClusterID   string
}

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

func (r *RegistryNamespaceColl) GetCollectionName() string

func (*RegistryNamespaceColl) Update

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

func (c *RenderSetColl) Delete(productName string) error

Delete 根据项目名称删除renderset

func (*RenderSetColl) DeleteRenderSet added in v1.3.0

func (c *RenderSetColl) DeleteRenderSet(productName, name string, revision int64) error

Delete renderSet According to productName、name and revision

func (*RenderSetColl) EnsureIndex

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

func (*RenderSetColl) Find

func (*RenderSetColl) FindRenderSet

func (c *RenderSetColl) FindRenderSet(opt *RenderSetFindOption) (*models.RenderSet, bool, error)

func (*RenderSetColl) GetCollectionName

func (c *RenderSetColl) GetCollectionName() string

func (*RenderSetColl) List

func (*RenderSetColl) ListAllRenders

func (c *RenderSetColl) ListAllRenders() ([]*models.RenderSet, error)

func (*RenderSetColl) ListRendersets added in v1.8.0

func (c *RenderSetColl) ListRendersets(opt *RenderSetListOption) ([]*models.RenderSet, error)

func (*RenderSetColl) SetDefault

func (c *RenderSetColl) SetDefault(renderTmplName, productTmplName string) error

func (*RenderSetColl) Update

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

type RenderSetFindOption

type RenderSetFindOption struct {
	// if Revision == 0 then search max revision of RenderSet
	Revision int64
	Name     string
}

RenderSetFindOption ...

type RenderSetListOption

type RenderSetListOption struct {
	// if Revision == 0 then search max revision of RenderSet
	ProductTmpl   string
	Revisions     []int64
	RendersetName string
}

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

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

func NewServiceColl

func NewServiceColl() *ServiceColl

func (*ServiceColl) BatchUpdateExternalServicesStatus added in v1.6.0

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

func (*ServiceColl) Count added in v1.3.1

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

func (c *ServiceColl) GetCollectionName() string

func (*ServiceColl) GetTemplateReference added in v1.6.0

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

func (*ServiceColl) ListAllRevisions

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

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

func (*ServiceColl) ListExternalWorkloadsBy added in v1.5.0

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

ListExternalServicesBy 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) ListMaxRevisionsByProduct added in v1.3.0

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

func (*ServiceColl) ListMaxRevisionsForServices

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

func (*ServiceColl) Update

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

func (*ServiceColl) UpdateExternalServiceEnvName added in v1.7.0

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

UpdateExternalServiceEnvName only used by external services

func (*ServiceColl) UpdateExternalServicesStatus added in v1.5.0

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

UpdateExternalServicesStatus only used by external services

func (*ServiceColl) UpdateServiceHealthCheckStatus added in v1.8.0

func (c *ServiceColl) UpdateServiceHealthCheckStatus(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
}

type ServiceListOption

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

type ServicesInExternalEnvArgs added in v1.6.0

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

type ServicesInExternalEnvColl added in v1.6.0

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

func NewServicesInExternalEnvColl added in v1.6.0

func NewServicesInExternalEnvColl() *ServicesInExternalEnvColl

func (*ServicesInExternalEnvColl) Create added in v1.6.0

Create ...

func (*ServicesInExternalEnvColl) Delete added in v1.6.0

func (*ServicesInExternalEnvColl) EnsureIndex added in v1.6.0

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

func (*ServicesInExternalEnvColl) GetCollectionName added in v1.6.0

func (c *ServicesInExternalEnvColl) GetCollectionName() string

func (*ServicesInExternalEnvColl) List added in v1.6.0

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 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 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) 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) ListRecentTasks added in v1.7.1

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 added in v1.7.1

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"`
	// 服务名称,用于任务列表的展示
	BuildServices []string          `bson:"-"                     json:"build_services"`
	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) 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 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 added in v1.3.0

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 added in v1.7.0

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 added in v1.3.0

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 WorkLoadsStatColl added in v1.5.0

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

func NewWorkLoadsStatColl added in v1.5.0

func NewWorkLoadsStatColl() *WorkLoadsStatColl

func (*WorkLoadsStatColl) Create added in v1.5.0

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

func (*WorkLoadsStatColl) EnsureIndex added in v1.5.0

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

func (*WorkLoadsStatColl) Find added in v1.5.0

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

func (*WorkLoadsStatColl) FindByProductName added in v1.5.0

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

func (*WorkLoadsStatColl) GetCollectionName added in v1.5.0

func (c *WorkLoadsStatColl) GetCollectionName() string

func (*WorkLoadsStatColl) UpdateWorkloads added in v1.5.0

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

type WorkflowColl

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

func NewWorkflowColl

func NewWorkflowColl() *WorkflowColl

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

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

func (*WorkflowColl) ListWithScheduleEnabled

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

func (*WorkflowColl) ListWorkflowsByProjects added in v1.7.0

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

func (*WorkflowColl) Replace

func (c *WorkflowColl) Replace(args *models.Workflow) 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 WorkflowV3Coll added in v1.8.0

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

func NewWorkflowV3Coll added in v1.8.0

func NewWorkflowV3Coll() *WorkflowV3Coll

func (*WorkflowV3Coll) Create added in v1.8.0

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

func (*WorkflowV3Coll) DeleteByID added in v1.8.0

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

func (*WorkflowV3Coll) EnsureIndex added in v1.8.0

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

func (*WorkflowV3Coll) Find added in v1.8.0

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

func (*WorkflowV3Coll) GetByID added in v1.8.0

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

func (*WorkflowV3Coll) GetCollectionName added in v1.8.0

func (c *WorkflowV3Coll) GetCollectionName() string

func (*WorkflowV3Coll) List added in v1.8.0

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

func (*WorkflowV3Coll) Update added in v1.8.0

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

type YamlTemplateColl added in v1.6.0

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

func NewYamlTemplateColl added in v1.6.0

func NewYamlTemplateColl() *YamlTemplateColl

func (*YamlTemplateColl) Create added in v1.6.0

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

func (*YamlTemplateColl) DeleteByID added in v1.6.0

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

func (*YamlTemplateColl) EnsureIndex added in v1.6.0

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

func (*YamlTemplateColl) GetById added in v1.6.0

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

func (*YamlTemplateColl) GetCollectionName added in v1.6.0

func (c *YamlTemplateColl) GetCollectionName() string

func (*YamlTemplateColl) List added in v1.6.0

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

func (*YamlTemplateColl) Update added in v1.6.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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