Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoListener = errors.New("no listener matched") ErrNoFilterChain = errors.New("no filter chains matched") ErrNoRoute = errors.New("no route matched") ErrTLSRedirect = errors.New("tls required, sending 301") ErrNoVirtualHost = errors.New("no virtual host matched") ErrMultipleFilterChain = errors.New("multiple filter chains matched") // ErrProtocolError happens when sending TLS/TCP request to HCM, for example ErrProtocolError = errors.New("protocol error") ErrTLSError = errors.New("invalid TLS") ErrMTLSError = errors.New("invalid mTLS") )
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct { Address string Port int Path string // Protocol describes the protocol type. TLS encapsulation is separate Protocol Protocol // TLS describes the connection tls parameters // TODO: currently this does not verify TLS vs mTLS TLS TLSMode Alpn string // HostHeader is a convenience field for Headers HostHeader string Headers http.Header Sni string // CallMode describes the type of call to make. CallMode CallMode CustomListenerValidations []CustomFilterChainValidation MtlsSecretConfigName string }
func (Call) FillDefaults ¶
type CustomFilterChainValidation ¶
type CustomFilterChainValidation func(filterChain *listener.FilterChain) error
type Result ¶
type Result struct { Error error ListenerMatched string FilterChainMatched string RouteMatched string RouteConfigMatched string VirtualHostMatched string ClusterMatched string // StrictMatch controls whether we will strictly match the result. If unset, empty fields will // be ignored, allowing testing only fields we care about This allows asserting that the result // is *exactly* equal, allowing asserting a field is empty StrictMatch bool // If set, this will mark a test as skipped. Note the result is still checked first - we skip only // if we pass the test. This is to ensure that if the behavior changes, we still capture it; the skip // just ensures we notice a test is wrong Skip string // contains filtered or unexported fields }
type Simulation ¶
type Simulation struct { Listeners []*listener.Listener Clusters []*cluster.Cluster Routes []*route.RouteConfiguration // contains filtered or unexported fields }
func NewSimulation ¶
func NewSimulation(t *testing.T, s *xds.FakeDiscoveryServer, proxy *model.Proxy) *Simulation
func NewSimulationFromConfigGen ¶
func NewSimulationFromConfigGen(t *testing.T, s *core.ConfigGenTest, proxy *model.Proxy) *Simulation
func (*Simulation) Run ¶
func (sim *Simulation) Run(input Call) (result Result)
func (*Simulation) RunExpectations ¶
func (sim *Simulation) RunExpectations(es []Expect)
Click to show internal directories.
Click to hide internal directories.