storage

package
v0.0.0-...-9f800d1 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(task models.Task) (int64, error)

func Count

func Count(filters []Filter) (int, error)

func Delete

func Delete(filters []Filter) ([]int, error)

func Edit

func Edit(filters []Filter, edits []QueryEdit) ([]int, error)

func GetDB

func GetDB() (*gorm.DB, error)

func ListProjects

func ListProjects() ([]models.Project, error)

func Migrate

func Migrate() error

func SaveIdMapping

func SaveIdMapping(storageType models.StorageType, idMap map[int]string) error

func WithFilters

func WithFilters(db *gorm.DB, filters []Filter) *gorm.DB

Types

type Filter

type Filter struct {
	Key      string
	Operator Operator
	Value    string
	IsRaw    bool
}

type ListTasksResult

type ListTasksResult struct {
	models.Task
	ProjectName string
}

func ListTasks

func ListTasks(filters []Filter) ([]ListTasksResult, error)

type Operator

type Operator string
const (
	Eq        Operator = "="
	Neq       Operator = "!="
	Gt        Operator = ">"
	Gte       Operator = ">="
	Lt        Operator = "<"
	Lte       Operator = "<="
	In        Operator = "in"
	Like      Operator = "like"
	NotLike   Operator = "not like"
	IsNull    Operator = "is null"
	IsNotNull Operator = "is not null"
)

type QueryEdit

type QueryEdit struct {
	Path  string
	Value string
}

Jump to

Keyboard shortcuts

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