maps

package
v0.0.0-...-17d9b22 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAll

func AddAll[K comparable, V any](toMap map[K]V, fromMap map[K]V)

func Count

func Count[K comparable, V any](target map[K]V) (cnt int)

func Get

func Get[K comparable, V any](key K, target map[K]V) V

func GetString

func GetString(key string, target map[string]any) string

func HasKey

func HasKey[K comparable, V any](key K, target map[K]V) bool

func LoadPropertiesMapYamlToMap

func LoadPropertiesMapYamlToMap(filename, path string, properties *Properties)

func Merge

func Merge[K comparable, V any](baseMap map[K]V, overridingMap map[K]V) map[K]V

func Print

func Print[K comparable, V any](target map[K]V, msg string, args ...any)

func PrintPadded

func PrintPadded[K comparable, V any](target map[K]V, depth int, msg string, args ...any)

Types

type OverridableProperties

type OverridableProperties struct {
	FileName string
	KeyPath  string
	Path     string
	Contents Properties
	Children []*OverridableProperties
	Parent   *OverridableProperties
}

func NewOverridableProperties

func NewOverridableProperties(filename string, path string) *OverridableProperties

func NewOverriddenProperties

func NewOverriddenProperties(properties *OverridableProperties) *OverridableProperties

func (*OverridableProperties) Add

Build Relationships

func (*OverridableProperties) GetGrandestParent

func (c *OverridableProperties) GetGrandestParent() *OverridableProperties

func (*OverridableProperties) GetKeyPath

func (c *OverridableProperties) GetKeyPath() string

func (*OverridableProperties) GetOverriddenProperties

func (c *OverridableProperties) GetOverriddenProperties() Properties

type Properties

type Properties map[string]any

type PropertyManager

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

func NewPropertyManager

func NewPropertyManager() *PropertyManager

func (*PropertyManager) Add

func (p *PropertyManager) Add(path string, props *OverridableProperties)

func (*PropertyManager) Get

func (*PropertyManager) GetFirstSetWithSuffix

func (p *PropertyManager) GetFirstSetWithSuffix(suffix string) *OverridableProperties

func (*PropertyManager) GetSetsWithSuffix

func (p *PropertyManager) GetSetsWithSuffix(suffix string) (found []*OverridableProperties)

func (*PropertyManager) Has

func (p *PropertyManager) Has(path string) bool

func (*PropertyManager) SetCount

func (p *PropertyManager) SetCount() int

Jump to

Keyboard shortcuts

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