mapx

package
v0.18.4 Latest Latest
Warning

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

Go to latest
Published: May 23, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PathSeparator = "."
)

Variables

This section is empty.

Functions

func MapStructDurationCaster

func MapStructDurationCaster(targetType reflect.Type, value interface{}) (interface{}, error)

func MapStructTimeCaster

func MapStructTimeCaster(targetType reflect.Type, value interface{}) (interface{}, error)

func SkipExisting

func SkipExisting(mode *OpMode)

Types

type MapOption

type MapOption func(mode *OpMode)

type MapStructCaster

type MapStructCaster func(targetType reflect.Type, value interface{}) (interface{}, error)

type MapStructDecoder

type MapStructDecoder func(targetType reflect.Type, val interface{}) (interface{}, error)

type MapX

type MapX struct {
	// contains filtered or unexported fields
}

func NewMapX

func NewMapX(msis ...map[string]interface{}) *MapX

func (*MapX) Append

func (m *MapX) Append(key string, values ...interface{}) error

func (*MapX) Get

func (m *MapX) Get(key string) *MapXNode

func (*MapX) Has

func (m *MapX) Has(key string) bool

func (*MapX) Keys

func (m *MapX) Keys() []string

func (*MapX) Merge

func (m *MapX) Merge(key string, source interface{}, options ...MapOption)

func (*MapX) Msi

func (m *MapX) Msi() map[string]interface{}

func (*MapX) Set

func (m *MapX) Set(key string, value interface{}, options ...MapOption)

func (*MapX) String

func (m *MapX) String() string

type MapXNode

type MapXNode struct {
	// contains filtered or unexported fields
}

func (*MapXNode) Data

func (n *MapXNode) Data() interface{}

func (*MapXNode) IsMap

func (n *MapXNode) IsMap() bool

func (*MapXNode) Map

func (n *MapXNode) Map() (*MapX, error)

func (*MapXNode) Msi

func (n *MapXNode) Msi() (map[string]interface{}, error)

func (*MapXNode) Slice

func (n *MapXNode) Slice() ([]interface{}, error)

func (*MapXNode) StringSlice

func (n *MapXNode) StringSlice() ([]string, error)

type Msier

type Msier interface {
	Msi() map[string]interface{}
}

type OpMode

type OpMode struct {
	IsSet        bool
	SkipExisting bool
}

type Struct

type Struct struct {
	// contains filtered or unexported fields
}

func NewStruct

func NewStruct(source interface{}, settings *StructSettings) (*Struct, error)

func (*Struct) Keys

func (s *Struct) Keys() []StructKey

func (*Struct) Read

func (s *Struct) Read() (*MapX, error)

func (*Struct) ReadZeroAndDefaultValues

func (s *Struct) ReadZeroAndDefaultValues() (*MapX, *MapX, error)

func (*Struct) Write

func (s *Struct) Write(values *MapX) error

type StructKey

type StructKey struct {
	Parent  string
	Key     string
	Kind    reflect.Kind
	SubKeys []StructKey
}

func (StructKey) String

func (k StructKey) String() string

type StructSettings

type StructSettings struct {
	FieldTag   string
	DefaultTag string
	Casters    []MapStructCaster
	Decoders   []MapStructDecoder
}

type StructTag

type StructTag struct {
	Name     string
	NoCast   bool
	NoDecode bool
}

Jump to

Keyboard shortcuts

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