redact

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package redact describes errors and panic values by their kinds and codes, never their text, for the logs and spans the framework records anywhere but under aicoded dev in environment `dev`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dev

func Dev(ctx context.Context) bool

Dev reports whether ctx carries a runner session of aicoded dev in environment `dev`, whose data is synthetic.

func Error

func Error(err error) string

Error describes err without its text: every error of err's tree, outer first, by its kind. A kind is the name of a sentinel, an E-code, a status code or another kind that Kind added, and otherwise the error's Go type. A wrapped error follows its wrapper after ": ", and the errors that one error joins follow it in brackets. The errors of fmt.Errorf and errors.Join have no kind of their own, and the error a *connect.Error wraps is its message, so it is left out. A nil err is "<nil>", as fmt writes it.

func For

func For(ctx context.Context, err error) string

For returns err's text under aicoded dev in environment `dev`, and Error(err) in any other environment or with no runner.

func Kind

func Kind[T error](kind func(T) string)

Kind makes Error name every error of type T by kind. Packages call it from init.

func Sentinel

func Sentinel(err error, name string)

Sentinel makes Error name err, a sentinel error, as name. Packages call it from init.

func Value

func Value(v any) string

Value describes a panic's value: Error for an error, and the value's Go type otherwise.

func ValueFor

func ValueFor(ctx context.Context, v any) string

ValueFor returns a panic's value as fmt.Sprint writes it under aicoded dev in environment `dev`, and Value(v) in any other environment or with no runner.

Types

This section is empty.

Jump to

Keyboard shortcuts

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