Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrBadFormat = errors.New("bad format of filter (expected name=value)")
ErrBadFormat is an error returned when a filter is not in the form key=value
Functions ¶
Types ¶
type Args ¶
type Args struct {
// contains filtered or unexported fields
}
Args stores filter arguments as map key:{map key: bool}. It contains an aggregation of the map of arguments (which are in the form of -f 'key=value') based on the key, and stores values for the same key in a map with string keys and boolean values. e.g given -f 'label=label1=1' -f 'label=label2=2' -f 'image.name=ubuntu' the args will be {"image.name":{"ubuntu":true},"label":{"label1=1":true,"label2=2":true}}
func NewArgs ¶
func NewArgs(initialArgs ...KeyValuePair) Args
NewArgs returns a new Args populated with the initial args
func (Args) ExactMatch ¶
ExactMatch returns true if the source matches exactly one of the filters.
func (Args) MarshalJSON ¶
MarshalJSON returns a JSON byte representation of the Args
func (Args) UnmarshalJSON ¶
UnmarshalJSON populates the Args from JSON encode bytes
type KeyValuePair ¶
KeyValuePair is used to initialize a new Args
func Arg ¶
func Arg(key, value string) KeyValuePair
Arg creates a new KeyValuePair for initializing Args