custom-transport

command
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Implementing a custom Transport (renderer / "flatten" policy).

This example demonstrates the policy used by the structured / pretty / console transports: every shape of metadata (map, struct, scalar) is flattened to root-level fields via transport.MergeFieldsAndMetadata.

Reach for this pattern when your backend writes flat key=value lines or a flat JSON object. For an attribute-style backend (zerolog, zap, OTel) see examples/custom-transport-attribute. For an encoder over a protocol (HTTP, Datadog) see transports/datadog/datadog.go.

Run:

go run ./examples/custom-transport

Jump to

Keyboard shortcuts

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