Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory func() any
Factory creates a struct to pass to an Unmarshaller then an Updater
type Manager ¶
type Manager interface { // EtcDir returns the path to the etc directory EtcDir() string // ReadJson will read a yaml file from inside etc ReadJson(n string, o any) error // ReadJsonOptional is the same as ReadJson except that the file not existing will not // return an error ReadJsonOptional(n string, o any) error // ReadYaml will read a yaml file from inside etc ReadYaml(n string, o any) error // ReadYamlOptional is the same as ReadYaml except that the file not existing will not // return an error ReadYamlOptional(n string, o any) error // FixPath ensures that, if the path is relative it will point to EtcDir(). // This will do nothing is s==nil or *s=="" FixPath(s *string) // ReadAndWatch read with a custom Unmarshaller but also if the file ever changes. ReadAndWatch(n string, f Factory, u Updater, um Unmarshaller) error // WatchDirectory watches a directory and passes all changes to a single Updater WatchDirectory(d string, f Factory, u Updater, um Unmarshaller) }
type Unmarshaller ¶
Unmarshaller will be called to unmarshal a file when it changes. Usually this is yaml.Unmarshal but it can be a custom format
Click to show internal directories.
Click to hide internal directories.