Documentation
¶
Index ¶
- type FilterPreset
- type FilterStore
- func (s *FilterStore) Delete(name string) error
- func (s *FilterStore) Get(name string) (*FilterPreset, error)
- func (s *FilterStore) List() []*FilterPreset
- func (s *FilterStore) ListShortcuts() map[string]string
- func (s *FilterStore) Load() error
- func (s *FilterStore) Save(preset *FilterPreset) error
- type Parser
- type ScoreFilter
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilterPreset ¶
type FilterPreset struct {
// Name is the name of the preset
Name string `json:"name"`
// Description is a human-readable description
Description string `json:"description,omitempty"`
// Expression is the filter expression
Expression string `json:"expression"`
// Created is when the preset was created
Created time.Time `json:"created"`
// LastUsed is when the preset was last used
LastUsed time.Time `json:"last_used,omitempty"`
// UseCount is how many times the preset has been used
UseCount int `json:"use_count"`
// Parent is the name of the parent preset (for inheritance)
Parent string `json:"parent,omitempty"`
// Tags are optional tags for categorizing presets
Tags []string `json:"tags,omitempty"`
}
FilterPreset represents a saved filter preset
type FilterStore ¶
type FilterStore struct {
// contains filtered or unexported fields
}
FilterStore manages saved filter presets
func NewFilterStore ¶
func NewFilterStore(configManager *config.ConfigManager) (*FilterStore, error)
NewFilterStore creates a new filter store
func (*FilterStore) Delete ¶
func (s *FilterStore) Delete(name string) error
Delete deletes a filter preset
func (*FilterStore) Get ¶
func (s *FilterStore) Get(name string) (*FilterPreset, error)
Get gets a filter preset by name
func (*FilterStore) List ¶
func (s *FilterStore) List() []*FilterPreset
List lists all filter presets
func (*FilterStore) ListShortcuts ¶
func (s *FilterStore) ListShortcuts() map[string]string
ListShortcuts lists all shortcuts
func (*FilterStore) Save ¶
func (s *FilterStore) Save(preset *FilterPreset) error
Save saves a filter preset
type Parser ¶
type Parser struct {
// contains filtered or unexported fields
}
Parser parses filter expressions into Filter objects
type ScoreFilter ¶
type ScoreFilter struct {
// MinScore is the minimum score to match (inclusive)
MinScore int
// MaxScore is the maximum score to match (inclusive)
MaxScore int
// Scorer is the scorer to use
Scorer *scoring.Scorer
// Scores is a cache of notification scores
Scores map[string]*scoring.NotificationScore
}
ScoreFilter filters notifications by score
func NewScoreFilter ¶
func NewScoreFilter(minScore, maxScore int, scorer *scoring.Scorer) *ScoreFilter
NewScoreFilter creates a new score filter
func (*ScoreFilter) Apply ¶
func (f *ScoreFilter) Apply(n *github.Notification) bool
Apply applies the score filter to a notification
func (*ScoreFilter) Description ¶
func (f *ScoreFilter) Description() string
Description returns a human-readable description of the filter
func (*ScoreFilter) GetScores ¶
func (f *ScoreFilter) GetScores() map[string]*scoring.NotificationScore
GetScores gets the scores for notifications
func (*ScoreFilter) SetScores ¶
func (f *ScoreFilter) SetScores(scores map[string]*scoring.NotificationScore)
SetScores sets the scores for notifications
Click to show internal directories.
Click to hide internal directories.