Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileSnapshot ¶
type FileSnapshot struct {
// contains filtered or unexported fields
}
FileSnapshot holds a reference to a file directory that contains crd config and filter criteria for which of those configs will be parsed.
func NewFileSnapshot ¶
func NewFileSnapshot(root string, descriptor model.ConfigDescriptor) *FileSnapshot
NewFileSnapshot returns a snapshotter. If no types are provided in the descriptor, all IstioConfigTypes will be allowed.
func (*FileSnapshot) ReadFile ¶
func (f *FileSnapshot) ReadFile() []*model.Config
ReadFile parses files in the root directory and returns a sorted slice of eligible model.Config. This can be used as a configFunc when creating a Monitor.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor will poll a config function in order to update a ConfigStore as changes are found.
func NewMonitor ¶
func NewMonitor(delegateStore model.ConfigStore, checkInterval time.Duration, getSnapshotFunc func() []*model.Config) *Monitor
NewMonitor creates a Monitor and will delegate to a passed in controller. The controller holds a reference to the actual store. Any func that returns a []*model.Config can be used with the Monitor
func (*Monitor) Start ¶
func (m *Monitor) Start(stop chan struct{})
Start starts a new Monitor. Immediately checks the Monitor getSnapshotFunc and updates the controller. It then kicks off an asynchronous event loop that periodically polls the getSnapshotFunc for changes until a close event is sent.