database

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	SaveRule(context.Context, *Rule) error
	FindRuleById(context.Context, primitive.ObjectID) (*Rule, error)
	FindRulesByOwnerId(ctx context.Context, ownerType apiPb.ComponentOwnerType, ownerId primitive.ObjectID) ([]*Rule, error)
	RemoveRule(ctx context.Context, ruleId primitive.ObjectID) (*Rule, error)
	ActivateRule(ctx context.Context, ruleId primitive.ObjectID) (*Rule, error)
	DeactivateRule(ctx context.Context, ruleId primitive.ObjectID) (*Rule, error)
}

func New

func New(mongo mongo_helper.Connector) Database

type Rule

type Rule struct {
	Id        primitive.ObjectID       `bson:"_id"`
	Rule      string                   `bson:"rule,omitempty"`
	Name      string                   `bson:"name,omitempty"`
	AutoClose bool                     `bson:"autoClose"`
	OwnerType apiPb.ComponentOwnerType `bson:"ownerType"`
	OwnerId   primitive.ObjectID       `bson:"ownerId"`
	Status    apiPb.RuleStatus         `bson:"status"`
}

Jump to

Keyboard shortcuts

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