maps

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

datatype

GoDoc Build Status Codecov Go Report Card Version

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map map[string]any

Map implements some quality of life extensions to a standard map[string]any

func FromURLValues added in v0.8.0

func FromURLValues(value url.Values) Map

func New

func New() Map

New returns a fully initialized Map object.

func (Map) AsMapOfInterface

func (m Map) AsMapOfInterface() map[string]any

AsMapOfInterface returns the underlying map datastructure

func (Map) GetBool

func (m Map) GetBool(name string) (bool, bool)

func (Map) GetFloat

func (m Map) GetFloat(name string) (float64, bool)

func (Map) GetInt

func (m Map) GetInt(name string) (int, bool)

func (Map) GetInt64

func (m Map) GetInt64(name string) (int64, bool)

func (Map) GetInterface

func (m Map) GetInterface(name string) (any, bool)

GetInterface returns a named option without any conversion. You get what you get.

func (Map) GetKeys

func (m Map) GetKeys() []string

GetKeys returns all keys of the underlying map

func (Map) GetMap

func (m Map) GetMap(name string) Map

GetMap returns a named option as a maps.Map

func (*Map) GetObjectOK added in v0.10.0

func (m *Map) GetObjectOK(name string) (any, bool)

func (Map) GetSliceOfFloat

func (m Map) GetSliceOfFloat(name string) []float64

GetSliceOfFloat returns a named option as a slice of float64 values

func (Map) GetSliceOfInt

func (m Map) GetSliceOfInt(name string) []int

GetSliceOfInt returns a named option as a slice of int values

func (Map) GetSliceOfMap

func (m Map) GetSliceOfMap(name string) []Map

GetSliceOfMap returns a named option as a slice of maps.Map objects.

func (Map) GetSliceOfString

func (m Map) GetSliceOfString(name string) []string

GetSliceOfString returns a named option as a slice of strings

func (Map) GetString

func (m Map) GetString(name string) (string, bool)

func (*Map) Remove added in v0.10.0

func (m *Map) Remove(name string) bool

func (*Map) SetBool

func (m *Map) SetBool(name string, value bool) bool

SetBool adds a boolean value into the map

func (*Map) SetFloat

func (m *Map) SetFloat(name string, value float64) bool

SetFloat adds an int value into the map

func (*Map) SetInt

func (m *Map) SetInt(name string, value int) bool

SetInt adds an int value into the map

func (*Map) SetInt64

func (m *Map) SetInt64(name string, value int64) bool

SetInt64 adds an int64 value into the map

func (*Map) SetString

func (m *Map) SetString(name string, value string) bool

SetString adds an int value into the map

Jump to

Keyboard shortcuts

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