mediatype

package
v0.25.1 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2013 License: MIT, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDecoder

func AddDecoder(format string, decfunc DecoderFunc)

func AddEncoder

func AddEncoder(format string, encfunc EncoderFunc)

Types

type Decoder

type Decoder interface {
	Decode(v interface{}) error
}

type DecoderFunc

type DecoderFunc func(r io.Reader) Decoder

type Encoder

type Encoder interface {
	Encode(v interface{}) error
}

type EncoderFunc

type EncoderFunc func(w io.Writer) Encoder

type MediaType

type MediaType struct {
	Type     string
	MainType string
	SubType  string
	Suffix   string
	Vendor   string
	Version  string
	Format   string
	Params   map[string]string
	// contains filtered or unexported fields
}

func Parse

func Parse(v string) (*MediaType, error)

func (*MediaType) Decode

func (m *MediaType) Decode(v interface{}, body io.Reader) error

func (*MediaType) Decoder

func (m *MediaType) Decoder(body io.Reader) (Decoder, error)

func (*MediaType) Encode

func (m *MediaType) Encode(v interface{}) (*bytes.Buffer, error)

func (*MediaType) Encoder

func (m *MediaType) Encoder(w io.Writer) (Encoder, error)

func (*MediaType) IsVendor

func (m *MediaType) IsVendor() bool

func (*MediaType) String

func (m *MediaType) String() string

Jump to

Keyboard shortcuts

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