data

package
v0.0.0-...-edfa39e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FqnACheck1 = "hcheck1.acheck.istio-system"

FqnACheck1 is the fully qualified name of HandlerH1.

View Source
var FqnAQuota1 = "hquota1.aquota.istio-system"

FqnAQuota1 is the fully qualified name of HandlerAReport1.

View Source
var FqnAReport1 = "hreport1.areport.istio-system"

FqnAReport1 is the fully qualified name of HandlerAReport1.

View Source
var FqnI1 = "icheck1.tcheck.istio-system"

FqnI1 is the fully qualified name for I1.

View Source
var HandlerACheck1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: acheck
metadata:
  name: hcheck1
  namespace: istio-system
spec:
`

HandlerACheck1 is a handler of type acheck with name hcheck1.

View Source
var HandlerACheck2 = `
apiVersion: "config.istio.io/v1alpha2"
kind: acheck
metadata:
  name: hcheck2
  namespace: istio-system
spec:
`

HandlerACheck2 is a handler of type acheck with name hcheck2.

View Source
var HandlerACheck3NS2 = `
apiVersion: "config.istio.io/v1alpha2"
kind: acheck
metadata:
  name: hcheck3
  namespace: ns2
spec:
`

HandlerACheck3NS2 is a handler in namespace NS2.

View Source
var HandlerACheckOutput1 = `
apiVersion: config.istio.io/v1alpha2
kind: acheckoutput
metadata:
  name: hcheckoutput1
  namespace: istio-system
`

HandlerACheckOutput1 is a standard handler for type acheckoutput

View Source
var HandlerAPA1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: apa
metadata:
  name: hapa1
  namespace: istio-system
spec:
`

HandlerAPA1 is an APA handler.

View Source
var HandlerAQuota1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: aquota
metadata:
  name: hquota1
  namespace: istio-system
spec:
`

HandlerAQuota1 is a handler of type aquota with name hquota1.

View Source
var HandlerAReport1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: areport
metadata:
  name: hreport1
  namespace: istio-system
spec:
`

HandlerAReport1 is a handler of type acheck with name hreport1.

View Source
var InstanceAPA1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: tapa
metadata:
  name: iapa1
  namespace: istio-system
spec:
`

InstanceAPA1 is an APA instance

View Source
var InstanceAPA1WithSpec = `` /* 192-byte string literal not displayed */

InstanceAPA1WithSpec has a spec with expressions

View Source
var InstanceCheck1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: tcheck
metadata:
  name: icheck1
  namespace: istio-system
spec:
`

InstanceCheck1 is a standard testing instance for template tcheck.

View Source
var InstanceCheck1WithSpec = `` /* 130-byte string literal not displayed */

InstanceCheck1WithSpec has a spec with expressions

View Source
var InstanceCheck2 = `
apiVersion: "config.istio.io/v1alpha2"
kind: tcheck
metadata:
  name: icheck2
  namespace: istio-system
spec:
`

InstanceCheck2 is another instance.

View Source
var InstanceCheck3 = `
apiVersion: "config.istio.io/v1alpha2"
kind: tcheck
metadata:
  name: icheck3
  namespace: istio-system
spec:
`

InstanceCheck3 is another instance.

View Source
var InstanceCheck4NS2 = `
apiVersion: "config.istio.io/v1alpha2"
kind: tcheck
metadata:
  name: icheck4
  namespace: ns2
spec:
`

InstanceCheck4NS2 is in the ns2 namespace

View Source
var InstanceCheckOutput1 = `
apiVersion: config.istio.io/v1alpha2
kind: tcheckoutput
metadata:
  name: icheckoutput1
  namespace: istio-system
`

InstanceCheckOutput1 is a standard testing instance for template tcheckoutput

View Source
var InstanceHalt1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: thalt
metadata:
  name: ihalt1
  namespace: istio-system
spec:
`

InstanceHalt1 is a standard testing instance.

View Source
var InstanceQuota1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: tquota
metadata:
  name: iquota1
  namespace: istio-system
spec:
`

InstanceQuota1 is a standard testing instance for template tquota.

View Source
var InstanceQuota1WithSpec = `` /* 130-byte string literal not displayed */

InstanceQuota1WithSpec has a spec with expressions

View Source
var InstanceQuota2 = `
apiVersion: "config.istio.io/v1alpha2"
kind: tquota
metadata:
  name: iquota2
  namespace: istio-system
spec:
`

InstanceQuota2 is a copy of InstanceQuota1 with a different name.

View Source
var InstanceReport1 = `
apiVersion: "config.istio.io/v1alpha2"
kind: treport
metadata:
  name: ireport1
  namespace: istio-system
spec:
`

InstanceReport1 is a standard testing instance for template treport.

