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

common

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: 16 Imported by: 0

Documentation

Overview

Package common contains reusable integration-suite step mechanics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwaitResponse

func AwaitResponse(
	ctx context.Context,
	attempt ResponseAttempt,
	condition ResponseCondition,
	what string,
) error

AwaitResponse polls an operation until condition holds.

The attempt controls error classification. It should wrap transient transport errors with retry.Transient and return programming errors unchanged.

func ConfigureExpansion

func ConfigureExpansion()

ConfigureExpansion installs context-backed expansion for suite placeholders.

func Expand

func Expand(ctx context.Context, value string) (string, error)

Expand resolves unique-name and context-value placeholders in a suite value.

func GenerateAPIVersionAndStore

func GenerateAPIVersionAndStore(ctx context.Context, base, key string) error

GenerateAPIVersionAndStore stores a unique semantic API version.

func GenerateAndStore

func GenerateAndStore(ctx context.Context, base, key string) error

GenerateAndStore creates a unique value and stores it in the runner's local scope.

func GenerateContextAndStore

func GenerateContextAndStore(ctx context.Context, base, key string) error

GenerateContextAndStore creates a unique API context and stores it in runner-local scope.

func GenerateResourceAndStore

func GenerateResourceAndStore(ctx context.Context, base, key string) error

GenerateResourceAndStore creates a unique name accepted by DNS-style resource APIs.

func RenderResourceTemplate

func RenderResourceTemplate(ctx context.Context, name string, content []byte, table *godog.Table) (string, error)

RenderResourceTemplate renders a canonical or legacy suite resource template.

func ResourceTemplatePath

func ResourceTemplatePath(root, name string) (string, error)

ResourceTemplatePath resolves a suite resource template name against the feature root, refusing absolute names and any path, symlinked or not, that escapes the root. A canonical template (resources/templates/<kind>.yaml) the root does not hold resolves to the copy the framework ships, so a project supplies only the templates that differ from it.

func StoredValue

func StoredValue(ctx context.Context, key string) (string, error)

StoredValue returns a generated or otherwise runner-scoped string value.

Types

type ResponseAttempt

type ResponseAttempt func(context.Context) (*httpx.Response, error)

ResponseAttempt obtains one response for a polling operation.

type ResponseCondition

type ResponseCondition func(*httpx.Response) bool

ResponseCondition reports whether a response satisfies a polling condition.

Jump to

Keyboard shortcuts

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