Documentation
¶
Index ¶
- type DateTimeAfterValueChecker
- type DateTimeBeforeValueChecker
- type DateTimeEqualValueChecker
- type DateTimeInValueChecker
- type DateTimeProperty
- type DateTimePropertyFilterCondition
- type DateTimeValueChecker
- type Filter
- type FilterCondition
- type Item
- type ItemSorter
- type LessFunc
- type Model
- type NumberEqualValueChecker
- type NumberGreaterValueChecker
- type NumberInValueChecker
- type NumberLessValueChecker
- type NumberProperty
- type NumberPropertyFilterCondition
- type NumberValueChecker
- type Property
- type QueryCategory
- type QueryCategoryList
- func (ql *QueryCategoryList) CategoryFromId(id string) *QueryCategory
- func (ql *QueryCategoryList) CategoryFromLabel(label string) *QueryCategory
- func (ql *QueryCategoryList) ContainsID(id string) bool
- func (ql *QueryCategoryList) ContainsLabel(label string) bool
- func (ql *QueryCategoryList) IndexFromId(id string) int
- func (ql *QueryCategoryList) IndexFromLabel(label string) int
- type RecordParser
- type StringContainChecker
- type StringEqualValueChecker
- type StringInValueChecker
- type StringProperty
- type StringPropertyFilterCondition
- type StringValueChecker
- type TimeStringProperty
- type TimestampProperty
- type TokenRecordParser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DateTimeAfterValueChecker ¶
func (*DateTimeAfterValueChecker) CheckValue ¶
func (c *DateTimeAfterValueChecker) CheckValue(t time.Time) bool
type DateTimeBeforeValueChecker ¶
func (*DateTimeBeforeValueChecker) CheckValue ¶
func (c *DateTimeBeforeValueChecker) CheckValue(t time.Time) bool
type DateTimeEqualValueChecker ¶
func (*DateTimeEqualValueChecker) CheckValue ¶
func (c *DateTimeEqualValueChecker) CheckValue(t time.Time) bool
type DateTimeInValueChecker ¶
func (*DateTimeInValueChecker) CheckValue ¶
func (c *DateTimeInValueChecker) CheckValue(t time.Time) bool
type DateTimeProperty ¶
type DateTimeProperty struct {
Category QueryCategory
TimeFormat string
Value string
Text string
Data time.Time
}
func (*DateTimeProperty) PropertyID ¶
func (p *DateTimeProperty) PropertyID() string
func (*DateTimeProperty) SetCategory ¶
func (p *DateTimeProperty) SetCategory(category QueryCategory)
func (*DateTimeProperty) SetValue ¶
func (p *DateTimeProperty) SetValue(value string)
type DateTimePropertyFilterCondition ¶
type DateTimePropertyFilterCondition struct {
ID string
Checker DateTimeValueChecker
}
func (*DateTimePropertyFilterCondition) IsFit ¶
func (f *DateTimePropertyFilterCondition) IsFit(item *Item) bool
type DateTimeValueChecker ¶
type Filter ¶
type Filter struct {
Conditions []FilterCondition
}
type FilterCondition ¶
type ItemSorter ¶
type ItemSorter struct {
// contains filtered or unexported fields
}
func CreateSorter ¶
func CreateSorter(less ...LessFunc) *ItemSorter
func (*ItemSorter) Len ¶
func (sorter *ItemSorter) Len() int
func (*ItemSorter) Less ¶
func (sorter *ItemSorter) Less(i, j int) bool
func (*ItemSorter) Sort ¶
func (sorter *ItemSorter) Sort(items []Item)
func (*ItemSorter) Swap ¶
func (sorter *ItemSorter) Swap(i, j int)
type LessFunc ¶
func CreatePropertyLessFunc ¶
type Model ¶
type Model struct {
Items []Item
CategoryList QueryCategoryList
}
type NumberEqualValueChecker ¶
type NumberEqualValueChecker struct {
ExpectedValue float64
}
func (*NumberEqualValueChecker) CheckValue ¶
func (c *NumberEqualValueChecker) CheckValue(s float64) bool
type NumberGreaterValueChecker ¶
type NumberGreaterValueChecker struct {
ExpectedValue float64
}
func (*NumberGreaterValueChecker) CheckValue ¶
func (c *NumberGreaterValueChecker) CheckValue(s float64) bool
type NumberInValueChecker ¶
type NumberInValueChecker struct {
ExpectedValues []float64
}
func (*NumberInValueChecker) CheckValue ¶
func (c *NumberInValueChecker) CheckValue(s float64) bool
type NumberLessValueChecker ¶
type NumberLessValueChecker struct {
ExpectedValue float64
}
func (*NumberLessValueChecker) CheckValue ¶
func (c *NumberLessValueChecker) CheckValue(s float64) bool
type NumberProperty ¶
type NumberProperty struct {
Category QueryCategory
Value string
Text string
Data float64
}
func (*NumberProperty) PropertyID ¶
func (p *NumberProperty) PropertyID() string
func (*NumberProperty) SetCategory ¶
func (p *NumberProperty) SetCategory(category QueryCategory)
func (*NumberProperty) SetValue ¶
func (p *NumberProperty) SetValue(value string)
type NumberPropertyFilterCondition ¶
type NumberPropertyFilterCondition struct {
ID string
Checker NumberValueChecker
}
func (*NumberPropertyFilterCondition) IsFit ¶
func (f *NumberPropertyFilterCondition) IsFit(item *Item) bool
type NumberValueChecker ¶
type Property ¶
type Property interface {
SetValue(value string)
SetCategory(category QueryCategory)
PropertyID() string
}
func BuildProperty ¶
func BuildProperty(records []string, category QueryCategory) (Property, error)
type QueryCategory ¶
type QueryCategory struct {
ID string
DisplayName string
Label string
ParseRecord RecordParser
RecordParserClass string
RecordParserArguments []string
PropertyClass string
PropertyCreateArguments []string
}
func (*QueryCategory) Equal ¶
func (q1 *QueryCategory) Equal(q2 *QueryCategory) bool
type QueryCategoryList ¶
type QueryCategoryList struct {
CategoryList []*QueryCategory
}
func (*QueryCategoryList) CategoryFromId ¶
func (ql *QueryCategoryList) CategoryFromId(id string) *QueryCategory
func (*QueryCategoryList) CategoryFromLabel ¶
func (ql *QueryCategoryList) CategoryFromLabel(label string) *QueryCategory
func (*QueryCategoryList) ContainsID ¶
func (ql *QueryCategoryList) ContainsID(id string) bool
func (*QueryCategoryList) ContainsLabel ¶
func (ql *QueryCategoryList) ContainsLabel(label string) bool
func (*QueryCategoryList) IndexFromId ¶
func (ql *QueryCategoryList) IndexFromId(id string) int
func (*QueryCategoryList) IndexFromLabel ¶
func (ql *QueryCategoryList) IndexFromLabel(label string) int
type RecordParser ¶
type RecordParser interface {
SetArguments(arguments []string) error
Parse(records []string) string
}
func BuildRecordParser ¶
func BuildRecordParser(category *QueryCategory) (RecordParser, error)
type StringContainChecker ¶
type StringContainChecker struct {
ExpectedValue string
}
func (*StringContainChecker) CheckValue ¶
func (c *StringContainChecker) CheckValue(s string) bool
type StringEqualValueChecker ¶
type StringEqualValueChecker struct {
ExpectedValue string
}
func (*StringEqualValueChecker) CheckValue ¶
func (c *StringEqualValueChecker) CheckValue(s string) bool
type StringInValueChecker ¶
type StringInValueChecker struct {
ExpectedValues []string
}
func (*StringInValueChecker) CheckValue ¶
func (c *StringInValueChecker) CheckValue(s string) bool
type StringProperty ¶
type StringProperty struct {
Category QueryCategory
Value string
Text string
Data string
}
func (*StringProperty) PropertyID ¶
func (p *StringProperty) PropertyID() string
func (*StringProperty) SetCategory ¶
func (p *StringProperty) SetCategory(category QueryCategory)
func (*StringProperty) SetValue ¶
func (p *StringProperty) SetValue(value string)
type StringPropertyFilterCondition ¶
type StringPropertyFilterCondition struct {
ID string
Checker StringValueChecker
}
func (*StringPropertyFilterCondition) IsFit ¶
func (f *StringPropertyFilterCondition) IsFit(item *Item) bool
type StringValueChecker ¶
type TimeStringProperty ¶
type TimeStringProperty struct {
Category QueryCategory
TimeFormat string
Value string
Text string
Data time.Duration
}
func (*TimeStringProperty) PropertyID ¶
func (p *TimeStringProperty) PropertyID() string
func (*TimeStringProperty) SetCategory ¶
func (p *TimeStringProperty) SetCategory(category QueryCategory)
func (*TimeStringProperty) SetValue ¶
func (p *TimeStringProperty) SetValue(value string)
type TimestampProperty ¶
type TimestampProperty struct {
Category QueryCategory
Value string
Text string
Data time.Time
}
func (*TimestampProperty) PropertyID ¶
func (p *TimestampProperty) PropertyID() string
func (*TimestampProperty) SetCategory ¶
func (p *TimestampProperty) SetCategory(category QueryCategory)
func (*TimestampProperty) SetValue ¶
func (p *TimestampProperty) SetValue(value string)
type TokenRecordParser ¶
func (*TokenRecordParser) Parse ¶
func (p *TokenRecordParser) Parse(records []string) string
func (*TokenRecordParser) SetArguments ¶
func (p *TokenRecordParser) SetArguments(arguments []string) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.