mongo

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyDatabase   = errors.New("mongo database name must not be empty")
	ErrMissingPassword = errors.New("mongo password must not be empty when a mongo user is set")
)
View Source
var CreateCollections = []func(db *Mongo) error{}

Functions

This section is empty.

Types

type Mongo

type Mongo struct {
	// contains filtered or unexported fields
}

func New

func New(perm permV2Client.Client, conf config.Config, ctx context.Context, wg *sync.WaitGroup) (*Mongo, error)

func (*Mongo) AdminListInstances added in v0.0.15

func (this *Mongo) AdminListInstances(ctx context.Context, limit int64, offset int64, sort string, asc bool, search string, includeGenerated bool) (result []model.Instance, err error)

func (*Mongo) CountInstances

func (this *Mongo) CountInstances(ctx context.Context, jwt jwt.Token, search string, includeGenerated bool) (int64, error)

func (*Mongo) CreateId

func (this *Mongo) CreateId() string

func (*Mongo) CreateInstance added in v0.0.15

func (this *Mongo) CreateInstance(ctx context.Context, instance model.Instance, jwt jwt.Token) error

func (*Mongo) Disconnect

func (this *Mongo) Disconnect()

func (*Mongo) GetInstance

func (this *Mongo) GetInstance(ctx context.Context, id string, jwt jwt.Token) (instance model.Instance, exists bool, err error)

func (*Mongo) ImportTypeUsage added in v0.4.0

func (this *Mongo) ImportTypeUsage(ctx context.Context, jwt jwt.Token, importTypeId string) (usage model.ImportTypeUsage, err error)

ImportTypeUsage counts the instances of an import type over all users. The list is cut down to the instances the caller may read, by the same permission check ListInstances uses.

func (*Mongo) ListInstances

func (this *Mongo) ListInstances(ctx context.Context, limit int64, offset int64, sort string, jwt jwt.Token, asc bool, search string, includeGenerated bool, requestedIds []string) (result []model.Instance, err error)

func (*Mongo) RemoveInstance

func (this *Mongo) RemoveInstance(ctx context.Context, id string, jwt jwt.Token) error

func (*Mongo) SetInstance

func (this *Mongo) SetInstance(ctx context.Context, instance model.Instance, jwt jwt.Token) error

func (*Mongo) Transaction

func (this *Mongo) Transaction(ctx context.Context) (resultCtx context.Context, close func(success bool) error, err error)

Jump to

Keyboard shortcuts

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