utils

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(env string, defaultValue string) string

GetEnv returns the value fo env if not found reutrns defaultValue

Types

type StringSet

type StringSet map[string]struct{}

StringSet implements Set interface

func NewStringSet

func NewStringSet(items ...string) StringSet

NewStringSet returns set initialized with items

func (StringSet) Contains

func (set StringSet) Contains(item string) bool

Contains return true if set contains item

func (StringSet) Difference

func (set StringSet) Difference(other StringSet) StringSet

Difference returns elements present in set and not present in other

func (StringSet) Equals

func (set StringSet) Equals(other StringSet) bool

Equals returns false if other StringSet does not contain exact items

func (StringSet) Insert

func (set StringSet) Insert(item string)

Insert adds item to set

func (StringSet) Intersetion

func (set StringSet) Intersetion(other StringSet) StringSet

Intersetion returns common elements of set and other

func (StringSet) Len

func (set StringSet) Len() int

Len returns number of items in set

func (StringSet) Remove

func (set StringSet) Remove(item string)

Remove an item from set

func (StringSet) ToSlice

func (set StringSet) ToSlice() (items []string)

ToSlice return set of items in sorted order

func (StringSet) Union

func (set StringSet) Union(other StringSet) StringSet

Union returns all elements of set and other

Jump to

Keyboard shortcuts

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