featuregroup

package
v0.0.0-...-0cfb223 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const Collection = "featureGroups"

Collection indicates the MongoDB feature group collection

Variables

This section is empty.

Functions

func Create

func Create(ft *Group) error

Create creates a new entity

func GetAll

func GetAll(loc string, opts *Options) (*model.Result, error)

GetAll returns a result based on filters

func GetByTags

func GetByTags(tags []string, loc string, opts *Options) (*model.Result, error)

GetByTags returns a result based on tag

func GetByText

func GetByText(q, loc string, opts *Options) (*model.Result, error)

GetByText returns a result based on given keyword

func Remove

func Remove(id string) error

Remove removes an entity

func Replace

func Replace(id string, fg *Group) error

Replace replaces the data of an existing entity

Types

type Group

type Group struct {
	ID          objectID  `json:"_id" bson:"_id"`
	Name        string    `json:"name" bson:"name"`
	Description string    `json:"description" bson:"description"`
	Tags        []string  `json:"tags" bson:"tags"`
	Location    objectID  `json:"_location" bson:"_location"`
	Modified    timestamp `json:"_modified" bson:"_modified"`
}

Group describes the entity of a feature group

func GetByID

func GetByID(id, loc string) (*Group, error)

GetByID returns the entity of the given ID

func (Group) Validate

func (g Group) Validate() error

Validate validates the fields of a feature group

type Options

type Options struct {
	Sort   bson.D
	Limit  int64
	Offset int64
}

Options represents the options for a database operation

Jump to

Keyboard shortcuts

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