Documentation
¶
Index ¶
- Constants
- type App
- type AppCallOptions
- type AppEndpoint
- type AppProtocol
- type Apps
- type Bookinfo
- type CheckResponse
- type Citadel
- type Echo
- type EchoCallOptions
- type EchoEndpoint
- type EchoProtocol
- type Galley
- type Ingress
- type IngressCallResponse
- type Mixer
- type Pilot
- type PolicyBackend
- type Prometheus
Constants ¶
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" )
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 ¶
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.
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.
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 ¶
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.
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 ¶
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.
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
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