selector

package
v0.0.0-...-5000e08 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ByFilter

type ByFilter struct {
	Func func(Instance) (bool, error)
}

func NewByNames

func NewByNames(names []string, f func(Instance) string) ByFilter

func (ByFilter) Select

func (s ByFilter) Select(instances []Instance) ([]Instance, error)

type Generic

type Generic struct {
	Names []string
	Limit Limit
	Func  func(Instance) string
}

func (Generic) Select

func (g Generic) Select(instances []Instance) ([]Instance, error)

type GroupBy

type GroupBy struct {
	Func func(Instance) string
}

func (GroupBy) Groups

func (g GroupBy) Groups(instances []Instance) []string

type IDRequest

type IDRequest struct {
	Values []string `json:",omitempty"`
	Limit  Limit    `json:",omitempty"`
}

type Instance

type Instance interface {
	ID() string
	Group() string
	Deployment() string
	AZ() string
	HasVM() bool
}

type Limit

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

func MustNewLimitFromString

func MustNewLimitFromString(s string) Limit

func NewLimit

func NewLimit(start, end int, percent bool) (Limit, error)

func NewLimitFromString

func NewLimitFromString(s string) (Limit, error)

func (Limit) Limit

func (l Limit) Limit(in []string) ([]string, error)

func (*Limit) MarshalJSON

func (l *Limit) MarshalJSON() ([]byte, error)

func (Limit) String

func (l Limit) String() string

func (*Limit) UnmarshalJSON

func (l *Limit) UnmarshalJSON(s []byte) error

type Limitor

type Limitor interface {
	Limit([]string) ([]string, error)
}

type Multiple

type Multiple struct {
	Selectors []Selector
}

func (Multiple) Select

func (m Multiple) Select(instances []Instance) ([]Instance, error)

type NameRequest

type NameRequest struct {
	Name  string
	Limit Limit `json:",omitempty"`
}

type Request

type Request struct {
	IncludeMissing bool `json:",omitempty"`

	AZ         *NameRequest `json:",omitempty"`
	Deployment *NameRequest `json:",omitempty"`
	Group      *NameRequest `json:",omitempty"`
	ID         *IDRequest   `json:",omitempty"`
}

func (Request) AsSelector

func (a Request) AsSelector() Selector

type Selector

type Selector interface {
	Select([]Instance) ([]Instance, error)
}

Jump to

Keyboard shortcuts

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