finder

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2017 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmptyList [][]byte = [][]byte{}

Functions

func GlobToRegexp

func GlobToRegexp(g string) string

func HasWildcard

func HasWildcard(target string) bool

func Leaf

func Leaf(value []byte) ([]byte, bool)

Leaf strips last dot and detect IsLeaf

func Q

func Q(v string) string

Q quotes string for clickhouse

func ReverseBytes added in v0.3.2

func ReverseBytes(target []byte) []byte

func ReverseString added in v0.3.2

func ReverseString(target string) string

Types

type BaseFinder

type BaseFinder struct {
	// contains filtered or unexported fields
}

func (*BaseFinder) Abs

func (b *BaseFinder) Abs(v []byte) []byte

func (*BaseFinder) Execute

func (b *BaseFinder) Execute(query string) (err error)

func (*BaseFinder) List

func (b *BaseFinder) List() [][]byte

func (*BaseFinder) Series

func (b *BaseFinder) Series() [][]byte

type BlacklistFinder added in v0.4.0

type BlacklistFinder struct {
	// contains filtered or unexported fields
}

func WrapBlacklist added in v0.4.0

func WrapBlacklist(f Finder, blacklist []*regexp.Regexp) *BlacklistFinder

func (*BlacklistFinder) Abs added in v0.4.0

func (p *BlacklistFinder) Abs(value []byte) []byte

func (*BlacklistFinder) Execute added in v0.4.0

func (p *BlacklistFinder) Execute(query string) error

func (*BlacklistFinder) List added in v0.4.0

func (p *BlacklistFinder) List() [][]byte

func (*BlacklistFinder) Series added in v0.4.0

func (p *BlacklistFinder) Series() [][]byte

For Render

type Finder

type Finder interface {
	Execute(query string) error
	List() [][]byte
	Series() [][]byte
	Abs([]byte) []byte
}

func New

func New(ctx context.Context, config *config.Config) Finder

func NewBase

func NewBase(ctx context.Context, url string, table string, timeout time.Duration) Finder

type MockFinder

type MockFinder struct {
	// contains filtered or unexported fields
}

func NewMockFinder

func NewMockFinder(result [][]byte) *MockFinder

func (*MockFinder) Abs

func (m *MockFinder) Abs(v []byte) []byte

func (*MockFinder) Execute

func (m *MockFinder) Execute(query string) error

func (*MockFinder) List

func (m *MockFinder) List() [][]byte

func (*MockFinder) Series

func (m *MockFinder) Series() [][]byte

type PrefixFinder

type PrefixFinder struct {
	// contains filtered or unexported fields
}

func WrapPrefix

func WrapPrefix(f Finder, prefix string) *PrefixFinder

func (*PrefixFinder) Abs

func (p *PrefixFinder) Abs(value []byte) []byte

func (*PrefixFinder) Execute

func (p *PrefixFinder) Execute(query string) error

func (*PrefixFinder) List

func (p *PrefixFinder) List() [][]byte

func (*PrefixFinder) Series

func (p *PrefixFinder) Series() [][]byte

For Render

type PrefixMatchResult

type PrefixMatchResult int
const (
	PrefixNotMatched PrefixMatchResult = iota
	PrefixMatched
	PrefixPartialMathed
)

type ReverseFinder added in v0.3.2

type ReverseFinder struct {
	// contains filtered or unexported fields
}

func WrapReverse added in v0.3.2

func WrapReverse(f Finder, ctx context.Context, url string, table string, timeout time.Duration) *ReverseFinder

func (*ReverseFinder) Abs added in v0.3.2

func (r *ReverseFinder) Abs(v []byte) []byte

func (*ReverseFinder) Execute added in v0.3.2

func (r *ReverseFinder) Execute(query string) error

func (*ReverseFinder) List added in v0.3.2

func (r *ReverseFinder) List() [][]byte

func (*ReverseFinder) Series added in v0.3.2

func (r *ReverseFinder) Series() [][]byte

type TagFinder

type TagFinder struct {
	// contains filtered or unexported fields
}

func WrapTag

func WrapTag(f Finder, ctx context.Context, url string, table string, timeout time.Duration) *TagFinder

func (*TagFinder) Abs

func (t *TagFinder) Abs(v []byte) []byte

func (*TagFinder) Execute

func (t *TagFinder) Execute(query string) error

func (*TagFinder) List

func (t *TagFinder) List() [][]byte

func (*TagFinder) MakeSQL

func (t *TagFinder) MakeSQL(query string) (string, error)

func (*TagFinder) Series

func (t *TagFinder) Series() [][]byte

type TagQ

type TagQ struct {
	Param *string
	Value *string
}

func (TagQ) String

func (q TagQ) String() string

func (*TagQ) Where

func (q *TagQ) Where(field string) string

type TagState

type TagState int
const (
	TagRoot     TagState = iota // query = "*"
	TagSkip                     // not _tag prefix
	TagInfoRoot                 // query = "_tag"
	TagList
	TagListSeriesRoot
	TagListSeries
	TagListParam
)

type Where

type Where struct {
	// contains filtered or unexported fields
}

func NewWhere

func NewWhere() *Where

func (*Where) And

func (w *Where) And(exp string)

func (*Where) Andf

func (w *Where) Andf(format string, obj ...interface{})

func (*Where) String

func (w *Where) String() string

Jump to

Keyboard shortcuts

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