bodyParser

package
v0.0.0-...-cb501de Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetString

func GetString(obj interface{}) string

func Marshal

func Marshal(contentType string, v interface{}) ([]byte, error)

func Register

func Register(alias string, contentTypes []string, parser BodyParserInterface)

func Unmarshal

func Unmarshal(contentType string, data []byte, v interface{}) error

Types

type BodyParserInterface

type BodyParserInterface interface {
	Marshal(v interface{}) ([]byte, error)
	Unmarshal(data []byte, v interface{}) error
}

type FormParser

type FormParser struct{}

func (*FormParser) Marshal

func (p *FormParser) Marshal(v interface{}) ([]byte, error)

func (*FormParser) Unmarshal

func (p *FormParser) Unmarshal(data []byte, v interface{}) error

type JsonParser

type JsonParser struct{}

func (*JsonParser) Marshal

func (p *JsonParser) Marshal(v interface{}) ([]byte, error)

func (*JsonParser) Unmarshal

func (p *JsonParser) Unmarshal(data []byte, v interface{}) error

type TextParser

type TextParser struct{}

func (*TextParser) Marshal

func (p *TextParser) Marshal(v interface{}) ([]byte, error)

func (*TextParser) Unmarshal

func (p *TextParser) Unmarshal(data []byte, v interface{}) error

type XmlParser

type XmlParser struct{}

func (*XmlParser) Marshal

func (p *XmlParser) Marshal(v interface{}) ([]byte, error)

func (*XmlParser) Unmarshal

func (p *XmlParser) Unmarshal(data []byte, v interface{}) error

Jump to

Keyboard shortcuts

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