istio: istio.io/istio/galley/pkg/config/processing/snapshotter Index | Files | Directories

package snapshotter

import "istio.io/istio/galley/pkg/config/processing/snapshotter"

Index

Package Files

analyzingdistributor.go distributor.go snapshot.go snapshotoptions.go snapshotter.go statusupdater.go

type AnalyzingDistributor Uses

type AnalyzingDistributor struct {
    // contains filtered or unexported fields
}

AnalyzingDistributor is an snapshotter. Distributor implementation that will perform analysis on a snapshot before publishing. It will update the CRD status with the analysis results.

func NewAnalyzingDistributor Uses

func NewAnalyzingDistributor(s AnalyzingDistributorSettings) *AnalyzingDistributor

NewAnalyzingDistributor returns a new instance of AnalyzingDistributor.

func (*AnalyzingDistributor) Distribute Uses

func (d *AnalyzingDistributor) Distribute(name string, s *Snapshot)

Distribute implements snapshotter.Distributor

type AnalyzingDistributorSettings Uses

type AnalyzingDistributorSettings struct {
    // The status updater to route diagnostic messages to
    StatusUpdater StatusUpdater

    // The top-level combined analyzer that will perform the analysis
    Analyzer *analysis.CombinedAnalyzer

    // The downstream distributor to call, after the analysis is done.
    Distributor Distributor

    // The snapshots that will get analyzed.
    AnalysisSnapshots []string

    // The snapshot that will trigger the analysis.
    // TODO(https://github.com/istio/istio/issues/17543): This should be eventually replaced by the AnalysisSnapshots
    //  and a matching debounce mechanism.
    TriggerSnapshot string

    // An optional hook that will be called whenever a collection is accessed. Useful for testing.
    CollectionReporter CollectionReporterFn

    // Namespaces that should be analyzed
    AnalysisNamespaces []string
}

AnalyzingDistributorSettings are settings for an AnalyzingDistributor

type CollectionReporterFn Uses

type CollectionReporterFn func(collection.Name)

CollectionReporterFn is a hook function called whenever a collection is accessed through the AnalyzingDistributor's context

type Distributor Uses

type Distributor interface {
    Distribute(name string, s *Snapshot)
}

Distributor interface abstracts the snapshotImpl distribution mechanism. Typically, this is implemented by the MCP layer.

type HandlerFn Uses

type HandlerFn func(*coll.Set)

HandlerFn handles generated snapshots

type InMemoryDistributor Uses

type InMemoryDistributor struct {
    // contains filtered or unexported fields
}

InMemoryDistributor is an in-memory Distributor implementation.

func NewInMemoryDistributor Uses

func NewInMemoryDistributor() *InMemoryDistributor

NewInMemoryDistributor returns a new instance of InMemoryDistributor

func (*InMemoryDistributor) Distribute Uses

func (d *InMemoryDistributor) Distribute(name string, s *Snapshot)

Distribute is an implementation of Distributor.Distribute

func (*InMemoryDistributor) GetSnapshot Uses

func (d *InMemoryDistributor) GetSnapshot(name string) snapshot.Snapshot

GetSnapshot get the snapshotImpl of the specified name

func (*InMemoryDistributor) NumSnapshots Uses

func (d *InMemoryDistributor) NumSnapshots() int

NumSnapshots returns the current number of snapshots.

type InMemoryStatusUpdater Uses

type InMemoryStatusUpdater struct {
    // contains filtered or unexported fields
}

InMemoryStatusUpdater is an in-memory implementation of StatusUpdater

func (*InMemoryStatusUpdater) Get Uses

func (u *InMemoryStatusUpdater) Get() diag.Messages

Get returns the current set of captured diag.Messages

func (*InMemoryStatusUpdater) Update Uses

func (u *InMemoryStatusUpdater) Update(m diag.Messages)

Update implements StatusUpdater

func (*InMemoryStatusUpdater) WaitForReport Uses

func (u *InMemoryStatusUpdater) WaitForReport(cancelCh chan struct{}) bool

WaitForReport blocks until a report is available. Returns true if a report is available, false if cancelCh was closed.

type MCPDistributor Uses

type MCPDistributor struct {
    // contains filtered or unexported fields
}

MCPDistributor distributes a snapshot to the MCP layer.

func NewMCPDistributor Uses

func NewMCPDistributor(c *snapshot.Cache) *MCPDistributor

NewMCPDistributor returns a new instance of MCPDistributor

func (*MCPDistributor) Distribute Uses

func (d *MCPDistributor) Distribute(name string, s *Snapshot)

Distribute is an implementation of SetSnapshot

type Snapshot Uses

type Snapshot struct {
    // contains filtered or unexported fields
}

Snapshot is an implementation of MCP's snapshot.Snapshot interface. It also exposes additional query methods for analysis purposes.

func (*Snapshot) Collections Uses

func (s *Snapshot) Collections() []string

Collections implements snapshotImpl.Snapshot

func (*Snapshot) Find Uses

func (s *Snapshot) Find(cpl collection.Name, name resource.Name) *resource.Entry

Find the resource with the given name and collection.

func (*Snapshot) ForEach Uses

func (s *Snapshot) ForEach(col collection.Name, fn analysis.IteratorFn)

ForEach iterates all resources in a given collection.

func (*Snapshot) Resources Uses

func (s *Snapshot) Resources(col string) []*mcp.Resource

Resources implements snapshotImpl.Snapshot

func (*Snapshot) String Uses

func (s *Snapshot) String() string

String implements io.Stringer

func (*Snapshot) Version Uses

func (s *Snapshot) Version(col string) string

Version implements snapshotImpl.Snapshot

type SnapshotOptions Uses

type SnapshotOptions struct {
    Distributor Distributor

    // The group name for the snapshotImpl.
    Group string

    // The publishing strategy for the snapshotImpl.
    Strategy strategy.Instance

    // The set of collections to Snapshot.
    Collections []collection.Name
}

SnapshotOptions is settings for a single snapshotImpl target.

type Snapshotter Uses

type Snapshotter struct {
    // contains filtered or unexported fields
}

Snapshotter is a processor that handles input events and creates snapshotImpl collections.

func NewSnapshotter Uses

func NewSnapshotter(xforms []event.Transformer, settings []SnapshotOptions) (*Snapshotter, error)

NewSnapshotter returns a new Snapshotter.

func (*Snapshotter) Handle Uses

func (s *Snapshotter) Handle(e event.Event)

Handle implements Processor

func (*Snapshotter) Start Uses

func (s *Snapshotter) Start()

Start implements Processor

func (*Snapshotter) Stop Uses

func (s *Snapshotter) Stop()

Stop implements Processor

type StatusUpdater Uses

type StatusUpdater interface {
    Update(messages diag.Messages)
}

StatusUpdater updates resource statuses, based on the given diagnostic messages.

Directories

PathSynopsis
strategy

Package snapshotter imports 17 packages (graph) and is imported by 5 packages. Updated 2019-10-20. Refresh now. Tools for package owners.