encoding

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorArgument

type ErrorArgument struct {
	Value       interface{} `json:"value"`
	Description string      `json:"description"`
}

type ErrorArguments

type ErrorArguments map[string]*ErrorArgument

type ErrorDescription

type ErrorDescription struct {
	Friendly  string `json:"friendly"`
	Technical string `json:"technical"`
}

type ErrorDisplayEnvelope

type ErrorDisplayEnvelope struct {
	Domain      string                           `json:"domain"`
	Section     string                           `json:"section"`
	Code        string                           `json:"code"`
	Title       string                           `json:"title"`
	Sensitivity errawr.ErrorSensitivity          `json:"sensitivity,omitempty"`
	Description *ErrorDescription                `json:"description,omitempty"`
	Arguments   map[string]interface{}           `json:"arguments,omitempty"`
	Items       map[string]*ErrorDisplayEnvelope `json:"items,omitempty"`
	Formatted   *ErrorDescription                `json:"formatted,omitempty"`
	Causes      []*ErrorDisplayEnvelope          `json:"causes,omitempty"`
}

func ForDisplay

func ForDisplay(e errawr.Error) *ErrorDisplayEnvelope

func ForDisplayWithSensitivity

func ForDisplayWithSensitivity(e errawr.Error, sensitivity errawr.ErrorSensitivity) *ErrorDisplayEnvelope

func (ErrorDisplayEnvelope) AsError

func (ede ErrorDisplayEnvelope) AsError() errawr.Error

type ErrorDomain

type ErrorDomain struct {
	Key   string `json:"key"`
	Title string `json:"title"`
}

type ErrorItems

type ErrorItems map[string]*ErrorTransitEnvelope

type ErrorMetadata

type ErrorMetadata struct {
	HTTPErrorMetadata *HTTPErrorMetadata `json:"http,omitempty"`
}

type ErrorSection

type ErrorSection struct {
	Key   string `json:"key"`
	Title string `json:"title"`
}

type ErrorTransitEnvelope

type ErrorTransitEnvelope struct {
	Version     uint64                  `json:"version"`
	Domain      ErrorDomain             `json:"domain"`
	Section     ErrorSection            `json:"section"`
	Code        string                  `json:"code"`
	Title       string                  `json:"title"`
	Description ErrorDescription        `json:"description"`
	Arguments   ErrorArguments          `json:"arguments"`
	Items       ErrorItems              `json:"items,omitempty"`
	Metadata    ErrorMetadata           `json:"metadata,omitempty"`
	Causes      []*ErrorTransitEnvelope `json:"causes"`
	Buggy       bool                    `json:"buggy"`
	Sensitivity errawr.ErrorSensitivity `json:"sensitivity"`
}

func ForTransit

func ForTransit(e errawr.Error) *ErrorTransitEnvelope

func (ErrorTransitEnvelope) AsError

func (ete ErrorTransitEnvelope) AsError() errawr.Error

type HTTPErrorMetadata

type HTTPErrorMetadata struct {
	Status  int                 `json:"status"`
	Headers map[string][]string `json:"headers"`
}

Jump to

Keyboard shortcuts

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