Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CopilotClient ¶
type CopilotClient interface { copilotapi.IstioCopilotClient }
CopilotClient defines a local interface for interacting with Cloud Foundry Copilot
type CopilotSnapshot ¶
type CopilotSnapshot struct {
// contains filtered or unexported fields
}
CopilotSnapshot provides a snapshot of configuration from the Cloud Foundry Copilot component.
func NewCopilotSnapshot ¶
func NewCopilotSnapshot(store model.ConfigStore, client CopilotClient, timeout time.Duration) *CopilotSnapshot
NewCopilotSnapshot returns a CopilotSnapshot used for integration with Cloud Foundry. The store is required to discover any existing gateways: the generated config will reference those gateways The client is used to discover Cloud Foundry Routes from Copilot
func (*CopilotSnapshot) ReadConfigFiles ¶
func (c *CopilotSnapshot) ReadConfigFiles() ([]*model.Config, error)
ReadConfigFiles returns a complete set of VirtualServices for all Cloud Foundry routes known to Copilot. It may be used for the getSnapshotFunc when constructing a NewMonitor
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) ReadConfigFiles ¶
func (f *FileSnapshot) ReadConfigFiles() ([]*model.Config, error)
ReadConfigFiles 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, error)) *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.