phctx

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2026 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithComponentPaths

func ContextWithComponentPaths(ctx context.Context, paths ComponentPaths) context.Context

ContextWithComponentPaths returns a context with component paths for filtering

func ContextWithFailFast

func ContextWithFailFast(ctx context.Context, failFast bool) context.Context

ContextWithFailFast returns a context with fail-fast behavior enabled/disabled

func ContextWithHops

func ContextWithHops(ctx context.Context, hops Hops) context.Context

ContextWithHops returns a context with hops for loop detection

func ContextWithParallelism

func ContextWithParallelism(ctx context.Context, limit int) context.Context

ContextWithParallelism returns a context with parallelism limit set

func ContextWithViper added in v0.7.0

func ContextWithViper(ctx context.Context, v *viper.Viper) context.Context

ContextWithViper returns a context with viper instance stored

func FailFastFromContext

func FailFastFromContext(ctx context.Context) bool

FailFastFromContext returns the fail-fast setting from context

func Logger

func Logger(ctx context.Context, args ...any) *slog.Logger

Logger returns a logger from context with additional attributes

func NewViper added in v0.7.0

func NewViper() *viper.Viper

NewViper creates an owned viper instance with :: delimiter. The :: delimiter allows dots in component names (e.g., google.com).

func ParallelismFromContext

func ParallelismFromContext(ctx context.Context) int

ParallelismFromContext returns the parallelism limit from context (default 0 = GOMAXPROCS)

func ParallelismLimit

func ParallelismLimit(limit int) int

ParallelismLimit converts the parallelism setting to an actual limit value. Returns -1 for unlimited (don't call SetLimit), or a positive number.

func Viper added in v0.7.0

func Viper(ctx context.Context) *viper.Viper

Viper returns the viper instance from context. Panics if viper was not set - this is a programming error.

Types

type ComponentPaths

type ComponentPaths [][]string // Each path like ["system", "subcomponent"]

ComponentPaths represents hierarchical component paths for filtering health checks

func ComponentPathsFromContext

func ComponentPathsFromContext(ctx context.Context) ComponentPaths

ComponentPathsFromContext returns the component paths from context

type Hops

type Hops []string

Hops represents IDs of the platform-health servers that have been visited

func HopsFromContext

func HopsFromContext(ctx context.Context) Hops

HopsFromContext returns the hops from context

Jump to

Keyboard shortcuts

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