types

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 5 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StripDict added in v0.3.7

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

recursive convert Dict into standard map data

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 CloneDict added in v0.3.7

func CloneDict(src map[string]any) (Dict, error)

create deep clone of Dict

func NewDict added in v0.3.3

func NewDict(buff map[string]any) Dict

create new Dict 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) GetBoolSlice added in v0.3.3

func (d Dict) GetBoolSlice(key string, defval []bool) []bool

func (Dict) GetByte added in v0.3.3

func (d Dict) GetByte(key string, defval byte) byte

func (Dict) GetBytes added in v0.3.9

func (d Dict) GetBytes(key string, defval []byte) []byte

func (Dict) GetDict added in v0.3.3

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

func (Dict) GetDictSlice added in v0.3.3

func (d Dict) GetDictSlice(key string, defval []Dict) []Dict

func (Dict) GetFloat32

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

func (Dict) GetFloat32Slice added in v0.3.3

func (d Dict) GetFloat32Slice(key string, defval []float32) []float32

func (Dict) GetFloat64

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

func (Dict) GetFloat64Slice added in v0.3.3

func (d Dict) GetFloat64Slice(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) GetInt16Slice added in v0.3.3

func (d Dict) GetInt16Slice(key string, defval []int16) []int16

func (Dict) GetInt32

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

func (Dict) GetInt32Slice added in v0.3.3

func (d Dict) GetInt32Slice(key string, defval []int32) []int32

func (Dict) GetInt64

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

func (Dict) GetInt64Slice added in v0.3.3

func (d Dict) GetInt64Slice(key string, defval []int64) []int64

func (Dict) GetInt8

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

func (Dict) GetInt8Slice added in v0.3.3

func (d Dict) GetInt8Slice(key string, defval []int8) []int8

func (Dict) GetIntSlice added in v0.3.3

func (d Dict) GetIntSlice(key string, defval []int) []int

func (Dict) GetNDict added in v0.3.3

func (d Dict) GetNDict(key string, defval NDict) NDict

func (Dict) GetNDictSlice added in v0.3.3

func (d Dict) GetNDictSlice(key string, defval []NDict) []NDict

func (Dict) GetRune added in v0.3.9

func (d Dict) GetRune(key string, defval rune) rune

func (Dict) GetRuneSlice added in v0.3.9

func (d Dict) GetRuneSlice(key string, defval []rune) []rune

func (Dict) GetSlice added in v0.3.9

func (d Dict) GetSlice(key string, defval []any) []any

func (Dict) GetString

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

func (Dict) GetStringSlice added in v0.3.3

func (d Dict) GetStringSlice(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) GetUint16Slice added in v0.3.3

func (d Dict) GetUint16Slice(key string, defval []uint16) []uint16

func (Dict) GetUint32

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

func (Dict) GetUint32Slice added in v0.3.3

func (d Dict) GetUint32Slice(key string, defval []uint32) []uint32

func (Dict) GetUint64

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

func (Dict) GetUint64Slice added in v0.3.3

func (d Dict) GetUint64Slice(key string, defval []uint64) []uint64

func (Dict) GetUint8

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

func (Dict) GetUint8Slice added in v0.3.3

func (d Dict) GetUint8Slice(key string, defval []uint8) []uint8

func (Dict) GetUintSlice added in v0.3.3

func (d Dict) GetUintSlice(key string, defval []uint) []uint

func (Dict) IsExist added in v0.3.3

func (d Dict) IsExist(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 CloneNDict added in v0.3.7

func CloneNDict(src map[string]any) (NDict, error)

create deep clone of NDict

func NewNDict added in v0.3.3

func NewNDict(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) GetBoolSlice added in v0.3.3

func (d NDict) GetBoolSlice(key string, defval []bool) []bool

func (NDict) GetByte added in v0.3.3

func (d NDict) GetByte(key string, defval byte) byte

func (NDict) GetBytes added in v0.3.9

func (d NDict) GetBytes(key string, defval []byte) []byte

func (NDict) GetDict added in v0.3.3

func (d NDict) GetDict(key string, defval Dict) Dict

func (NDict) GetDictSlice added in v0.3.3

func (d NDict) GetDictSlice(key string, defval []Dict) []Dict

func (NDict) GetFloat32

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

func (NDict) GetFloat32Slice added in v0.3.3

func (d NDict) GetFloat32Slice(key string, defval []float32) []float32

func (NDict) GetFloat64

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

func (NDict) GetFloat64Slice added in v0.3.3

func (d NDict) GetFloat64Slice(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) GetInt16Slice added in v0.3.3

func (d NDict) GetInt16Slice(key string, defval []int16) []int16

func (NDict) GetInt32

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

func (NDict) GetInt32Slice added in v0.3.3

func (d NDict) GetInt32Slice(key string, defval []int32) []int32

func (NDict) GetInt64

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

func (NDict) GetInt64Slice added in v0.3.3

func (d NDict) GetInt64Slice(key string, defval []int64) []int64

func (NDict) GetInt8

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

func (NDict) GetInt8Slice added in v0.3.3

func (d NDict) GetInt8Slice(key string, defval []int8) []int8

func (NDict) GetIntSlice added in v0.3.3

func (d NDict) GetIntSlice(key string, defval []int) []int

func (NDict) GetNDict added in v0.3.3

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

func (NDict) GetNDictSlice added in v0.3.3

func (d NDict) GetNDictSlice(key string, defval []NDict) []NDict

func (NDict) GetRune added in v0.3.9

func (d NDict) GetRune(key string, defval rune) rune

func (NDict) GetRuneSlice added in v0.3.9

func (d NDict) GetRuneSlice(key string, defval []rune) []rune

func (NDict) GetSlice added in v0.3.9

func (d NDict) GetSlice(key string, defval []any) []any

func (NDict) GetString

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

func (NDict) GetStringSlice added in v0.3.3

func (d NDict) GetStringSlice(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) GetUint16Slice added in v0.3.3

func (d NDict) GetUint16Slice(key string, defval []uint16) []uint16

func (NDict) GetUint32

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

func (NDict) GetUint32Slice added in v0.3.3

func (d NDict) GetUint32Slice(key string, defval []uint32) []uint32

func (NDict) GetUint64

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

func (NDict) GetUint64Slice added in v0.3.3

func (d NDict) GetUint64Slice(key string, defval []uint64) []uint64

func (NDict) GetUint8

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

func (NDict) GetUint8Slice added in v0.3.3

func (d NDict) GetUint8Slice(key string, defval []uint8) []uint8

func (NDict) GetUintSlice added in v0.3.3

func (d NDict) GetUintSlice(key string, defval []uint) []uint

func (NDict) IsExist added in v0.3.3

func (d NDict) IsExist(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