response

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const RenewedAuthTokenHeader = "X-Renewed-Auth-Token"

RenewedAuthTokenHeader : the header name of the renewd auth token.

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {
	Code     int    `json:"code"`
	Domain   string `json:"domain"`
	Message  string `json:"message,omitempty"`
	Reason   string `json:"reason,omitempty"`
	Recovery string `json:"recovery,omitempty"`
	Field    string `json:"field,omitempty"`
}

Error : error with more details.

func (*Error) Error

func (e *Error) Error() string

Error : returns a string.

func (*Error) IsNil

func (e *Error) IsNil() bool

IsNil : returns true if it is an empty struct.

type Response

type Response struct {
	Error  *Error `json:"error,omitempty"`
	Status string `json:"status,omitempty"`
	ID     string `json:"id,omitempty"`
}

Response : structured JSON object

func NewError

func NewError(err Error) Response

NewError : returns a Response struct.

func NewStatus

func NewStatus(status string) Response

NewStatus : returns a new Response struct.

func NewStatusAndID

func NewStatusAndID(status, ID string) Response

NewStatusAndID : returns a new Response struct.

func (*Response) IsErrorNil

func (r *Response) IsErrorNil() bool

IsErrorNil : returns true if it is an empty error.

Jump to

Keyboard shortcuts

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