beltctx

package
v0.0.0-...-183aff7 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: BSD-3-Clause Imports: 4 Imported by: 15

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Artifacts deprecated

func Artifacts(ctx context.Context) belt.Artifacts

Artifacts returns the collection of Artifacts in the scope of the Belt.

Do not modify the output of this function! It is for reading only.

Deprecated: use belt.GetArtifacts, instead.

func Belt deprecated

func Belt(ctx context.Context) *belt.Belt

Belt returns the Belt from context values. Returns the default observer if one is not set in the context.

Deprecated: use belt.CtxBelt, instead.

func Fields deprecated

func Fields(ctx context.Context) field.AbstractFields

Fields returns returns the set of fields set in the scope of this Belt.

Do not modify the output of this function! It is for reading only.

Deprecated: use belt.GetFields, instead.

func Flush deprecated

func Flush(ctx context.Context)

Flush forces to flush all buffers of all the tools.

Deprecated: use belt.Flush, instead.

func Tools deprecated

func Tools(ctx context.Context) belt.Tools

Tools returns the current collection of Tools.

Do not modify the output of this function! It is for reading only.

Deprecated: use belt.GetTools, instead.

func TraceIDs deprecated

func TraceIDs(ctx context.Context) belt.TraceIDs

TraceIDs returns the current set of TraceID-s.

Do not modify the output of this function! It is for reading only.

Deprecated: use belt.GetTraceIDs, instead.

func WithArtifact deprecated

func WithArtifact(ctx context.Context, artifactID belt.ArtifactID, artifact belt.Artifact) context.Context

WithArtifact returns a derivative of the context, but with the Artifact set.

Deprecated: use belt.WithArtifact, instead.

func WithBelt deprecated

func WithBelt(ctx context.Context, belt *belt.Belt) context.Context

WithBelt returns a context derivative which includes the Belt as a value.

Deprecated: use belt.CtxWithBelt, instead.

func WithField deprecated

func WithField(ctx context.Context, key string, value interface{}, props ...field.Property) context.Context

WithField returns a context with a clone/derivative of the Belt which includes the passed value.

The value is used by observability tooling. For example a Logger derived from the resulting Belt may add this value to the structured fields of each log entry.

Deprecated: use belt.WithField, instead.

func WithFields deprecated

func WithFields(ctx context.Context, fields field.AbstractFields) context.Context

WithFields is the same as WithField, but adds multiple Fields at the same time.

It is more performance efficient than adding fields by one.

Deprecated: use belt.WithFields, instead.

func WithMap deprecated

func WithMap(ctx context.Context, m map[string]interface{}, props ...field.Property) context.Context

WithMap is just a sugar method, which provides logrus like way of adding fields. Effectively the same as WithFields, just the argument are in another format.

Deprecated: use belt.WithMap, instead.

func WithTool deprecated

func WithTool(ctx context.Context, toolID belt.ToolID, tool belt.Tool) context.Context

WithTool returns a context with an Belt clone/derivative, but the provided tool added to the collection of tools.

Special case: to remove a specific tool, just passed an untyped nil as `tool`.

Deprecated: use belt.WithTool, instead.

func WithTraceID deprecated

func WithTraceID(ctx context.Context, traceIDs ...belt.TraceID) context.Context

WithTraceID returns a context with an Belt clone/derivative with the passed traceIDs added to the set of TraceIDs.

Deprecated: use belt.WithTraceID, instead.

Types

This section is empty.

Jump to

Keyboard shortcuts

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