github.com/lyraproj/hiera@v1.0.0-rc4/api/config.go (about) 1 package api 2 3 import ( 4 "github.com/lyraproj/dgo/dgo" 5 ) 6 7 // A Config represents a full hiera.yaml version 5 configuration. 8 type Config interface { 9 // Root returns the directory holding this Config 10 Root() string 11 12 // Path is the full path to this Config 13 Path() string 14 15 // Defaults returns the Defaults entry 16 Defaults() Entry 17 18 // Hierarchy returns the configuration hierarchy slice 19 Hierarchy() []Entry 20 21 // DefaultHierarchy returns the default hierarchy slice 22 DefaultHierarchy() []Entry 23 } 24 25 // A ResolvedConfig represents a Config where everything has been resolved on behalf of an Invocation. 26 type ResolvedConfig interface { 27 // Config returns the original Config that the receiver was created from 28 Config() Config 29 30 // Hierarchy returns the DataProvider slice 31 Hierarchy() []DataProvider 32 33 // DefaultHierarchy returns the DataProvider slice for the configured default_hierarchy. 34 // The slice will be empty if no such hierarchy has been defined. 35 DefaultHierarchy() []DataProvider 36 37 // LookupOptions returns the resolved lookup_options value for the given key or nil 38 // if no such options exists. 39 LookupOptions(key Key) dgo.Map 40 }