testutils

package
v2.0.4-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2021 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GlobMatch

func GlobMatch(what string, text string, pattern string, regex bool) (bool, string, string, error)

func HostMatch

func HostMatch(mapping v3alpha1.Mapping, host v3alpha1.Host) (bool, string, string, error)

func JSONify

func JSONify(obj interface{}) (string, error)

func JSONifyRenderedListeners

func JSONifyRenderedListeners(renderedListeners []RenderedListener) (string, error)

func LoadYAML

func LoadYAML(path string) ([]kates.Object, error)

func NewMapping

func NewMapping(name string, pfx string) v3alpha1.Mapping

func Retry

func Retry(t *testing.T, numRetries int, f func(r *Retryable)) bool

Types

type Candidate

type Candidate struct {
	Scheme    string
	Action    string
	ActionArg string
}

type RenderedChain

type RenderedChain struct {
	ServerNames       []string                  `json:"server_names"`
	TransportProtocol string                    `json:"transport_protocol"`
	VHosts            map[string]*RenderedVHost `json:"-"`
	VHostList         []*RenderedVHost          `json:"vhosts"`
}

func NewRenderedChain

func NewRenderedChain(serverNames []string, transportProtocol string) RenderedChain

func (*RenderedChain) AddVHost

func (rchain *RenderedChain) AddVHost(rvh *RenderedVHost)

func (*RenderedChain) GetVHost

func (rchain *RenderedChain) GetVHost(vhostname string) *RenderedVHost

type RenderedListener

type RenderedListener struct {
	Name      string                    `json:"name"`
	Port      uint32                    `json:"port"`
	Chains    map[string]*RenderedChain `json:"-"`
	ChainList []*RenderedChain          `json:"chains"`
}

func NewListener

func NewListener(port uint32) RenderedListener

func NewRenderedListener

func NewRenderedListener(name string, port uint32) RenderedListener

func RenderEnvoyConfig

func RenderEnvoyConfig(envoyConfig *apiv3_bootstrap.Bootstrap) ([]RenderedListener, error)

func (*RenderedListener) AddChain

func (rl *RenderedListener) AddChain(rchain *RenderedChain) error

func (*RenderedListener) GetChain

func (rl *RenderedListener) GetChain(hostname string, xport string) *RenderedChain

type RenderedRoute

type RenderedRoute struct {
	Scheme         string `json:"scheme"`
	Host           string `json:"host"`
	Path           string `json:"path"`
	Authority      string `json:"authority"`
	AuthorityMatch string `json:"authorityMatch"`
	Action         string `json:"action"`
	ActionArg      string `json:"action_arg"`
}

func (*RenderedRoute) String

func (rr *RenderedRoute) String() string

type RenderedVHost

type RenderedVHost struct {
	Name   string          `json:"name"`
	Routes []RenderedRoute `json:"routes"`
}

func NewRenderedVHost

func NewRenderedVHost(name string) RenderedVHost

func (*RenderedVHost) AddRoute

func (rvh *RenderedVHost) AddRoute(rr RenderedRoute)

type Retryable

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

func (*Retryable) Cleanup

func (r *Retryable) Cleanup(f func())

func (*Retryable) Error

func (r *Retryable) Error(v ...interface{})

func (*Retryable) Errorf

func (r *Retryable) Errorf(s string, v ...interface{})

func (*Retryable) Fail

func (r *Retryable) Fail()

func (*Retryable) FailNow

func (r *Retryable) FailNow()

func (*Retryable) Failed

func (r *Retryable) Failed() bool

func (*Retryable) Fatal

func (r *Retryable) Fatal(v ...interface{})

func (*Retryable) Fatalf

func (r *Retryable) Fatalf(s string, v ...interface{})

func (*Retryable) Helper

func (r *Retryable) Helper()

func (*Retryable) Log

func (r *Retryable) Log(v ...interface{})

func (*Retryable) Logf

func (r *Retryable) Logf(s string, v ...interface{})

func (*Retryable) Name

func (r *Retryable) Name() string

func (*Retryable) Parallel

func (r *Retryable) Parallel()

func (*Retryable) Skip

func (r *Retryable) Skip(v ...interface{})

func (*Retryable) SkipNow

func (r *Retryable) SkipNow()

func (*Retryable) Skipf

func (r *Retryable) Skipf(s string, v ...interface{})

func (*Retryable) Skipped

func (r *Retryable) Skipped() bool

func (*Retryable) TempDir

func (r *Retryable) TempDir() string

Jump to

Keyboard shortcuts

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