util

package
v0.1.15 Latest Latest
Warning

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

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

Documentation

Overview

Package util provides logging and testing related utility functions.

Index

Examples

Constants

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

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

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) *v2alpha1.ExperimentStatus

OriginalStatus gets the status from the context

Types

This section is empty.

Jump to

Keyboard shortcuts

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