mongodb

package
v1.18.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 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 Label

type Label struct {
	Key         string               `json:"key"`
	Value       string               `json:"value"`
	Type        setting.ResourceType `json:"type"`
	ProjectName string               `json:"project_name"`
}

type LabelBinding

type LabelBinding struct {
	Resource   Resource `json:"resource" bson:"resource"`
	LabelID    string   `json:"label_id" bson:"label_id"`
	CreateBy   string   `json:"create_by" bson:"create_by"`
	CreateTime int64    `json:"create_time" bson:"create_time"`
}

type LabelBindingColl

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

func NewLabelBindingColl

func NewLabelBindingColl() *LabelBindingColl

func (*LabelBindingColl) BulkDelete

func (c *LabelBindingColl) BulkDelete(labelBindings []*LabelBinding) error

func (*LabelBindingColl) BulkDeleteByIds

func (c *LabelBindingColl) BulkDeleteByIds(ids []string) error

func (*LabelBindingColl) BulkDeleteByLabelIds

func (c *LabelBindingColl) BulkDeleteByLabelIds(labelIds []string) error

func (*LabelBindingColl) BulkDeleteByProject

func (c *LabelBindingColl) BulkDeleteByProject(projectName string) error

func (*LabelBindingColl) CreateMany

func (c *LabelBindingColl) CreateMany(labelBindings []*LabelBinding) error

func (*LabelBindingColl) EnsureIndex

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

func (*LabelBindingColl) FindByOpt

func (*LabelBindingColl) GetCollectionName

func (c *LabelBindingColl) GetCollectionName() string

func (*LabelBindingColl) ListByOpt

func (*LabelBindingColl) ListByResources

type LabelBindingCollFindOpt

type LabelBindingCollFindOpt struct {
	LabelID      string
	LabelIDs     []string
	ResourceID   string
	ResourcesIDs []string
	ResourceType string
}

type LabelColl

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

func NewLabelColl

func NewLabelColl() *LabelColl

func (*LabelColl) BulkCreate

func (c *LabelColl) BulkCreate(labels []*models.Label) error

func (*LabelColl) BulkDelete

func (c *LabelColl) BulkDelete(ids []string) error

func (*LabelColl) BulkDeleteByProject

func (c *LabelColl) BulkDeleteByProject(projectName string) error

func (*LabelColl) Delete

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

func (*LabelColl) EnsureIndex

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

func (*LabelColl) Find

func (c *LabelColl) Find(id string) (*models.Label, error)

func (*LabelColl) GetCollectionName

func (c *LabelColl) GetCollectionName() string

func (*LabelColl) List

func (c *LabelColl) List(opt ListLabelOpt) ([]*models.Label, error)

func (*LabelColl) ListByIDs

func (c *LabelColl) ListByIDs(ids []string) ([]*models.Label, error)

func (*LabelColl) ListByProjectName

func (c *LabelColl) ListByProjectName(projectName string) ([]*models.Label, error)

type ListLabelBindingsByResources

type ListLabelBindingsByResources struct {
	Resources []Resource
}

type ListLabelOpt

type ListLabelOpt struct {
	Labels []Label
}

type Resource

type Resource struct {
	Name        string `json:"name"`
	ProjectName string `json:"project_name"`
	Type        string `json:"type"`
}

Jump to

Keyboard shortcuts

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