generator

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TestImageName = ""
	GatewayHost   = "*"
)
View Source
var (
	Namespace        = ""
	GatewayNamespace = ""
	GatewayName      = "test-gateway"
)

Functions

func DemoScenario

func DemoScenario(out io.Writer)

DemoScenario is a simple setup for demo purposes.

func Deployment

func Deployment(service Entry) runtime.Object

Deployment basic SubGenerator for the kind Deployment.

func DeploymentConfig

func DeploymentConfig(service Entry) runtime.Object

DeploymentConfig basic SubGenerator for the kind DeploymentConfig.

func DestinationRule

func DestinationRule(service Entry) runtime.Object

DestinationRule basic SubGenerator for the kind DestinationRule.

func Gateway

func Gateway() runtime.Object

Gateway basic SubGenerator for the kind Gateway.

func Generate

func Generate(out io.Writer, services []Entry, sub []SubGenerator, modifiers ...Modifier)

Generate runs and prints the full test scenario generation to sysout.

func IncompleteMissingDestinationRules added in v0.5.0

func IncompleteMissingDestinationRules(out io.Writer)

IncompleteMissingVirtualServices generates a scenario where there are no DestinationRules.

func IncompleteMissingVirtualServices added in v0.5.0

func IncompleteMissingVirtualServices(out io.Writer)

IncompleteMissingVirtualServices generates a scenario where there are no VirtualServices.

func Service

func Service(service Entry) runtime.Object

Service basic SubGenerator for the kind Service.

func TestScenario1GRPCThreeServicesInSequence added in v0.0.4

func TestScenario1GRPCThreeServicesInSequence(out io.Writer)

TestScenario1GRPCThreeServicesInSequence is a basic test setup with a few services calling each other in a chain over grpc. Similar to the original bookinfo example setup.

func TestScenario1HTTPThreeServicesInSequence added in v0.0.4

func TestScenario1HTTPThreeServicesInSequence(out io.Writer)

TestScenario1HTTPThreeServicesInSequence is a basic test setup with a few services calling each other in a chain over http. Similar to the original bookinfo example setup.

func TestScenario2ThreeServicesInSequenceDeploymentConfig

func TestScenario2ThreeServicesInSequenceDeploymentConfig(out io.Writer)

TestScenario2ThreeServicesInSequenceDeploymentConfig is a basic test setup with a few services calling each other in a chain. Similar to the original bookinfo example setup. Using DeploymentConfig.

func VirtualService

func VirtualService(service Entry) runtime.Object

VirtualService basic SubGenerator for the kind VirtualService.

Types

type Entry

type Entry struct {
	Name           string
	DeploymentType string
	Namespace      string
}

Entry is a simple value object that holds the basic configuration used by the generator.

func (*Entry) HostName

func (e *Entry) HostName() string

HostName return the full cluster host name if Namespace is set or the local if not.

type Modifier

type Modifier func(service Entry, object runtime.Object)

Modifier is a function to change a runtime.Object into something more specific for a given scenario.

func Call

func Call(proto Protocol, target Entry) Modifier

Call modifier to have the test service call another. Combine with ForService.

func ConnectToGateway

func ConnectToGateway(hostname string) Modifier

ConnectToGateway modifier to connect VirtualService to a Gateway. Combine with ForService.

func ForService

func ForService(target Entry, modifiers ...Modifier) Modifier

ForService modifier is a filter to only execute the given modifiers if the target object belongs to the named target.

func GatewayOnHost

func GatewayOnHost(hostname string) Modifier

GatewayOnHost modifier to set a hostname on the gateway.

func WithVersion

func WithVersion(version string) Modifier

WithVersion modifier adds a single istio 'version' to DestinationRule/VirtualService/Deployment.

type Protocol added in v0.0.4

type Protocol func(target Entry) string

Protocol is a function that returns the URL for a given Protocol for a given Service.

func GRPC added in v0.0.4

func GRPC() Protocol

GRPC returns the GRPC URL for the given target.

func HTTP added in v0.0.4

func HTTP() Protocol

HTTP returns the HTTP URL for the given target.

type SubGenerator

type SubGenerator func(service Entry) runtime.Object

SubGenerator is a function intended to create the basic runtime.Object as a starting point for modification.

Jump to

Keyboard shortcuts

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