jsonmap

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasError

func HasError(errs ...error) error

Types

type IIntValue

type IIntValue interface {
	int | int8 | uint8 | int16 | uint16 | int32 | uint32 | int64 | uint64
}

type IMapValue

type IMapValue interface {
	IIntValue | string
}

type JsonMap

type JsonMap map[string]interface{}

func New

func New() *JsonMap

func (JsonMap) GetInt

func (m JsonMap) GetInt(key string) *MapValue[int]

func (JsonMap) GetString

func (m JsonMap) GetString(key string) *MapValue[string]

func (JsonMap) MustGetInt

func (m JsonMap) MustGetInt(key string) int

type MapValue

type MapValue[T IMapValue] struct {
	Value T
	Error error
}

func GetInt

func GetInt[T IIntValue](m *JsonMap, key string) *MapValue[T]

func NewErrorMapValue

func NewErrorMapValue[T IMapValue](err error) *MapValue[T]

func NewMapValue

func NewMapValue[T IMapValue](value T) *MapValue[T]

Jump to

Keyboard shortcuts

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