Documentation ¶
Index ¶
- type ProductColl
- func (c *ProductColl) Create(args *template.Product) error
- func (c *ProductColl) Delete(productName string) error
- func (c *ProductColl) EnsureIndex(ctx context.Context) error
- func (c *ProductColl) Find(productName string) (*template.Product, error)
- func (c *ProductColl) FindProjectName(project string) (*template.Product, error)
- func (c *ProductColl) GetCollectionName() string
- func (c *ProductColl) List() ([]*template.Product, error)
- func (c *ProductColl) ListWithOption(opt *ProductListOpt) ([]*template.Product, error)
- func (c *ProductColl) Update(productName string, args *template.Product) error
- func (c *ProductColl) UpdateAll(projects []*template.Product) error
- func (c *ProductColl) UpdateOnboardingStatus(productName string, status int) error
- type ProductListOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProductColl ¶
type ProductColl struct { *mongo.Collection // contains filtered or unexported fields }
func NewProductColl ¶
func NewProductColl() *ProductColl
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) 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
type ProductListOpt ¶
Click to show internal directories.
Click to hide internal directories.