template

package
v1.15.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductArgs added in v1.6.0

type ProductArgs struct {
	ProductName string     `json:"product_name"`
	Services    [][]string `json:"services"`
	UpdateBy    string     `json:"update_by"`
}

type ProductColl

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

func NewProductColl

func NewProductColl() *ProductColl

func (*ProductColl) AddService added in v1.5.0

func (c *ProductColl) AddService(productName, serviceName string) error

AddService adds a service to services[0] if it is not there.

func (*ProductColl) Count added in v1.9.0

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

func (*ProductColl) Create

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

func (*ProductColl) Delete

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

func (*ProductColl) EnsureIndex

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

func (*ProductColl) Find

func (c *ProductColl) Find(productName string) (*template.Product, error)

func (*ProductColl) FindProjectName

func (c *ProductColl) FindProjectName(project string) (*template.Product, error)

func (*ProductColl) GetCollectionName

func (c *ProductColl) GetCollectionName() string

func (*ProductColl) List

func (c *ProductColl) List() ([]*template.Product, error)

func (*ProductColl) ListNames added in v1.5.0

func (c *ProductColl) ListNames(inNames []string) ([]string, error)

func (*ProductColl) ListProjectBriefs added in v1.7.0

func (c *ProductColl) ListProjectBriefs(inNames []string) ([]*ProjectInfo, error)

func (*ProductColl) ListWithOption

func (c *ProductColl) ListWithOption(opt *ProductListOpt) ([]*template.Product, error)

ListWithOption ...

func (*ProductColl) Update

func (c *ProductColl) Update(productName string, args *template.Product) error

Update existing ProductTmpl

func (*ProductColl) UpdateAll added in v1.3.1

func (c *ProductColl) UpdateAll(projects []*template.Product) error

UpdateAll updates all projects in a bulk write. Currently, only field `shared_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) UpdateOnboardingStatus

func (c *ProductColl) UpdateOnboardingStatus(productName string, status int) error

func (*ProductColl) UpdateServiceOrchestration added in v1.7.0

func (c *ProductColl) UpdateServiceOrchestration(productName string, services [][]string, updateBy string) error

type ProductListOpt

type ProductListOpt struct {
	IsOpensource          string
	ContainSharedServices []*template.ServiceInfo
	BasicFacility         string
	DeployType            string
}

type ProjectInfo added in v1.7.0

type ProjectInfo struct {
	Name          string `bson:"product_name"`
	Alias         string `bson:"project_name"`
	Desc          string `bson:"description"`
	UpdatedAt     int64  `bson:"update_time"`
	UpdatedBy     string `bson:"update_by"`
	OnboardStatus int    `bson:"onboarding_status"`
	Public        bool   `bson:"public"`
	DeployType    string `bson:"deploy_type"`
	CreateEnvType string `bson:"create_env_type"`
	BasicFacility string `bson:"basic_facility"`
}

Jump to

Keyboard shortcuts

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