utils

package
v1.1.9 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CacheNoExpiration time.Duration = 0
)

Variables

This section is empty.

Functions

func MapFindFirst added in v1.1.0

func MapFindFirst(key string, maps ...map[string]string) (string, bool)

MapFindFirst get from list of maps until first found.

func SplitMapStringBool

func SplitMapStringBool(str string) (map[string]bool, error)

SplitMapStringBool parse comma-separated string of key1=value1,key2=value2. value is either true or false

func SplitStringSlice added in v1.1.4

func SplitStringSlice(strSlice []string, chunkSize int) [][]string

Types

type Cache added in v1.1.3

type Cache interface {
	// Set will set value for specified key with validityPeriod duration.
	Set(key string, value interface{}, duration time.Duration)

	// Get will get value for specified key
	Get(key string) (interface{}, bool)

	// Shrink will shrink cache to only contain desiredKeys.
	Shrink(desiredKeys sets.String)
}

func NewCache added in v1.1.3

func NewCache() Cache

Jump to

Keyboard shortcuts

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