nodetreemodel

package module
v0.77.3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: Apache-2.0 Imports: 21 Imported by: 2

Documentation

Overview

Package nodetreemodel defines a model for the config using a tree of nodes

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("not found")

ErrNotFound is an error for when a key is not found

Functions

func NewNodeTreeConfig added in v0.66.0

func NewNodeTreeConfig(name string, envPrefix string, envKeyReplacer *strings.Replacer) model.BuildableConfig

NewNodeTreeConfig returns a new Config object.

func ToMapStringInterface added in v0.73.0

func ToMapStringInterface(data any, path string) (map[string]interface{}, error)

ToMapStringInterface converts any type of map into a map[string]interface{}

Types

type Node added in v0.60.0

type Node interface {
	IsLeafNode() bool
	IsInnerNode() bool
	Get() interface{}
	ChildrenKeys() []string
}

Node is a inner or leaf node in the config tree

type NodeTreeConfig added in v0.60.0

type NodeTreeConfig interface {
	GetNode(string) (Node, error)
}

NodeTreeConfig is an interface that gives access to nodes

Jump to

Keyboard shortcuts

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