datatypes

package module
v1.0.0-1a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsInvalidTypeError

func IsInvalidTypeError(err error) bool

func IsMissingKeyError

func IsMissingKeyError(err error) bool

Types

type Map

type Map map[string]interface{}

func (Map) Concat

func (mp Map) Concat(d Map) Map

Concat merges another Map into current Map

func (Map) Delete

func (mp Map) Delete(key string) Map

Delete removes key from Map

func (Map) GetBool

func (mp Map) GetBool(key string, fallbacks ...bool) (bool, error)

GetBool retrieves bool value from Map by key

func (Map) GetBoolSafe

func (mp Map) GetBoolSafe(key string, fallbacks ...bool) bool

GetBoolSafe retrieves bool value safely with fallbacks

func (Map) GetFloat64

func (mp Map) GetFloat64(key string, fallbacks ...float64) (float64, error)

GetFloat64 retrieves float64 value from Map by key

func (Map) GetFloat64Safe

func (mp Map) GetFloat64Safe(key string, fallbacks ...float64) float64

GetFloat64Safe retrieves float64 value safely with fallbacks

func (Map) GetInt

func (mp Map) GetInt(key string, fallbacks ...int) (int, error)

GetInt retrieves int value from Map by key

func (Map) GetIntSafe

func (mp Map) GetIntSafe(key string, fallbacks ...int) int

GetIntSafe retrieves int value safely with fallbacks

func (Map) GetMap

func (mp Map) GetMap(key string, fallbacks ...Map) (Map, error)

GetMap retrieves Map value from Map by key

func (Map) GetMapSafe

func (mp Map) GetMapSafe(key string, fallbacks ...Map) Map

GetMapSafe retrieves Map value safely with fallbacks

func (Map) GetMapsArray

func (mp Map) GetMapsArray(key string, fallbacks ...[]Map) ([]Map, error)

GetMapsArray retrieves []Map value from Map by key

func (Map) GetMapsArraySafe

func (mp Map) GetMapsArraySafe(key string, fallbacks ...[]Map) []Map

GetMapsArraySafe retrieves []Map value safely with fallbacks

func (Map) GetString

func (mp Map) GetString(key string, fallbacks ...string) (string, error)

GetString retrieves string value from Map by key

func (Map) GetStringSafe

func (mp Map) GetStringSafe(key string, fallbacks ...string) string

GetStringSafe retrieves string value safely with fallbacks

func (Map) Marshal

func (mp Map) Marshal() []byte

Marshal returns JSON byte slice representation of Map

func (*Map) Scan

func (mp *Map) Scan(value interface{}) error

Scan scans JSONB value into Map, implements sql.Scanner interface

func (Map) String

func (mp Map) String() string

String returns string representation of Map

func (*Map) Unmarshal

func (mp *Map) Unmarshal(data []byte) error

Unmarshal unmarshals JSON byte slice into Map

func (Map) Value

func (mp Map) Value() (driver.Value, error)

Value returns JSON value, implements driver.Valuer interface

type Set

type Set map[interface{}]struct{}

Set represents a generic set data structure.

func (Set) Has

func (s Set) Has(v interface{}) bool

Has checks if an element exists in the set.

func (Set) Length

func (s Set) Length() int

Length returns the number of elements in the set.

func (Set) Marshal

func (s Set) Marshal() []byte

Marshal converts the set into a JSON byte slice.

func (Set) Pop

func (s Set) Pop(v interface{})

Pop removes an element from the set.

func (Set) Put

func (s Set) Put(v interface{})

Put adds an element to the set.

func (Set) String

func (s Set) String() string

String converts the set into a string representation.

func (Set) Unmarshal

func (s Set) Unmarshal(b []byte) Set

Jump to

Keyboard shortcuts

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