context

package
v0.0.0-...-2e8aeb9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package context groups the methods used to enrich a context with CrownLabs-related objects.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnvironmentFrom

func EnvironmentFrom(ctx context.Context) *clv1alpha2.Environment

EnvironmentFrom retrieves the environment object from the given context.

func EnvironmentInto

func EnvironmentInto(ctx context.Context, environment *clv1alpha2.Environment) (context.Context, logr.Logger)

EnvironmentInto returns a copy of the context and the respective logger with the given environment embedded.

func InstanceFrom

func InstanceFrom(ctx context.Context) *clv1alpha2.Instance

InstanceFrom retrieves the instance object from the given context.

func InstanceInto

func InstanceInto(ctx context.Context, instance *clv1alpha2.Instance) (context.Context, logr.Logger)

InstanceInto returns a copy of the context and the respective logger with the given instance embedded.

func LoggerFromContext

func LoggerFromContext(ctx context.Context, keysAndValues ...interface{}) logr.Logger

LoggerFromContext returns a logger with predefined values from a context.Context.

func LoggerIntoContext

func LoggerIntoContext(ctx context.Context, log logr.Logger) context.Context

LoggerIntoContext takes a context and sets the logger as one of its values. Use LoggerFromContext function to retrieve the logger.

func TemplateFrom

func TemplateFrom(ctx context.Context) *clv1alpha2.Template

TemplateFrom retrieves the template object from the given context.

func TemplateInto

func TemplateInto(ctx context.Context, template *clv1alpha2.Template) (context.Context, logr.Logger)

TemplateInto returns a copy of the context and the respective logger with the given template embedded.

func TenantFrom

func TenantFrom(ctx context.Context) *clv1alpha2.Tenant

TenantFrom retrieves the tenant object from the given context.

func TenantInto

func TenantInto(ctx context.Context, tenant *clv1alpha2.Tenant) (context.Context, logr.Logger)

TenantInto returns a copy of the context and the respective logger with the given tenant embedded.

Types

This section is empty.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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