util

package
v0.1.28 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package util provides logging and testing related utility functions.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompletePath

func CompletePath(prefix string, suffix string) string

CompletePath is a helper function for converting file paths, specified relative to the caller of this function, into absolute ones. CompletePath is useful in tests and enables deriving the absolute path of experiment YAML files.

Example
filePath := CompletePath("../test/data", "expwithextrafields.yaml")
_, _ = ioutil.ReadFile(filePath)

func Logger

func Logger(ctx context.Context) logr.Logger

Logger gets the logger from the context.

func OriginalStatus

func OriginalStatus(ctx context.Context) *v2alpha2.ExperimentStatus

OriginalStatus gets the status from the context

Types

type ContextKey added in v0.1.25

type ContextKey string

ContextKey variables can be used to retrieve values from context object

const (
	// LoggerKey is the key used to extract logger from context
	LoggerKey ContextKey = "logger"

	// OriginalStatusKey is the key used to extract the original status from the context
	OriginalStatusKey ContextKey = "originalStatus"
)

Jump to

Keyboard shortcuts

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