mango

package module
v0.0.0-...-4d94ce0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMangoToTree

func AddMangoToTree(m Mango)

AddMango adds a given Mango m to the default tree (named `globalTree` internally)

func InitTree

func InitTree()

func IsMangoExtValid

func IsMangoExtValid(path string) bool

func NewMangoWatcher

func NewMangoWatcher(path string)

func ReloadTree

func ReloadTree(path string)

ReloadTree reloads the default tree (named `globalTree` internally) from the specified filepath

Types

type Mango

type Mango struct {
	Config *viper.Viper

	ID string
}

func GetCombinedMangoForThing

func GetCombinedMangoForThing(thingType string) Mango

GetCombinedMangoForThing will search all discovered mangoes for the requested thing type, collect the data from all mangoes, and merge it into a combined config map containing all of the things of the given type. Intended for consumption by individual Manager ipmlementations as they will need to refresh the list of things they manage periodically.

func NewMango

func NewMango(path string) Mango

TODO: currently mangoes are more or less a wrapper around viper to provide easier support for reading arbritrary config structs This should be revisited soon. I dislike how implicitly and tightly coupled this is.

func (Mango) String

func (m Mango) String() string

type Tree

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

func NewTree

func NewTree() Tree

func (*Tree) AddMango

func (t *Tree) AddMango(m Mango)

AddMango adds a given Mango m to Tree t

func (*Tree) Reload

func (t *Tree) Reload(path string)

Reload reloads Tree t from the specified filepath

Jump to

Keyboard shortcuts

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