Versions in this module Expand all Collapse all v0 v0.4.1 Nov 13, 2026 v0.4.0 Nov 2, 2026 Changes in this version + const DefaultMaxDepth + const DefaultMaxInputBytes + const DefaultMaxItems + const DefaultMaxLayers + const DefaultMaxText + const Version + var ErrBound = stderrors.New("wire: bound exceeded") + var ErrMalformed = stderrors.New("wire: malformed") + var ErrNil = stderrors.New("wire: nil error") + var ErrNotAcceptable = stderrors.New("wire: no acceptable codec") + var ErrUnsupportedMediaType = stderrors.New("wire: unsupported media type") + var ErrVersion = stderrors.New("wire: unknown version") + func Marshal(err error, c Codec, opts ...Option) ([]byte, error) + func RegisterLayer(kind string, c LayerCodec) + func RegisterLeaf(kind string, err error) + func Unmarshal(b []byte, c Codec, opts ...Option) (error, error) + type Attr struct + Key string + Value Value + type BoundedDecoder interface + DecodeBounded func(b []byte, limits Limits) (*Error, error) + type Codec interface + Decode func([]byte) (*Error, error) + Encode func(*Error) ([]byte, error) + MediaType func() string + var JSON Codec = jsonCodec{} + type Conflict struct + Kind string + Layer bool + Reason Reason + func Conflicts() []Conflict + type Encoder struct + func NewEncoder(codecs []Codec, opts ...Option) *Encoder + func (e *Encoder) Encode(err error, accept string, opts ...Option) ([]byte, string, error) + type Error struct + Root *Layer + Version uint32 + func FromError(err error, opts ...Option) (*Error, error) + func (m *Error) ToError(opts ...Option) (error, error) + type Form int32 + const FormFull + const FormJoined + const FormLeaf + const FormPrefix + const FormTransparent + const FormUnspecified + type Frame struct + File string + Function string + Line int64 + type Layer struct + Causes []*Layer + Form Form + Kind string + Payload Payload + Structural bool + Text string + TypeName string + type LayerCodec interface + Decode func(attrs []Attr, cause error) (error, error) + Encode func(err error) ([]Attr, error) + type Limits struct + MaxDepth int + MaxItems int + MaxLayers int + MaxText int + type Option func(*options) + func WithMaxDepth(n int) Option + func WithMaxInputBytes(n int) Option + func WithMaxItems(n int) Option + func WithMaxLayers(n int) Option + func WithMaxText(n int) Option + func WithStacks() Option + type Payload struct + Attrs []Attr + Frames []Frame + Text *string + type Readers struct + func NewReaders(codecs []Codec, opts ...Option) *Readers + func (r *Readers) Decode(mediaType string, b []byte, opts ...Option) (error, error) + type Reason int + const Ambiguous + const Reserved + const Uncomparable + func (r Reason) String() string + type Value struct + Bool bool + Duration time.Duration + Float64 float64 + Group []Attr + Int64 int64 + Kind ValueKind + String string + Time time.Time + Uint64 uint64 + type ValueKind int32 + const ValueBool + const ValueDuration + const ValueFloat64 + const ValueGroup + const ValueInt64 + const ValueString + const ValueTime + const ValueUint64 + const ValueUnknown