Help us shape the future of Go! Take the 2026 Go Developer Survey

context

package
v1.9.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSensitiveKeys added in v1.9.2

func AddSensitiveKeys(keys []string)

AddSensitiveKeys registers additional context keys that should be redacted from JSON responses. Keys are matched case-insensitively.

Types

type Context

type Context map[string]any

func New

func New(v any) *Context

func (Context) MarshalJSON added in v1.9.2

func (c Context) MarshalJSON() ([]byte, error)

MarshalJSON redacts sensitive fields for API responses. Internal helpers (String, Unmarshal) marshal the underlying map so plugins and DB storage still see real secrets.

func (*Context) String

func (c *Context) String() string

func (*Context) Unmarshal

func (c *Context) Unmarshal(v any) error

func (*Context) UnmarshalJSON

func (c *Context) UnmarshalJSON(data []byte) error

func (*Context) UnmarshalYAML

func (c *Context) UnmarshalYAML(unmarshal func(any) error) error

Jump to

Keyboard shortcuts

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