View Source
var InstanceReport1WithSpec = `` /* 132-byte string literal not displayed */

InstanceReport1WithSpec has a spec with expressions

View Source
var InstanceReport2 = `
apiVersion: "config.istio.io/v1alpha2"
kind: treport
metadata:
  name: ireport2
  namespace: istio-system
spec:
`

InstanceReport2 is a standard testing instance for template treport.

View Source
var Rule4CheckAndHalt = `` /* 236-byte string literal not displayed */

Rule4CheckAndHalt has two instances that goes to the same adapter, but have different templates.

View Source
var RuleApa1 = `` /* 186-byte string literal not displayed */

RuleApa1 is a rule that target APA.

View Source
var RuleCheck1 = `` /* 197-byte string literal not displayed */

RuleCheck1 is a standard testing instance config with name R1. It references I1 and H1.

View Source
var RuleCheck1TrueCondition = `` /* 216-byte string literal not displayed */

RuleCheck1TrueCondition is a standard testing instance config with name R1. It references I1 and H1.

View Source
var RuleCheck1WithBadCondition = `` /* 224-byte string literal not displayed */

RuleCheck1WithBadCondition has a parseable but not compilable condition

View Source
var RuleCheck1WithBadHandler = `` /* 207-byte string literal not displayed */

RuleCheck1WithBadHandler is a standard testing rule config with a bad handler name.

View Source
var RuleCheck1WithInstance1And2 = `` /* 231-byte string literal not displayed */

RuleCheck1WithInstance1And2 has instances icheck1 & icheck2.

View Source
var RuleCheck1WithInstance1And2Operation = `` /* 378-byte string literal not displayed */

RuleCheck1WithInstance1And2Operation has instances icheck1 & icheck2 and a header operation

View Source
var RuleCheck1WithInstance1And2WithMatchClause = `` /* 272-byte string literal not displayed */

RuleCheck1WithInstance1And2WithMatchClause is Rule Check1 with a conditional.

View Source
var RuleCheck1WithMatchClause = `` /* 238-byte string literal not displayed */

RuleCheck1WithMatchClause is Rule Check1 with a conditional.

View Source
var RuleCheck1WithNonBooleanCondition = `` /* 226-byte string literal not displayed */

RuleCheck1WithNonBooleanCondition has a non-boolean condition.

View Source
var RuleCheck2WithHandler2AndInstance2 = `` /* 197-byte string literal not displayed */

RuleCheck2WithHandler2AndInstance2 references hcheck2 and icheck2.

View Source
var RuleCheck2WithInstance1AndHandler = `` /* 197-byte string literal not displayed */

RuleCheck2WithInstance1AndHandler is Rule Check1 with a different name.

View Source
var RuleCheck2WithInstance2And3 = `` /* 231-byte string literal not displayed */

RuleCheck2WithInstance2And3 references instances icheck2 and icheck2.

View Source
var RuleCheck2WithInstance2And3WithMatchClause = `` /* 275-byte string literal not displayed */

RuleCheck2WithInstance2And3WithMatchClause is RuleCheck2WithInstance2And3 with a conditional.

View Source
var RuleCheck3NS2 = `` /* 179-byte string literal not displayed */

RuleCheck3NS2 is check rule in namespace NS2

View Source
var RuleCheckHeaderOpWithNoActions = `` /* 219-byte string literal not displayed */

RuleCheckHeaderOpWithNoActions has a responseHeaderOperation, but no actions. Should not be elided.

View Source
var RuleCheckNoActionsOrHeaderOps = `` /* 154-byte string literal not displayed */

RuleCheckNoActionsOrHeaderOps has no actions and no responseHeaderOperations. Should be elided.

View Source
var RuleCheckOutput1 = `` /* 368-byte string literal not displayed */

RuleCheckOutput1 is a standard testing rule for check output template

View Source
var RuleCheckOutput2 = `` /* 621-byte string literal not displayed */

RuleCheckOutput2 is a testing rule for check output template with multiple outputs

View Source
var RuleQuota1 = `` /* 197-byte string literal not displayed */

RuleQuota1 is a standard testing instance config with name rquota1. It references I1 and H1.

View Source
var RuleQuota1Conditional = `` /* 230-byte string literal not displayed */

RuleQuota1Conditional conditionally selects iquota1

View Source
var RuleQuota2 = `` /* 197-byte string literal not displayed */

RuleQuota2 references iquota1 and hquota1.

View Source
var RuleReport1 = `` /* 202-byte string literal not displayed */

RuleReport1 is a standard testing instance config with name rreport1. It references I1 and H1.

View Source
var RuleReport1And2 = `` /* 238-byte string literal not displayed */

