response

package
v0.0.0-...-fb1cdef Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 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    `xml:"response" json:"-"`
	Code     int         `xml:"-" json:"-"`
	Response interface{} `xml:",chardata" json:"response,omitempty"`
}

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 NewError

func NewError(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