search

package
v0.0.0-...-09fc46a Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TERM_UNKNOWN uint8 = iota
	TERM_NAME
	TERM_ARCH
	TERM_VERSION
	TERM_RELEASE
	TERM_EPOCH
	TERM_PROVIDES
	TERM_REQUIRES
	TERM_RECOMMENDS
	TERM_CONFLICTS
	TERM_OBSOLETES
	TERM_ENHANCES
	TERM_SUGGESTS
	TERM_SUPPLEMENTS
	TERM_FILE
	TERM_SOURCE
	TERM_LICENSE
	TERM_VENDOR
	TERM_GROUP
	TERM_DATE_ADD
	TERM_DATE_BUILD
	TERM_BUILD_HOST
	TERM_SIZE
	TERM_PAYLOAD
)
View Source
const (
	DEP_FLAG_ANY DepFlag = 0
	DEP_FLAG_EQ          = 1 // =
	DEP_FLAG_LT          = 2 // <
	DEP_FLAG_LE          = 3 // <=
	DEP_FLAG_GT          = 4 // >
	DEP_FLAG_GE          = 5 // >=
)
View Source
const (
	TERM_MOD_NEGATIVE uint8 = 1 << iota
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DepFlag

type DepFlag uint8

DepFlag is dependency comparison flag

type Query

type Query []*Term

Query contains search terms

func (Query) Len

func (s Query) Len() int

func (Query) Less

func (s Query) Less(i, j int) bool

func (Query) Swap

func (s Query) Swap(i, j int)

func (Query) Terms

func (q Query) Terms() []*Term

Terms returns slice with terms sorted by their priority

func (Query) Validate

func (q Query) Validate() []error

Validate validate query terms

type Range

type Range struct {
	Start int64
	End   int64
}

Range contains range start and end

func (Range) String

func (r Range) String() string

String returns string representation of range

type Term

type Term struct {
	Value       interface{}
	Type        uint8
	Modificator uint8
	// contains filtered or unexported fields
}

Term is search term struct (part of search query)

func TermArch

func TermArch(value string, mods ...uint8) *Term

TermArch creates arch search term with given value and modificators

func TermBuildHost

func TermBuildHost(value string, mods ...uint8) *Term

TermBuildHost creates build host search term with given value and modificators

func TermConflicts

func TermConflicts(value data.Dependency, mods ...uint8) *Term

TermConflicts creates conflicts search term with given value and modificators

func TermDateAdd

func TermDateAdd(from, to int64, mods ...uint8) *Term

TermDateAdd creates add date search term with given value and modificators

func TermDateBuild

func TermDateBuild(from, to int64, mods ...uint8) *Term

TermDateBuild creates build date search term with given value and modificators

func TermEnhances

func TermEnhances(value data.Dependency, mods ...uint8) *Term

TermEnhances creates enhances search term with given value and modificators

func TermEpoch

func TermEpoch(value string, mods ...uint8) *Term

TermEpoch creates epoch search term with given value and modificators

func TermFile

func TermFile(value string, mods ...uint8) *Term

TermFiles creates payload search term with given value and modificators

func TermGroup

func TermGroup(value string, mods ...uint8) *Term

TermGroup creates group search term with given value and modificators

func TermLicense

func TermLicense(value string, mods ...uint8) *Term

TermLicense creates license search term with given value and modificators

func TermName

func TermName(value string, mods ...uint8) *Term

TermName creates name search term with given value and modificators

func TermObsoletes

func TermObsoletes(value data.Dependency, mods ...uint8) *Term

TermObsoletes creates obsoletes search term with given value and modificators

func TermPayload

func TermPayload(value string, mods ...uint8) *Term

TermPayload creates payload search term with given value and modificators

func TermProvides

func TermProvides(value data.Dependency, mods ...uint8) *Term

TermProvides creates provides search term with given value and modificators

func TermRecommends

func TermRecommends(value data.Dependency, mods ...uint8) *Term

TermRecommends creates recommends search term with given value and modificators

func TermRelease

func TermRelease(value string, mods ...uint8) *Term

TermRelease creates release search term with given value and modificators

func TermRequires

func TermRequires(value data.Dependency, mods ...uint8) *Term

TermRequires creates requires search term with given value and modificators

func TermSize

func TermSize(from, to int64, mods ...uint8) *Term

TermSize creates size search term with given value and modificators

func TermSource

func TermSource(value string, mods ...uint8) *Term

TermSource creates source search term with given value and modificators

func TermSuggests

func TermSuggests(value data.Dependency, mods ...uint8) *Term

TermSuggests creates suggests search term with given value and modificators

func TermSupplements

func TermSupplements(value data.Dependency, mods ...uint8) *Term

TermSupplements creates supplements search term with given value and modificators

func TermVendor

func TermVendor(value string, mods ...uint8) *Term

TermVendor creates vendor search term with given value and modificators

func TermVersion

func TermVersion(value string, mods ...uint8) *Term

TermVersion creates version search term with given value and modificators

func (*Term) IsNegative

func (t *Term) IsNegative() bool

IsNegative returns true if is negative search term

func (*Term) SQL

func (t *Term) SQL() (string, []string)

SQL returns target db and term as a slice with SQL queries

func (*Term) String

func (t *Term) String() string

String returns string representation of search term

Jump to

Keyboard shortcuts

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