collections

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2017 License: Apache-2.0 Imports: 4 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ForEach

func ForEach(root map[string]interface{}, path string, fn func(obj map[string]interface{}) error) error

ForEach calls fn on each object in the root[path] array, where path is a dot separated string.

func GetMap

func GetMap(root map[string]interface{}, path string) (map[string]interface{}, error)

GetMap returns the map at root[path], where path is a dot separated string.

func GetSlice

func GetSlice(root map[string]interface{}, path string) ([]interface{}, error)

GetSlice returns the slice at root[path], where path is a dot separated string.

func GetString

func GetString(root map[string]interface{}, path string) (string, error)

GetString returns the string at root[path], where path is a dot separated string.

func GetValue

func GetValue(root map[string]interface{}, path string) (interface{}, error)

GetValue returns the object at root[path], where path is a dot separated string.

func ValidateIncludesExcludes

func ValidateIncludesExcludes(includesList, excludesList []string) []error

Types

type IncludesExcludes

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

IncludesExcludes is a type that manages lists of included and excluded items. The logic implemented is that everything in the included list except those items in the excluded list should be included. '*' in the includes list means "include everything", but it is not valid in the exclude list.

func NewIncludesExcludes

func NewIncludesExcludes() *IncludesExcludes

func (*IncludesExcludes) Excludes

func (ie *IncludesExcludes) Excludes(excludes ...string) *IncludesExcludes

Excludes adds items to the excludes list

func (*IncludesExcludes) GetExcludes

func (ie *IncludesExcludes) GetExcludes() []string

GetExcludes returns the items in the excludes list

func (*IncludesExcludes) GetIncludes

func (ie *IncludesExcludes) GetIncludes() []string

GetIncludes returns the items in the includes list

func (*IncludesExcludes) Includes

func (ie *IncludesExcludes) Includes(includes ...string) *IncludesExcludes

Includes adds items to the includes list. '*' is a wildcard value meaning "include everything".

func (*IncludesExcludes) ShouldInclude

func (ie *IncludesExcludes) ShouldInclude(s string) bool

ShouldInclude returns whether the specified item should be included or not. Everything in the includes list except those items in the excludes list should be included.

Jump to

Keyboard shortcuts

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