Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigurationFile ¶
type Option ¶
type Option func(*ReloadConfig)
func WithFileRollback ¶
WithFileRollback enables file override. In case of any config error the configuration file will be reverted back to the previous working version. Default is disabled.
type ReloadConfig ¶
type ReloadConfig struct {
// contains filtered or unexported fields
}
ReloadConfig is the main object to initialize the reload library.
func New ¶
func New(ctx context.Context, options ...Option) (*ReloadConfig, error)
New creates a new reload config starts obsevering for config changes. ctx is the scope used for Reload. When ctx is cancelled Reload will stop monitoring and reloading configurations
func (*ReloadConfig) AddConfiguration ¶
func (rc *ReloadConfig) AddConfiguration(path string, config any) error
AddConfiguration adds a new config file to the monitor. path is the file path config is a json tagged struct where the config file will be marshalled into
func (*ReloadConfig) GetErrChannel ¶
func (rc *ReloadConfig) GetErrChannel() <-chan (error)
func (*ReloadConfig) GetReloadChan ¶
func (rc *ReloadConfig) GetReloadChan() <-chan (*ConfigurationFile)
func (*ReloadConfig) Stop ¶
func (rc *ReloadConfig) Stop()
Stop will stop the monitor and clean up resources
Source Files ¶
Click to show internal directories.
Click to hide internal directories.