maps

package
v0.0.0-...-67c52db Latest Latest
Warning

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

Go to latest
Published: May 20, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

package maps provides some useful functions for working with maps.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is key not found.
	ErrNotFound = errors.New("key not found")
)

Functions

func Clone

func Clone(m map[string]interface{}) (map[string]interface{}, error)

Clone performs a deep copy of the given map m.

Types

type Value

type Value interface {
	Bool() (bool, error)
	Int() (int64, error)
	Float() (float64, error)
	String() (string, error)
	Duration() (time.Duration, error)
	Slice() ([]Value, error)
	Map() (map[string]Value, error)
	Scan(interface{}) error
	Load() interface{}
	Store(interface{})
}

Value is config value interface.

func Get

func Get(values map[string]interface{}, path string) Value

Get read Value in given map[string]interface{} by the given path, will return false if not found.

Jump to

Keyboard shortcuts

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