scopes

package
v0.0.0-...-f4b31ea Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamKeyStableVersionServicePath = "stable_version_service_path"
	ParamKeyInventoryServicePath     = "inventory_service_path"
	ParamKeySwarmingTaskID           = "swarming_task_id"
	ParamKeySwarmingTaskTags         = "swarming_task_tags"
	ParamKeyBuildbucketID            = "buildbucket_id"
	ParamKeyCTRClient                = "ctr_client"
)

Variables

This section is empty.

Functions

func GetParam

func GetParam(ctx context.Context, key string) (val any, ok bool)

GetParam returns value and bool if key is present in the params.

func PutConfigParam

func PutConfigParam(ctx context.Context, key string, val any)

PutConfigParam sets value to config scope to be available in the config context.

func ReadConfigParam

func ReadConfigParam(ctx context.Context, key string) (val any, ok bool)

ReadConfigParam read and returns value from config scope.

Also provide a bool if key is found or not.

func WithConfigScope

func WithConfigScope(ctx context.Context) context.Context

WithConfigScope inits map to create scope for a configuration variables.

func WithParams

func WithParams(ctx context.Context, params ParamsMap) context.Context

WithParams sets params value map to the context.

Types

type ParamsMap

type ParamsMap = map[string]any

ParamsMap is a special type to describe mapping of params of context

func GetParamCopy

func GetParamCopy(ctx context.Context) ParamsMap

GetParamCopy returns a copy of params from the context. Please use the `GetParam` method if you need check for presence of a key or get its value.

Jump to

Keyboard shortcuts

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