encoder

package
v0.0.0-...-1140765 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcceptType

type AcceptType = string
const (
	ApplicationJSON AcceptType = "application/json"
	ApplicationXML  AcceptType = "application/xml"
)

type Encoder

type Encoder interface {
	Encode(data interface{}) ([]byte, error)
	Decode(data []byte, dst interface{}) error
}

func NewJSON

func NewJSON() Encoder

func NewXML

func NewXML() Encoder

type Factory

type Factory interface {
	Create(resp *http.Response) Encoder
}

func NewFactory

func NewFactory() Factory

type FactoryMock

type FactoryMock struct {
	mock.Mock
}

func (*FactoryMock) Create

func (f *FactoryMock) Create(resp *http.Response) Encoder

type Mock

type Mock struct {
	mock.Mock
}

func (*Mock) Decode

func (e *Mock) Decode(data []byte, dst interface{}) error

func (*Mock) Encode

func (e *Mock) Encode(data interface{}) ([]byte, error)

Jump to

Keyboard shortcuts

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