Documentation ¶
Index ¶
- Constants
- type Loader
- func (l *Loader) Close()
- func (l *Loader) Init() (*Loader, error)
- func (l *Loader) Load(ctx context.Context) error
- func (l *Loader) Start(ctx context.Context) error
- func (l *Loader) WithErrorLogger(logger func(error)) *Loader
- func (l *Loader) WithFile(filename string) *Loader
- func (l *Loader) WithInterval(interval time.Duration) *Loader
Constants ¶
View Source
const ( // DefaultInterval for re-loading the bundle file. DefaultInterval = time.Minute )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Loader ¶
type Loader struct {
// contains filtered or unexported fields
}
Loader loads a bundle from a file. If started, it loads the bundle periodically until closed.
func (*Loader) Init ¶
Init initializes the loader after its construction and configuration. If invalid config, will return ErrInvalidConfig.
func (*Loader) Load ¶
Load loads the bundle from a file and installs it. The possible returned errors are ErrInvalidBundle (in case of an error in loading or opening the bundle) and the ones SetPolicyData of OPA returns.
func (*Loader) Start ¶
Start starts the periodic loading byt calling Load, failing if the bundle loading fails.
func (*Loader) WithErrorLogger ¶
WithErrorLogger configures an error logger invoked with all the errors.
Click to show internal directories.
Click to hide internal directories.