istio: Index | Files

package fixtures

import ""


Package Files

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

func CheckContainEvents Uses

func CheckContainEvents(actuals []event.Event, expected ...event.Event) error

CheckContainEvents checks that the expected elements are all contained within the actual events list (order independent).

func CheckEqual Uses

func CheckEqual(o1 interface{}, o2 interface{}) error

CheckEqual checks that o1 and o2 are equal. If not, returns an error with the diff.

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 ExpectContainEvents Uses

func ExpectContainEvents(t *testing.T, actuals []event.Event, expected ...event.Event)

ExpectContainEvents calls CheckContainEvents and fails the test if an error is returned.

func ExpectEqual Uses

func ExpectEqual(t *testing.T, o1 interface{}, o2 interface{})

ExpectEqual calls CheckEqual and fails the test if it returns an error.

func ExpectEventsEventually Uses

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

ExpectEventsEventually waits for the Accumulator.Events() to contain the expected events.

func ExpectEventsWithoutOriginsEventually Uses

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

ExpectEventsWithoutOriginsEventually waits for the Accumulator.EventsWithoutOrigins() to contain the expected 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.Schema)

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]*sourceAndHandler
    Started           bool
    InputCollections  collection.Schemas
    OutputCollections collection.Schemas
    // contains filtered or unexported fields

Transformer implements event.Transformer for testing purposes.

func NewTransformer Uses

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

NewTransformer returns a new fixture.Transformer.

func (*Transformer) DispatchFor Uses

func (t *Transformer) DispatchFor(c collection.Schema, 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.Schemas

Inputs implements event.Transformer

func (*Transformer) Outputs Uses

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

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 11 packages (graph). Updated 2020-09-02. Refresh now. Tools for package owners.