apps

package
v0.0.0-...-1a56975 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 32 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

func ConstructDiscoveryRequest

func ConstructDiscoveryRequest(a App, typeURL string) *xdsapi.DiscoveryRequest

ConstructDiscoveryRequest returns an Envoy discovery request.

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 App within the mesh.

type AppCallOptions

type AppCallOptions struct {
	// Protocol indicates the protocol to be used.
	Protocol AppProtocol

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

	// Secure indicates whether a secure connection should be established to the endpoint.
	Secure bool

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

	// Path indicates the path of a REST request.
	Path string
}

AppCallOptions defines options for calling a DeployedAppEndpoint.

type AppEndpoint

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

AppEndpoint represents a single endpoint in a DeployedApp.

type AppParam

type AppParam struct {
	Name     string
	Locality string
}

AppParam specifies the parameter for a single app.

type AppProtocol

type AppProtocol string

AppProtocol enumerates the protocol options for calling an DeployedAppEndpoint endpoint.

type Config

type Config struct {
	Namespace namespace.Instance
	Pilot     pilot.Instance
	Galley    galley.Instance
	// AppParams specifies the apps needed for the test. If unspecified, a default suite of test apps
	// will be deployed.
	AppParams []AppParam
}

Config for Apps

type Instance

type Instance interface {
	resource.Resource

	Namespace() namespace.Instance

	GetApp(name string) (App, error)
	GetAppOrFail(name string, t testing.TB) App
}

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

func New

func New(ctx resource.Context, cfg Config) (i Instance, err error)

New returns a new instance of Apps

func NewOrFail

func NewOrFail(t *testing.T, ctx resource.Context, cfg Config) Instance

New returns a new instance of Apps or fails test.

type KubeApp

type KubeApp interface {
	App
	EndpointForPort(port int) AppEndpoint
}

Represents a deployed App in k8s environment.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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