selector

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filter

type Filter interface {
	Do([]registry.Node) []registry.Node
}

type Next

type Next func() (registry.Node, error)

return addr, error

type Option

type Option func(*Options)

func Filters

func Filters(f ...Filter) Option

func Getter

func Getter(r registry.Getter) Option

func Strategies

func Strategies(s ...Strategy) Option

type Options

type Options struct {
	Getter     registry.Getter
	Filters    []Filter
	Strategies []Strategy
	// contains filtered or unexported fields
}

type Selector

type Selector interface {
	Init(...Option)
	Options() Options
	Select(string) (Next, error)
	SelectA(string) (registry.Node, error)

	// Mark a node error/success
	Mark(registry.Node, error)
	String() string
}

type Strategy

type Strategy interface {
	Do(string, []registry.Node) Next
	DoA(string, []registry.Node) registry.Node
}

Jump to

Keyboard shortcuts

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