response

package
v0.0.0-...-a839d2f Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsIs

type AsIs struct {
	XMLName  xml.Name    `json:"-"                  xml:"response"`
	Code     int         `json:"-"                  xml:"-"`
	Response interface{} `json:"response,omitempty" xml:",chardata"`
}

AsIs - returns payload without any wrapping (even errors).

func (*AsIs) MarshalJSON

func (obj *AsIs) MarshalJSON() ([]byte, error)

func (*AsIs) SetError

func (obj *AsIs) SetError(err error)

SetError - sets error response into object.

func (*AsIs) SetPayload

func (obj *AsIs) SetPayload(object interface{})

SetPayload - sets response payload into object.

type AsObject

type AsObject struct {
	XMLName     xml.Name    `json:"-"                xml:"response"`
	Code        int         `json:"-"                xml:"-"`
	Result      interface{} `json:"result,omitempty" xml:"result,omitempty"`
	ErrorString string      `json:"error,omitempty"  xml:"error,omitempty"`
}

func AsError

func AsError(code int, format string, args ...interface{}) *AsObject

func (AsObject) Error

func (a AsObject) Error() string

func (*AsObject) SetError

func (a *AsObject) SetError(err error)

SetError - sets error response into object.

func (*AsObject) SetPayload

func (a *AsObject) SetPayload(object interface{})

SetPayload - sets response payload into object.

Jump to

Keyboard shortcuts

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