maputil

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapSSEqual

func MapSSEqual(a, b map[string]string) bool

func MapSSMerge

func MapSSMerge(first map[string]string, second map[string]string) map[string]string

func MapSSToKeyValues

func MapSSToKeyValues(kvs map[string]string, sep string) string

func MapSSValOrEmpty

func MapSSValOrEmpty(data map[string]string, key string) string

func MapStringMapStringIntFuncExactMatch added in v1.3.5

func MapStringMapStringIntFuncExactMatch(valWant int) func(string, string, int) bool

MapStringMapStringIntFuncExactMatch returns a match function that matches an exact vaule.

func MapStringMapStringIntFuncIncludeAll added in v1.3.5

func MapStringMapStringIntFuncIncludeAll(str1, str2 string, val int) bool

MapStringMapStringIntFuncIncludeAll returns match function that matches all values.

func StringKeys

func StringKeys(mp interface{}) []string

func StringKeysSorted

func StringKeysSorted(mp interface{}) []string

func StringKeysToLowerSorted

func StringKeysToLowerSorted(mp interface{}) []string

Types

type MapInt64Int64

type MapInt64Int64 map[int64]int64

func (MapInt64Int64) KeysSorted

func (m MapInt64Int64) KeysSorted() []int64

func (MapInt64Int64) ValuesSortedByKeys

func (m MapInt64Int64) ValuesSortedByKeys() []int64

type MapStringInt added in v1.1.0

type MapStringInt map[string]int

MapStringInt represents a `map[string]int`

func (MapStringInt) Add added in v1.3.3

func (msi MapStringInt) Add(key string, val int)

Add adds the value of `val` to `key`.

func (MapStringInt) Keys added in v1.1.0

func (msi MapStringInt) Keys(sortKeys bool) []string

Keys returns a string slice of the map's keys.

func (MapStringInt) MinMaxValues added in v1.1.0

func (msi MapStringInt) MinMaxValues() (int, int)

MinMaxValues returns the minium and maximum values of the `map[string]int`.

func (MapStringInt) MustGet added in v1.3.3

func (msi MapStringInt) MustGet(key string, defaultValue int) int

MustGet returns a value or a default.

func (MapStringInt) Set added in v1.3.3

func (msi MapStringInt) Set(key string, val int)

Set sets the value of `val` to `key`.

type MapStringMapStringInt added in v1.3.3

type MapStringMapStringInt map[string]map[string]int

MapStringMapStringInt represents a `map[string]map[string]int`

func (MapStringMapStringInt) Add added in v1.3.3

func (msmsi MapStringMapStringInt) Add(str1, str2 string, val int)

Add supports adding values to `MapStringMapStringInt` easily.

func (MapStringMapStringInt) Counts added in v1.3.5

func (msmsi MapStringMapStringInt) Counts(sep string) (int, int)

Counts returns key counts regardless of value.

func (MapStringMapStringInt) CountsWithVal added in v1.3.5

func (msmsi MapStringMapStringInt) CountsWithVal(wantVal int, sep string) (int, int)

CountsWithVal returns key counts with the desired value.

func (MapStringMapStringInt) Flatten added in v1.3.3

func (msmsi MapStringMapStringInt) Flatten(prefix, sep string, fnInclude func(string, string, int) bool, dedupe, sortResults bool) []string

Flatten returns the values in the `MapStringMapStringInt` in an string slice.

func (MapStringMapStringInt) Set added in v1.3.3

func (msmsi MapStringMapStringInt) Set(str1, str2 string, val int)

Set supports setting values to `MapStringMapStringInt` easily.

Jump to

Keyboard shortcuts

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