index

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// IndexVarNone .
	IndexVarNone = ""
	// IndexVarNumber .
	IndexVarNumber = "number"
	// IndexVarTimestamp .
	IndexVarTimestamp = "timestamp"
)
View Source
const InvalidPatternValueChars = "-."

InvalidPatternValueChars

Variables

View Source
var ErrKeyLength = errors.New("invalid keys length")

ErrKeyLength .

View Source
var ErrVarLength = errors.New("invalid vars length")

ErrVarLength

Functions

func FindElasticSearch

func FindElasticSearch(ctx servicehub.Context, required bool) (elasticsearch.Interface, error)

FindElasticSearch .

func FindElection

func FindElection(ctx servicehub.Context, required bool) (election.Interface, error)

FindElection .

func FindService

func FindService(ctx servicehub.Context, service string) (interface{}, string)

FindService .

func NormalizeKey

func NormalizeKey(s string) string

NormalizeKey .

Types

type MatchResult

type MatchResult struct {
	Pattern *Pattern
	Keys    []string
	Vars    []string
}

MatchResult .

type Pattern

type Pattern struct {
	Pattern  string
	Segments []*PatternSegment
	Keys     []string
	KeyNum   int
	Vars     []string
	VarNum   int
}

Pattern

func BuildPattern

func BuildPattern(ptn string) (p *Pattern, err error)

BuildPattern .

func (*Pattern) CheckVars

func (p *Pattern) CheckVars() error

CheckVars .

func (*Pattern) Fill

func (p *Pattern) Fill(keys ...string) (string, error)

Fill .

func (*Pattern) Match

func (p *Pattern) Match(text, invalidChars string) (*MatchResult, bool)

Match .

func (*Pattern) String

func (p *Pattern) String() string

String .

type PatternSegment

type PatternSegment struct {
	Type PatternSegmentType
	Name string
}

PatternSegment .

func (*PatternSegment) String

func (s *PatternSegment) String() string

String .

type PatternSegmentType

type PatternSegmentType uint8

PatternSegmentType .

const (
	PatternSegmentStatic PatternSegmentType = iota
	PatternSegmentKey
	PatternSegmentVar
)

PatternSegmentType values

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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