properties

package module
v0.0.0-...-b65caf5 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const SplitDots bool = true
View Source
const SplitSeparator string = "."

Variables

View Source
var ErrOutOfRange error = errors.New("index out of range")
View Source
var ErrWrongType error = errors.New("wrong type")

Functions

func ArrayToInterface

func ArrayToInterface(arr ...interface{}) []interface{}

func InterfaceToPropType

func InterfaceToPropType(val interface{}) interface{}

func InterfaceToString

func InterfaceToString(val interface{}) (res string, err error)

func MapToPropMap

func MapToPropMap(m map[string]interface{}) map[string]interface{}

Types

type Properties

type Properties map[string]interface{}

func (*Properties) Compare

func (p *Properties) Compare(other *Properties) bool

func (*Properties) Copy

func (p *Properties) Copy(other *Properties)

func (*Properties) Delete

func (p *Properties) Delete(key string)

func (*Properties) Get

func (p *Properties) Get(key string) interface{}

func (*Properties) GetArray

func (p *Properties) GetArray(key string) (res []interface{}, err error)

func (*Properties) GetArrayAt

func (p *Properties) GetArrayAt(key string, idx int) (interface{}, error)

func (*Properties) GetBool

func (p *Properties) GetBool(key string) (res bool, err error)

func (*Properties) GetFloat

func (p *Properties) GetFloat(key string) (res float64, err error)

func (*Properties) GetInt

func (p *Properties) GetInt(key string) (res int64, err error)

func (*Properties) GetInternalMap

func (p *Properties) GetInternalMap() map[string]interface{}

func (*Properties) GetMap

func (p *Properties) GetMap(key string) (res map[string]interface{}, err error)

func (*Properties) GetString

func (p *Properties) GetString(key string) (res string, err error)

func (*Properties) GetStruct

func (p *Properties) GetStruct(key string, val any) error

func (*Properties) Init

func (p *Properties) Init()

func (*Properties) InitFromMap

func (p *Properties) InitFromMap(val map[string]interface{})

func (*Properties) IsArray

func (p *Properties) IsArray(key string) bool

func (*Properties) IsBool

func (p *Properties) IsBool(key string) bool

func (*Properties) IsFloat

func (p *Properties) IsFloat(key string) bool

func (*Properties) IsInt

func (p *Properties) IsInt(key string) bool

func (*Properties) IsMap

func (p *Properties) IsMap(key string) bool

func (*Properties) IsNil

func (p *Properties) IsNil(key string) bool

func (*Properties) IsNumber

func (p *Properties) IsNumber(key string) bool

func (*Properties) IsSet

func (p *Properties) IsSet(key string) bool

func (*Properties) IsString

func (p *Properties) IsString(key string) bool

func (*Properties) List

func (p *Properties) List(key ...string) []string

func (*Properties) Load

func (p *Properties) Load(data []byte) error

func (*Properties) MarshalJSON

func (p *Properties) MarshalJSON() ([]byte, error)

func (*Properties) MustArray

func (p *Properties) MustArray(key string) []interface{}

func (*Properties) MustBool

func (p *Properties) MustBool(key string) bool

func (*Properties) MustFloat

func (p *Properties) MustFloat(key string) float64

func (*Properties) MustInt

func (p *Properties) MustInt(key string) int64

func (*Properties) MustMap

func (p *Properties) MustMap(key string) map[string]interface{}

func (*Properties) MustString

func (p *Properties) MustString(key string) string

func (*Properties) Save

func (p *Properties) Save() ([]byte, error)

func (*Properties) SaveStruct

func (p *Properties) SaveStruct(key string) ([]byte, error)

func (*Properties) Set

func (p *Properties) Set(key string, val interface{})

func (*Properties) SetMap

func (p *Properties) SetMap(key []string, val interface{})

func (*Properties) SetStruct

func (p *Properties) SetStruct(key string, val interface{})

func (*Properties) UnmarshalJSON

func (p *Properties) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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