Documentation ¶
Overview ¶
Package context groups the methods used to enrich a context with CrownLabs-related objects.
Index ¶
- func EnvironmentFrom(ctx context.Context) *clv1alpha2.Environment
- func EnvironmentInto(ctx context.Context, environment *clv1alpha2.Environment) (context.Context, logr.Logger)
- func InstanceFrom(ctx context.Context) *clv1alpha2.Instance
- func InstanceInto(ctx context.Context, instance *clv1alpha2.Instance) (context.Context, logr.Logger)
- func LoggerFromContext(ctx context.Context, keysAndValues ...interface{}) logr.Logger
- func LoggerIntoContext(ctx context.Context, log logr.Logger) context.Context
- func TemplateFrom(ctx context.Context) *clv1alpha2.Template
- func TemplateInto(ctx context.Context, template *clv1alpha2.Template) (context.Context, logr.Logger)
- func TenantFrom(ctx context.Context) *clv1alpha2.Tenant
- func TenantInto(ctx context.Context, tenant *clv1alpha2.Tenant) (context.Context, logr.Logger)
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 ¶
LoggerFromContext returns a logger with predefined values from a context.Context.
func LoggerIntoContext ¶
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 ¶
TenantInto returns a copy of the context and the respective logger with the given tenant embedded.
Types ¶
This section is empty.