istio: Index | Files | Directories

package spyadapter

import ""

Package spyadapter is intended for Mixer testing *ONLY*.


Package Files


type Adapter Uses

type Adapter struct {
    Behavior    AdapterBehavior
    BuilderData *builderData
    HandlerData *handlerData

Adapter is a fake Adapter. It is used for controlling the Adapter's behavior as well as inspect the input values that adapter receives from Mixer

func NewSpyAdapter Uses

func NewSpyAdapter(b AdapterBehavior) *Adapter

NewSpyAdapter returns a new instance of Adapter with the given behavior

func (*Adapter) GetAdptInfoFn Uses

func (s *Adapter) GetAdptInfoFn() adapter.InfoFn

GetAdptInfoFn returns the infoFn for the Adapter.

type AdapterBehavior Uses

type AdapterBehavior struct {
    Name    string
    Builder BuilderBehavior
    Handler HandlerBehavior

AdapterBehavior defines the behavior of the Adapter nolint: maligned

type BuilderBehavior Uses

type BuilderBehavior struct {
    SetSampleReportTypesPanic  bool
    SetSampleCheckTypesPanic   bool
    SetCheckProducerTypesPanic bool
    SetSampleQuotaTypesPanic   bool

    SetAdapterConfigPanic bool

    ValidateErr   *adapter.ConfigErrors
    ValidatePanic bool

    BuildErr   error
    BuildPanic bool

BuilderBehavior defines the behavior of the Builder nolint: maligned

type CapturedCall Uses

type CapturedCall struct {
    Name      string
    Instances []interface{}

CapturedCall describes a call into the adapter.

type HandlerBehavior Uses

type HandlerBehavior struct {
    HandleSampleReportErr   error
    HandleSampleReportPanic bool
    HandleSampleReportSleep time.Duration

    HandleSampleCheckResult adapter.CheckResult
    HandleSampleCheckErr    error
    HandleSampleCheckPanic  bool
    HandleSampleCheckSleep  time.Duration

    HandleCheckProducerResult adapter.CheckResult
    HandleCheckProducerOutput *checkOutputTmpl.Output
    HandleCheckProducerErr    error
    HandleCheckProducerPanic  bool
    HandleCheckProducerSleep  time.Duration

    HandleSampleQuotaResult adapter.QuotaResult
    HandleSampleQuotaErr    error
    HandleSampleQuotaPanic  bool
    HandleSampleQuotaSleep  time.Duration

    GenerateSampleApaErr    error
    GenerateSampleApaOutput *apaTmpl.Output
    GenerateSampleApaPanic  bool
    GenerateSampleApaSleep  time.Duration

    CloseErr   error
    ClosePanic bool

HandlerBehavior defines the behavior of the Handler nolint: maligned


templatePackage template contains generated code for the spy adapter testing.

Package spyadapter imports 9 packages (graph) and is imported by 1 packages. Updated 2020-01-19. Refresh now. Tools for package owners.