pathmap

package
v0.0.0-...-8178683 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiffResult

type DiffResult struct {
	Create PathMap
	Update PathMap
	Delete PathMap
}

func NewDiffResult

func NewDiffResult() *DiffResult

type PathMap

type PathMap map[string]*PathMapValue

func NewPathMap

func NewPathMap(jmap map[string]interface{}) (PathMap, error)

func (PathMap) Composite

func (pm PathMap) Composite(pmList []PathMapInterface) error

func (PathMap) DeleteValue

func (pathMap PathMap) DeleteValue(path string) bool

func (PathMap) Diff

func (pm PathMap) Diff(other PathMapInterface) (*DiffResult, error)

func (PathMap) GetKeys

func (pm PathMap) GetKeys() []string

func (PathMap) GetMapInterface

func (pm PathMap) GetMapInterface() map[string]interface{}

func (PathMap) GetOption

func (pm PathMap) GetOption(path string) (map[string]string, bool)

func (PathMap) GetPath

func (pm PathMap) GetPath(path string) ([]string, bool)

func (PathMap) GetValue

func (pm PathMap) GetValue(path string) (any, bool)

func (PathMap) SetValue

func (pm PathMap) SetValue(path string, value any, opt map[string]string) error

type PathMapInterface

type PathMapInterface interface {
	SetValue(path string, value any, opt map[string]string) error
	GetKeys() []string
	GetValue(path string) (any, bool)
	GetMapInterface() map[string]interface{}
	DeleteValue(path string) bool
	Diff(other PathMapInterface) (*DiffResult, error)
	Composite([]PathMapInterface) error
}

type PathMapValue

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

func NewPathMapValue

func NewPathMapValue(path []string, value any, option map[string]string) (*PathMapValue, error)

func NewPathMapValueSafe

func NewPathMapValueSafe(path []string, value any, option map[string]string) *PathMapValue

Jump to

Keyboard shortcuts

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