libtracker

package
v1.0.0-rc.11 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKeyRequestID = contextKey("request_id")
View Source
var ContextKeySpanID = contextKey("span_id")
View Source
var ContextKeyTraceID = contextKey("trace_id")

Functions

func CopyTrackingValues

func CopyTrackingValues(src context.Context, dst context.Context) context.Context

func DefaultRedactedFields

func DefaultRedactedFields() []string

func WithNewRequestID added in v0.28.0

func WithNewRequestID(ctx context.Context) context.Context

Types

type ActivityTracker

type ActivityTracker interface {
	Start(
		ctx context.Context,
		operation string,
		subject string,
		kvArgs ...any,
	) (
		reportErr func(err error),
		reportChange func(id string, data any),
		end func(),
	)
}

func NewChainedTracker

func NewChainedTracker(trackers ...ActivityTracker) ActivityTracker

func NewLogActivityTracker

func NewLogActivityTracker(logger *slog.Logger, opts ...LogOption) ActivityTracker

func NewTextActivityTracker added in v0.28.0

func NewTextActivityTracker(w io.Writer, opts ...LogOption) ActivityTracker

type ChainedTracker

type ChainedTracker []ActivityTracker

func (ChainedTracker) Start

func (ct ChainedTracker) Start(
	ctx context.Context,
	operation string,
	subject string,
	kvArgs ...any,
) (
	reportErr func(err error),
	reportChange func(id string, data any),
	end func(),
)

type LogOption

type LogOption func(*logActivityTracker)

func WithRedactedFields

func WithRedactedFields(names ...string) LogOption

type NoopTracker

type NoopTracker struct{}

func (NoopTracker) Start

func (NoopTracker) Start(
	ctx context.Context,
	operation string,
	subject string,
	kvArgs ...any,
) (
	func(error),
	func(string, any),
	func(),
)

Jump to

Keyboard shortcuts

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