istio: istio.io/istio/galley/pkg/config/testing/fixtures Index | Files

package fixtures

import "istio.io/istio/galley/pkg/config/testing/fixtures"

Index

Package Files

accumulator.go expect.go filters.go listener.go source.go transformer.go

func Expect Uses

func Expect(t *testing.T, acc *Accumulator, expected ...event.Event)

Expect calls gomega.Eventually to wait until the accumulator accumulated specified events.

func ExpectFilter Uses

func ExpectFilter(t *testing.T, acc *Accumulator, fn FilterFn, expected ...event.Event)

ExpectFilter works similar to Expect, except it filters out events based on the given function.

func ExpectFullSync Uses

func ExpectFullSync(t *testing.T, acc *Accumulator, c collection.Name)

ExpectFullSync expects the given full sync event.

func ExpectNone Uses

func ExpectNone(t *testing.T, acc *Accumulator)

ExpectNone expects no events to arrive.

func NoFullSync Uses

func NoFullSync(events []event.Event) []event.Event

NoFullSync filters FullSync events and returns.

func NoVersions Uses

func NoVersions(events []event.Event) []event.Event

NoVersions strips the versions from the given events

func Sort Uses

func Sort(events []event.Event) []event.Event

Sort events in a stable order.

type Accumulator Uses

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

Accumulator accumulates events that is dispatched to it.

func (*Accumulator) Clear Uses

func (a *Accumulator) Clear()

Clear all currently accummulated events.

func (*Accumulator) Events Uses

func (a *Accumulator) Events() []event.Event

Events return current set of accumulated events.

func (*Accumulator) EventsWithoutOrigins Uses

func (a *Accumulator) EventsWithoutOrigins() []event.Event

EventsWithoutOrigins calls Events, strips the origin fields from the embedded resources and returns result.

func (*Accumulator) Handle Uses

func (a *Accumulator) Handle(e event.Event)

Handle implements event.Handler

func (*Accumulator) String Uses

func (a *Accumulator) String() string

type FilterFn Uses

type FilterFn func(event []event.Event) []event.Event

FilterFn is a function for filtering events

func Chain Uses

func Chain(fns ...FilterFn) FilterFn

Chain filters back to back

type Listener Uses

type Listener struct {
    Handlers event.Handlers
}

Listener is a simple event.Dispatcher implementation for testing.

func (*Listener) Dispatch Uses

func (c *Listener) Dispatch(handler event.Handler)

Dispatch implements event.Listener

type Source Uses

type Source struct {
    Handlers event.Handler
    // contains filtered or unexported fields
}

Source is a test implementation of event.Source

func (*Source) Dispatch Uses

func (s *Source) Dispatch(h event.Handler)

Dispatch implements event.Dispatcher

func (*Source) Handle Uses

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

Handle has the source send the specified event to its handler

func (*Source) Running Uses

func (s *Source) Running() bool

Running indicates whether the Source is currently running or not.

func (*Source) Start Uses

func (s *Source) Start()

Start implements event.Source

func (*Source) Stop Uses

func (s *Source) Stop()

Stop implements event.Source

type Transformer Uses

type Transformer struct {
    Handlers          map[collection.Name]event.Handler
    Started           bool
    InputCollections  collection.Names
    OutputCollections collection.Names
    // contains filtered or unexported fields
}

Transformer implements event.Transformer for testing purposes.

func NewTransformer Uses

func NewTransformer(inputs, outputs collection.Names, handlerFn func(tr *Transformer, e event.Event)) *Transformer

NewTransformer returns a new fixture.Transformer.

func (*Transformer) DispatchFor Uses

func (t *Transformer) DispatchFor(c collection.Name, h event.Handler)

DispatchFor implements event.Transformer

func (*Transformer) Handle Uses

func (t *Transformer) Handle(e event.Event)

Handle implements event.Transformer

func (*Transformer) Inputs Uses

func (t *Transformer) Inputs() collection.Names

Inputs implements event.Transformer

func (*Transformer) Outputs Uses

func (t *Transformer) Outputs() collection.Names

Outputs implements event.Transformer

func (*Transformer) Publish Uses

func (t *Transformer) Publish(c collection.Name, e event.Event)

Publish a message to the given collection

func (*Transformer) Start Uses

func (t *Transformer) Start()

Start implements event.Transformer

func (*Transformer) Stop Uses

func (t *Transformer) Stop()

Stop implements event.Transformer

Package fixtures imports 9 packages (graph). Updated 2019-10-15. Refresh now. Tools for package owners.