RuleReport1And2 is a standard testing instance config with name rreport1.

View Source
var ServiceConfig = `` /* 464-byte string literal not displayed */

ServiceConfig is a standard service config.

Functions

func BuildAdapters

func BuildAdapters(l *Logger, settings ...FakeAdapterSettings) map[string]*adapter.Info

BuildAdapters builds a standard set of testing adapters. The supplied settings is used to override behavior.

func BuildTemplates

func BuildTemplates(l *Logger, settings ...FakeTemplateSettings) map[string]*template.Info

BuildTemplates builds a standard set of testing templates. The supplied settings is used to override behavior.

func JoinConfigs

func JoinConfigs(configs ...string) string

JoinConfigs is a utility for joining various pieces of config for consumption by store code.

Types

type FakeAdapterSettings

type FakeAdapterSettings struct {
	Name                    string
	PanicAtSetAdapterConfig bool
	PanicData               interface{}
	PanicAtValidate         bool
	ErrorAtValidate         bool
	ErrorAtBuild            bool
	PanicAtBuild            bool
	NilBuilder              bool
	NilHandlerAtBuild       bool
	ErrorAtHandlerClose     bool
	PanicAtHandlerClose     bool
	SpawnDaemon             bool
	SpawnWorker             bool
	CloseGoRoutines         bool

	SupportedTemplates []string
}

FakeAdapterSettings describes the behavior of a fake adapter.

type FakeEnv

type FakeEnv struct {
}

FakeEnv is a dummy implementation of adapter.Env

func (*FakeEnv) Logger

func (f *FakeEnv) Logger() adapter.Logger

Logger is an implementation of adapter.Env.Logger.

func (*FakeEnv) ScheduleDaemon

func (f *FakeEnv) ScheduleDaemon(fn adapter.DaemonFunc)

ScheduleDaemon is an implementation of adapter.Env.ScheduleDaemon.

func (*FakeEnv) ScheduleWork

func (f *FakeEnv) ScheduleWork(fn adapter.WorkFunc)

ScheduleWork is an implementation of adapter.Env.ScheduleWork.

type FakeHandler

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

FakeHandler is a fake implementation of adapter.Handler.

func (*FakeHandler) Close

func (f *FakeHandler) Close() error

Close is an implementation of adapter.Handler.Close.

type FakeHandlerBuilder

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

FakeHandlerBuilder is a fake of HandlerBuilder.

func (*FakeHandlerBuilder) Build

Build is an implementation of HandlerBuilder.Build.

func (*FakeHandlerBuilder) SetAdapterConfig

func (f *FakeHandlerBuilder) SetAdapterConfig(cfg adapter.Config)

SetAdapterConfig is an implementation of HandlerBuilder.SetAdapterConfig.

func (*FakeHandlerBuilder) Validate

func (f *FakeHandlerBuilder) Validate() *adapter.ConfigErrors

Validate is an implementation of HandlerBuilder.Validate.

type FakeTemplateSettings

type FakeTemplateSettings struct {
	Name                           string
	ErrorAtCreateInstance          bool
	ErrorAtCreateInstanceBuilder   bool
	ErrorAtCreateOutputExpressions bool
	ErrorAtInferType               bool
	BuilderDoesNotSupportTemplate  bool
	HandlerDoesNotSupportTemplate  bool
	PanicOnDispatchCheck           bool
	ErrorOnDispatchCheck           bool
	PanicOnDispatchReport          bool
	ErrorOnDispatchReport          bool
	PanicOnDispatchQuota           bool
	ErrorOnDispatchQuota           bool
	PanicOnDispatchGenAttrs        bool
	ErrorOnDispatchGenAttrs        bool
	PanicData                      interface{}
	QuotaResults                   []adapter.QuotaResult
	CheckResults                   []adapter.CheckResult
	OutputAttrs                    map[string]interface{}

	// template will signal the receipt of an incoming dispatch on this channel
	ReceivedCallChannel chan struct{}

	// template will wait on this channel before completing the dispatch
	CommenceSignalChannel chan struct{}
}

FakeTemplateSettings describes the behavior of a fake template.

type Logger

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

Logger is used to capture the events that happen within fake adapters & templates during testing.

func (*Logger) Clear

func (l *Logger) Clear()

Clear the contents of this logger. Useful for reducing the event output to Write more readable tests.

func (*Logger) String

func (l *Logger) String() string

String returns the current contents of the log.

func (*Logger) Write

func (l *Logger) Write(name string, s string)

Write s to the log, with a prefix of name. A newline character is added.

func (*Logger) WriteFormat

func (l *Logger) WriteFormat(name string, format string, args ...interface{})

WriteFormat writes a formatted string to the log, with a prefix of name. A newline character is added.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL