components

package
v0.0.0-...-48a44ca Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// AppProtocolHTTP calls the app with HTTP
	AppProtocolHTTP = "http"
	// AppProtocolGRPC calls the app with GRPC
	AppProtocolGRPC = "grpc"
	// AppProtocolWebSocket calls the app with WebSocket
	AppProtocolWebSocket = "ws"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Name() string
	Endpoints() []AppEndpoint
	EndpointsForProtocol(protocol model.Protocol) []AppEndpoint
	Call(e AppEndpoint, opts AppCallOptions) ([]*echo.ParsedResponse, error)
	CallOrFail(e AppEndpoint, opts AppCallOptions, t testing.TB) []*echo.ParsedResponse
}

App represents a deployed fake App within the mesh.

type AppCallOptions

type AppCallOptions struct {
	// Secure indicates whether a secure connection should be established to the endpoint.
	Secure bool

	// Protocol indicates the protocol to be used.
	Protocol AppProtocol

	// UseShortHostname indicates whether shortened hostnames should be used. This may be ignored by the environment.
	UseShortHostname bool

	// Count indicates the number of exchanges that should be made with the service endpoint. If not set (i.e. 0), defaults to 1.
	Count int

	// Headers indicates headers that should be sent in the request. Ingnored for WebSocket calls.
	Headers http.Header
}

AppCallOptions defines options for calling a DeployedAppEndpoint.

type AppEndpoint

type AppEndpoint interface {
	Name() string
	Owner() App
	Protocol() model.Protocol
}

AppEndpoint represents a single endpoint in a DeployedApp.

type AppProtocol

type AppProtocol string

AppProtocol enumerates the protocol options for calling an DeployedAppEndpoint endpoint.

type Apps

type Apps interface {
	component.Instance
	GetApp(name string) (App, error)
	GetAppOrFail(name string, t testing.TB) App
}

Apps is a component that provides access to all deployed test services.

func GetApps

func GetApps(e component.Repository, t testing.TB) Apps

GetApps from the repository

type CheckResponse

type CheckResponse struct {
	Raw *mixerV1.CheckResponse
}

CheckResponse that is returned from a Mixer Check call.

func (*CheckResponse) Succeeded

func (c *CheckResponse) Succeeded() bool

Succeeded returns true if the precondition check was successful.

type Citadel

type Citadel interface {
	component.Instance
	WaitForSecretToExist() (*corev1.Secret, error)
	DeleteSecret() error
}

Citadel represents a deployed Citadel instance.

func GetCitadel

func GetCitadel(e component.Repository, t testing.TB) Citadel

GetCitadel from the repository

type Ingress

type Ingress interface {
	component.Instance
	// Address returns the external HTTP address of the ingress gateway (or the NodePort address,
	// when running under Minikube).
	Address() string

	//  Call makes an HTTP call through ingress, where the URL has the given path.
	Call(path string) (IngressCallResponse, error)
}

Ingress represents a deployed Ingress Gateway instance.

func GetIngress

func GetIngress(e component.Repository, t testing.TB) Ingress

GetIngress from the repository

type IngressCallResponse

type IngressCallResponse struct {
	// Response status code
	Code int

	// Response body
	Body string
}

IngressCallResponse is the result of a call made through Istio Ingress.

type Mixer

type Mixer interface {
	component.Instance
	// Report is called directly with the given attributes.
	Report(t testing.TB, attributes map[string]interface{})
	Check(t testing.TB, attributes map[string]interface{}) CheckResponse

	// TODO(nmittler): Remove this
	Configure(t testing.TB, scope lifecycle.Scope, yaml string)
}

Mixer represents a deployed Mixer instance.

func GetMixer

func GetMixer(e component.Repository, t testing.TB) Mixer

GetMixer from the repository

type Pilot

type Pilot interface {
	component.Instance
	CallDiscovery(req *xdsapi.DiscoveryRequest) (*xdsapi.DiscoveryResponse, error)
}

Pilot testing component

func GetPilot

func GetPilot(e component.Repository, t testing.TB) Pilot

GetPilot from the repository

type PolicyBackend

type PolicyBackend interface {
	component.Instance

	// DenyCheck indicates that the policy backend should deny all incoming check requests when deny is
	// set to true.
	DenyCheck(t testing.TB, deny bool)

	// ExpectReport checks that the backend has received the given report requests. The requests are consumed
	// after the call completes.
	ExpectReport(t testing.TB, expected ...proto.Message)

	// ExpectReportJSON checks that the backend has received the given report request.  The requests are
	// consumed after the call completes.
	ExpectReportJSON(t testing.TB, expected ...string)

	// CreateConfigSnippet for the Mixer adapter to talk to this policy backend.
	// The supplied name will be the name of the handler.
	CreateConfigSnippet(name string) string
}

PolicyBackend represents a deployed fake policy backend for Mixer.

func GetPolicyBackend

func GetPolicyBackend(e component.Repository, t testing.TB) PolicyBackend

GetPolicyBackend from the repository

type Prometheus

type Prometheus interface {
	component.Instance

	// API Returns the core Prometheus APIs.
	API() v1.API

	// WaitForQuiesce runs the provided query periodically until the result gets stable.
	WaitForQuiesce(fmt string, args ...interface{}) (prom.Value, error)

	// WaitForOneOrMore runs the provided query and waits until one (or more for vector) values are available.
	WaitForOneOrMore(fmt string, args ...interface{}) error

	// Sum all the samples that has the given labels in the given vector value.
	Sum(val prom.Value, labels map[string]string) (float64, error)
}

Prometheus represents a deployed Prometheus instance in a Kubernetes cluster.

func GetPrometheus

func GetPrometheus(e component.Repository, t testing.TB) Prometheus

GetPrometheus from the repository

Jump to

Keyboard shortcuts

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