loader

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: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetIndicesNum

func GetIndicesNum(indices *IndexGroup) (num int)

GetIndicesNum .

Types

type IndexEntry

type IndexEntry struct {
	Index       string    `json:"index"`
	DocsCount   int       `json:"docs_count"`
	DocsDeleted int       `json:"docs_deleted"`
	StoreBytes  int64     `json:"store_bytes"`
	StoreSize   string    `json:"store_size"`
	MinT        time.Time `json:"mint"`
	MaxT        time.Time `json:"maxt"`
	Keys        []string  `json:"keys"`
	Fixed       bool      `json:"fixed"`
	Num         int64     `json:"num"`
	Active      bool      `json:"active"`
}

IndexEntry .

type IndexEntrys

type IndexEntrys []*IndexEntry

IndexEntrys .

func (IndexEntrys) Len

func (entrys IndexEntrys) Len() int

func (IndexEntrys) Less

func (entrys IndexEntrys) Less(i, j int) bool

func (IndexEntrys) Swap

func (entrys IndexEntrys) Swap(i, j int)

type IndexGroup

type IndexGroup struct {
	Groups map[string]*IndexGroup `json:"groups,omitempty"`
	List   []*IndexEntry          `json:"list,omitempty"`
	Fixed  []*IndexEntry          `json:"fixed,omitempty"`
}

IndexGroup .

type Interface

type Interface interface {
	WaitAndGetIndices(ctx context.Context) *IndexGroup
	AllIndices() *IndexGroup
	ReloadIndices() error
	WatchLoadEvent(func(*IndexGroup))

	Indices(ctx context.Context, start, end int64, path ...KeyPath) (list []string)
	Keys(path ...string) []string
	IndexGroup(path ...string) *IndexGroup

	Prefixes() []string
	Match(index string) *index.MatchResult

	RequestTimeout() time.Duration
	QueryIndexTimeRange() bool
	Client() *elastic.Client
	URLs() string
	LoadMode() LoadMode
}

Interface .

func Find

func Find(ctx servicehub.Context, log logs.Logger, required bool) (Interface, error)

Find .

type KeyPath

type KeyPath struct {
	Keys      []string
	Recursive bool
}

KeyPath .

type LoadMode

type LoadMode string

LoadMode .

const (
	LoadFromElasticSearchOnly LoadMode = "LoadFromElasticSearchOnly"
	LoadFromCacheOnly         LoadMode = "LoadFromCacheOnly"
	LoadWithCache             LoadMode = "LoadWithCache"
)

LoadMode values

type Matcher

type Matcher func(index *IndexEntry) bool

Matcher .

Jump to

Keyboard shortcuts

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