types

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripNDict

func StripNDict(buff map[string]any) map[string]any

recursive convert NDict into standard map data

Types

type Dict

type Dict map[string]any

Simple Dict type

func CreateDict

func CreateDict(buff map[string]any) Dict

create new Dict type from initial map data

func (Dict) Del

func (d Dict) Del(key string)

delete value from dict by key

func (Dict) Get

func (d Dict) Get(key string, defval any) any

get value from dict by key or return default value

func (Dict) GetBool

func (d Dict) GetBool(key string, defval bool) bool

func (Dict) GetFloat32

func (d Dict) GetFloat32(key string, defval float32) float32

func (Dict) GetFloat64

func (d Dict) GetFloat64(key string, defval float64) float64

func (Dict) GetInt

func (d Dict) GetInt(key string, defval int) int

func (Dict) GetInt16

func (d Dict) GetInt16(key string, defval int16) int16

func (Dict) GetInt32

func (d Dict) GetInt32(key string, defval int32) int32

func (Dict) GetInt64

func (d Dict) GetInt64(key string, defval int64) int64

func (Dict) GetInt8

func (d Dict) GetInt8(key string, defval int8) int8

func (Dict) GetString

func (d Dict) GetString(key string, defval string) string

func (Dict) GetUint

func (d Dict) GetUint(key string, defval uint) uint

func (Dict) GetUint16

func (d Dict) GetUint16(key string, defval uint16) uint16

func (Dict) GetUint32

func (d Dict) GetUint32(key string, defval uint32) uint32

func (Dict) GetUint64

func (d Dict) GetUint64(key string, defval uint64) uint64

func (Dict) GetUint8

func (d Dict) GetUint8(key string, defval uint8) uint8

func (Dict) KeyExist

func (d Dict) KeyExist(key string) bool

check if key exist in dict

func (Dict) Keys

func (d Dict) Keys() []string

return sorted list of all keys

func (Dict) Set

func (d Dict) Set(key string, newval any)

set value in dict by key

func (Dict) Update

func (d Dict) Update(updt map[string]any)

update dict from map data

type NDict

type NDict map[string]any

Nested Dict type with nested keys support

func CreateNDict

func CreateNDict(buff map[string]any) NDict

create new NDict from initial map data

func (NDict) Del

func (d NDict) Del(key string)

delete value from dict by key

func (NDict) Get

func (d NDict) Get(key string, defval any) any

get value from dict by key or return default value

func (NDict) GetBool

func (d NDict) GetBool(key string, defval bool) bool

func (NDict) GetFloat32

func (d NDict) GetFloat32(key string, defval float32) float32

func (NDict) GetFloat64

func (d NDict) GetFloat64(key string, defval float64) float64

func (NDict) GetInt

func (d NDict) GetInt(key string, defval int) int

func (NDict) GetInt16

func (d NDict) GetInt16(key string, defval int16) int16

func (NDict) GetInt32

func (d NDict) GetInt32(key string, defval int32) int32

func (NDict) GetInt64

func (d NDict) GetInt64(key string, defval int64) int64

func (NDict) GetInt8

func (d NDict) GetInt8(key string, defval int8) int8

func (NDict) GetString

func (d NDict) GetString(key string, defval string) string

func (NDict) GetUint

func (d NDict) GetUint(key string, defval uint) uint

func (NDict) GetUint16

func (d NDict) GetUint16(key string, defval uint16) uint16

func (NDict) GetUint32

func (d NDict) GetUint32(key string, defval uint32) uint32

func (NDict) GetUint64

func (d NDict) GetUint64(key string, defval uint64) uint64

func (NDict) GetUint8

func (d NDict) GetUint8(key string, defval uint8) uint8

func (NDict) KeyExist

func (d NDict) KeyExist(key string) bool

check if key exist in dict

func (NDict) Keys

func (d NDict) Keys() []string

return sorted list of all nested level keys

func (NDict) KeysN

func (d NDict) KeysN(lvl int) []string

return sorted recursive list up to N level nested keys

func (NDict) Set

func (d NDict) Set(key string, newval any)

set value in dict by key

func (NDict) Update

func (d NDict) Update(updt map[string]any)

update dict from updt dict

Jump to

Keyboard shortcuts

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