go-jsonerror: github.com/ddymko/go-jsonerror Index | Files

package jsonError

import "github.com/ddymko/go-jsonerror"

Index

Package Files

jsonError.go

type ErrorComp Uses

type ErrorComp struct {
    ID     string `json:"id,omitempty"`
    Status int    `json:"status,omitempty"`
    Code   string `json:"code,omitempty"`
    Title  string `json:"title,omitempty"`
    Detail string `json:"detail,omitempty"`
    Source Source `json:"source,omitempty"`
}

An ErrorComp is a error structure that follows the json spec.

type ErrorJSON Uses

type ErrorJSON struct {
    Errors []ErrorComp
}

An ErrorJSON contains an array of Errors.

func (*ErrorJSON) AddError Uses

func (e *ErrorJSON) AddError(comp ErrorComp)

AddError allows adding fields to the error

func (*ErrorJSON) Error Uses

func (e *ErrorJSON) Error() string

Returns the error in string format

func (*ErrorJSON) ErrorByte Uses

func (e *ErrorJSON) ErrorByte() []byte

ErrorByte returns the error in an []byte

type Source Uses

type Source struct {
    Pointer string `json:"pointer,omitempty"`
}

A Source is represents

Package jsonError imports 1 packages (graph). Updated 2018-11-15. Refresh now. Tools for package owners.