gloo

package
v0.0.0-...-70b330c Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrFailedToInitializeClientset is returned when the passed configuration options failed to properly configure a
	// clientset.
	ErrFailedToInitializeClientset = errors.New("did not initialize gloo clientset")
)

Functions

func CreateVirtualHostRoute

func CreateVirtualHostRoute(name string, matchers []*matchers.Matcher,
	action *gatewayapiv1.Route_RouteAction) *gatewayapiv1.Route

CreateVirtualHostRoute returns a Virtual Host route that binds a set of matchers with an action. TODO: Support other Action types.

func CreateVirtualHostRouteAction

func CreateVirtualHostRouteAction(namespace string, upstreamName string) *gatewayapiv1.Route_RouteAction

CreateVirtualHostRouteAction returns a route action that points to a single upstream. `namespace` is the upstream namespace. Unless Gloo was installed directly in a namespace, this will typically be the Gloo namespace.

func CreateVirtualHostRouteExactMatcher

func CreateVirtualHostRouteExactMatcher(matcher string) *matchers.Matcher

CreateVirtualHostRouteExactMatcher returns an exact route matcher. The route of the request must match the exact string for this matcher to pass.

func CreateVirtualHostRoutePrefixMatcher

func CreateVirtualHostRoutePrefixMatcher(matcher string) *matchers.Matcher

CreateVirtualHostRoutePrefixMatcher returns a prefix route matcher. The route of the request must be prefixed with the matcher string for this matcher to pass.

func CreateVirtualHostRouteRegexMatcher

func CreateVirtualHostRouteRegexMatcher(matcher string) *matchers.Matcher

CreateVirtualHostRouteRegexMatcher returns a regex route matcher. The route of the request must match with the passed regex for this matcher to pass.

func RemoveVirtualServiceRoute

func RemoveVirtualServiceRoute(ctx context.Context, gloo Clientset, glooNamespace string,
	virtualServiceName string, routes ...*gatewayapiv1.Route) (*gatewayv1.VirtualService, error)

RemoveVirtualServiceRoute removes a set of Gloo Virtual Service routes. The `virtualService` parameter is used to select the virtual service from which to remove paths.

func UpsertVirtualServiceRoute

func UpsertVirtualServiceRoute(ctx context.Context, gloo Clientset, glooNamespace string,
	virtualServiceName string, routes ...*gatewayapiv1.Route) (*gatewayv1.VirtualService, error)

UpsertVirtualServiceRoute inserts or updates a set of Gloo Virtual Service routes. The `virtualService` parameter is used to select the virtual service to add paths to.

Types

type Clientset

type Clientset interface {
	// Gloo returns a Gloo client. This client can be used to interact with Gloo CRDs in a target Kubernetes cluster.
	// Available Gloo resources include Artifacts, Endpoints, Proxies, Secrets, Settings, Upstreams and Upstream Groups.
	Gloo() gloo.GlooV1Interface
	// Gateway returns a Gloo Gateway client. This client can be used to interact with Gloo CRDs in a target Kubernetes
	// cluster.
	// Available Gateway resources include Gateways, Route Tables and Virtual Services.
	Gateway() gateway.GatewayV1Interface
}

Clientset contains the set of supported Kubernetes CRD Gloo interfaces.

func NewClientset

func NewClientset(ctx context.Context, config *ClientsetConfig) (Clientset, error)

NewClientset creates a new instance of the Gloo client.

type ClientsetConfig

type ClientsetConfig struct {
	// KubeConfig contains the target Kubernetes cluster's connection configuration.
	KubeConfig *restclient.Config
	// IsGoTest indicates if the clientset is being created for a test. If it is, a fake implementation will be
	// returned.
	IsGoTest bool
	// ConnectToCloudServices indicates that the clientset should be able to connect to cloud services and perform
	// persistent operations.
	ConnectToCloudServices bool
}

ClientsetConfig is used to initialize a Gloo clientset,

Jump to

Keyboard shortcuts

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