Documentation ¶
Index ¶
- Constants
- Variables
- func CreateID(t time.Time, count uint32) string
- func ErrBadArguments(msg string) error
- func GenerateID() string
- func TimeFromID(id string) time.Time
- type ContinuousQuery
- type Filter
- type MetaStore
- func (h *MetaStore) CreateCQ(query string, cq ContinuousQuery) (string, error)
- func (h *MetaStore) CreateQuery(q Query) (string, error)
- func (h *MetaStore) DeleteCQ(query, id string) error
- func (h *MetaStore) DeleteQuery(id string) error
- func (h *MetaStore) ForEach(cb func(id string, data Query))
- func (h *MetaStore) ListCQ(query string) ([]ContinuousQuery, error)
- func (h *MetaStore) ListQueries() []Query
- func (h *MetaStore) ListQueryIDs() ([]Query, error)
- func (h *MetaStore) Load() error
- func (h *MetaStore) ReadCQ(query, id string) (ContinuousQuery, error)
- func (h *MetaStore) ReadQuery(id string) (Query, error)
- func (h *MetaStore) UpdateCQ(query, id string, cq ContinuousQuery) error
- func (h *MetaStore) UpdateQuery(id string, q Query) error
- type Query
Constants ¶
View Source
const ( OpMatch = "Match" OpPhrase = "Phrase" // OpMultiPhrase = "MultiPhrase" OpPrefix = "Prefix" OpRegexp = "Regexp" OpTerm = "Term" OpWildcard = "Wildcard" OpDateRange = "DateRange" OpNumericRange = "NumericRange" OpQueryString = "QueryString" QueryObject = "query.json" )
一些常量
Variables ¶
View Source
var ( ErrRecordNotFound = errors.New("record isnot found") ErrNameIsExists = errors.New("query name is exists") )
一些常见错误
View Source
var OpList = []string{ OpMatch, OpPhrase, OpPrefix, OpRegexp, OpTerm, OpWildcard, OpDateRange, OpNumericRange, OpQueryString, }
OpList 一些过滤表达式的匹配操作
Functions ¶
func ErrBadArguments ¶
Types ¶
type ContinuousQuery ¶
type ContinuousQuery struct { Fields []string `json:"fields,omitempty"` GroupBy string `json:"groupBy,omitempty"` Targets []struct { Type string `json:"type"` Arguments []string `json:"arguments"` } `json:"targets,omitempty"` // cache for target callback Callback func(cq *ContinuousQuery, value interface{}) error `json:"-"` }
ContinuousQuery 一个持续查询对象
type Filter ¶
type Filter struct { Field string `json:"field,omitempty"` Op string `json:"op"` Values []string `json:"values"` }
Filter 过滤器
type MetaStore ¶
type MetaStore struct {
// contains filtered or unexported fields
}
MetaStore 对象
func NewMetaStore ¶
func (*MetaStore) CreateCQ ¶
func (h *MetaStore) CreateCQ(query string, cq ContinuousQuery) (string, error)
func (*MetaStore) DeleteQuery ¶
func (*MetaStore) ListQueries ¶
func (*MetaStore) ListQueryIDs ¶
type Query ¶
type Query struct { ID string `json:"id,omitempty"` Name string `json:"name"` Description string `json:"description,omitempty"` Filters []Filter `json:"filters,omitempty"` ContinuousQueries map[string]ContinuousQuery `json:"continuous_queries,omitempty"` Sort string `json:"sort,omitempty"` }
Query 一个查询对象
Click to show internal directories.
Click to hide internal directories.