Help us shape the future of Go! Take the 2026 Go Developer Survey

platformgateway

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Overview

Package platformgateway contains platform-gateway-specific integration steps.

Package platformgateway contains platform-gateway-specific integration steps.

Index

Constants

View Source
const (
	ManagementBasePath = "/api/management/v1"
)

API base paths, kept in sync with the gateway's OpenAPI documents.

Variables

This section is empty.

Functions

func AwaitDeletionApplied

func AwaitDeletionApplied(
	ctx context.Context, client *httpx.Client, adminURL, version, authorization, handle string,
) error

AwaitDeletionApplied waits, on a Gateway release with the xDS snapshot race, until the controller has applied the deletion of handle, so the next change reaches it in a later poll.

Releases before 1.2.0 apply each change from an event the controller polls for every three seconds, and rebuild the route snapshot on a goroutine per event, without a lock (fixed in 1.2.0 by "fix(xds): add mutex to SnapshotManager.UpdateSnapshot"). A deletion and a creation applied in the same poll race, and the deletion's rebuild can publish last, leaving the new resource without a route. The controller's config dump drops the handle when its poll applies the deletion, so once the handle is gone a later creation is applied in a later poll. A kind the dump does not list never rebuilds the route snapshot, so it passes at once. Later releases are not polled.

func BasicAuthHeader

func BasicAuthHeader(user, pass string) string

BasicAuthHeader returns the Authorization header value carrying the supplied credentials as HTTP Basic authentication.

func CleanupKindForResource added in v0.3.0

func CleanupKindForResource(kind string) (cleanup.Kind, error)

CleanupKindForResource returns the cleanup kind that deletes a resource of the kind a step names ("API", "MCP proxy", ...).

func ControllerEndpoints added in v0.3.0

func ControllerEndpoints(topo *runtime.Topology) (management, admin string, err error)

ControllerEndpoints returns the management and admin API base URLs of the topology's gateway controller, in the base paths of the Gateway release under test. They are what a client outside the suite, such as the ap CLI, is configured with.

func ManagementBasePathForVersion

func ManagementBasePathForVersion(version string) string

ManagementBasePathForVersion returns the management API base path for a Gateway release.

func Register

func Register(sc *godog.ScenarioContext, base Base, topo *runtime.Topology, funnel *httpx.Funnel)

Register binds all platform-gateway-specific steps.

func RegisterDeleters

func RegisterDeleters(reg *cleanup.Registry, topo *runtime.Topology)

RegisterDeleters registers how the cleanup sweep deletes each resource kind a gateway scenario creates, through the management API of the topology's platform-gateway. A resource that is already gone counts as deleted. On releases where the next scenario's resource could lose its route to the controller's snapshot race, the sweep also waits until the controller has applied the deletion.

func RenderResourceTemplate added in v0.3.0

func RenderResourceTemplate(
	ctx context.Context, topo *frameworkruntime.Topology, featureRoot, kind, templateName string, table *godog.Table,
) (string, error)

RenderResourceTemplate renders the canonical template of a resource kind ("API", "MCP proxy", ...) with a scenario's values table, in the request contract of the Gateway release under test. It is for steps that hand the document to another client, such as the ap CLI, instead of posting it to the management API themselves.

Types

type Base

type Base interface {
	FeatureRoot() string
	GatewayURL(path string) (string, error)
	GatewayURLAt(ordinalWord, path string) (string, error)
	ScenarioHeaders(ctx context.Context) map[string]string
	InvokeWith(ctx context.Context, method, path string, headers map[string]string, body []byte) error
	RequestHost(ctx context.Context) string
	ResetRequest(ctx context.Context) error
	SendUntilHeader(ctx context.Context, method, path, name, want string) error
}

Base provides the suite-wide request and scenario mechanics used by gateway steps.

type Gateway

type Gateway struct {
	// contains filtered or unexported fields
}

type Steps

type Steps struct {
	// contains filtered or unexported fields
}

Steps provides health checks for the platform gateway services.

Jump to

Keyboard shortcuts

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