components

package
v0.0.0-...-519b562 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2019 License: Apache-2.0 Imports: 17 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"
)
View Source
const (
	// EchoProtocolHTTP calls echo with HTTP
	EchoProtocolHTTP = "http"
	// EchoProtocolGRPC calls echo with GRPC
	EchoProtocolGRPC = "grpc"
	// EchoProtocolWebSocket calls echo with WebSocket
	EchoProtocolWebSocket = "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 Bookinfo

type Bookinfo interface {
	component.Instance

	DeployRatingsV2(ctx context.Instance, scope lifecycle.Scope) error

	DeployMongoDb(ctx context.Instance, scope lifecycle.Scope) error
}

Bookinfo represents a deployed Bookinfo app instance in a Kubernetes cluster.

func GetBookinfo

func GetBookinfo(e component.Repository, t testing.TB) Bookinfo

GetBookinfo 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 Echo

type Echo interface {
	component.Instance

	Name() string
	Endpoints() []EchoEndpoint
	EndpointsForProtocol(protocol model.Protocol) []EchoEndpoint
	Call(e EchoEndpoint, opts EchoCallOptions) ([]*echo.ParsedResponse, error)
	CallOrFail(e EchoEndpoint, opts EchoCallOptions, t testing.TB) []*echo.ParsedResponse
}

Echo is a component that provides access to the deployed echo service.

func GetEcho

func GetEcho(name string, e component.Repository, t testing.TB) Echo

Get an echo instance from the repository.

type EchoCallOptions

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

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

	// 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
}

EchoCallOptions defines options for calling a EchoEndpoint.

type EchoEndpoint

type EchoEndpoint interface {
	Name() string
	Owner() Echo
	Protocol() model.Protocol
}

EchoEndpoint represents a single endpoint in an Echo instance.

type EchoProtocol

type EchoProtocol string

EchoProtocol enumerates the protocol options for calling an EchoEndpoint endpoint.

type Galley

type Galley interface {
	component.Instance

	// ApplyConfig applies the given config yaml file via Galley.
	ApplyConfig(yamlText string) error

	// ClearConfig clears all applied config so far.
	ClearConfig() error

	// SetMeshConfig applies the given mesh config yaml file via Galley.
	SetMeshConfig(yamlText string) error

	// WaitForSnapshot waits until the given snapshot is observed for the given type URL.
	WaitForSnapshot(collection string, snapshot ...map[string]interface{}) error
}

Galley represents a deployed Galley instance.

func GetGalley

func GetGalley(e component.Repository, t testing.TB) Galley

GetGalley 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)

	GetCheckAddress() net.Addr
	GetReportAddress() net.Addr
}

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)
	StartDiscovery(req *xdsapi.DiscoveryRequest) error
	WatchDiscovery(duration time.Duration, accept func(*xdsapi.DiscoveryResponse) (bool, error)) 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