errordetails

package
v2.2.1 Latest Latest
Warning

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

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

Documentation

Overview

Package errordetails provides utilities for working with error details.

Index

Constants

View Source
const (
	ErrorInfoType = "type.googleapis.com/google.rpc.ErrorInfo"
	StructType    = "type.googleapis.com/google.protobuf.Struct"
)

Error detail type URLs

Variables

This section is empty.

Functions

This section is empty.

Types

type Typed

type Typed struct {
	TypeURL string
	Value   map[string]any
}

Typed is a wrapper around a value that is marshaled with a type URL.

func NewErrorInfo

func NewErrorInfo(reason string, domain string, metadata map[string]string) *Typed

NewErrorInfo creates a new ErrorInfo error detail.

func NewFromStruct

func NewFromStruct(details map[string]any) *Typed

NewFromStruct creates a new StructType error detail from a map.

func NewTyped

func NewTyped(t string, v map[string]any) *Typed

NewTyped creates a new Typed error detail.

func (*Typed) MarshalJSON

func (w *Typed) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Typed) UnmarshalJSON

func (w *Typed) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

Jump to

Keyboard shortcuts

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