Documentation ¶
Overview ¶
Package encodeio supply some utility functions for encoding
Index ¶
- func Read(r io.Reader, v interface{}, decoder DecodeFunc) error
- func ReadGOB(r io.Reader, v interface{}) error
- func ReadGZIP(r io.Reader) ([]byte, error)
- func ReadJSON(r io.Reader, v interface{}) error
- func ReadString(r io.Reader) (string, error)
- func ReadXML(r io.Reader, v interface{}) error
- func Write(w io.Writer, v interface{}, encoder EncodeFunc) error
- func WriteGOB(w io.Writer, v interface{}) error
- func WriteGZIP(w io.Writer, v interface{}) (err error)
- func WriteJSON(w io.Writer, v interface{}) error
- func WriteString(w io.Writer, str string) (int, error)
- func WriteXML(w io.Writer, v interface{}) error
- type DecodeFunc
- type EncodeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Write ¶
func Write(w io.Writer, v interface{}, encoder EncodeFunc) error
Write write a interface{} to writer use given encoder
func WriteString ¶
WriteString write string to writer
Types ¶
type DecodeFunc ¶
DecodeFunc decode bytes to a interface{}, interface{} must be pointer
type EncodeFunc ¶
EncodeFunc encode a interface{} to bytes
Click to show internal directories.
Click to hide internal directories.