Documentation ¶
Overview ¶
Package gzip provides pre-compressed data container.
Index ¶
- func MarshalJSON(v interface{}) ([]byte, error)
- func UnmarshalJSON(data []byte, v interface{}) error
- func WriteCompressedBytes(compressed []byte, w io.Writer) (int, error)
- type JSONContainer
- func (jc JSONContainer) ETag() string
- func (jc JSONContainer) GzipCompressedJSON() []byte
- func (jc JSONContainer) JSONWriteTo(w io.Writer) (int, error)
- func (jc JSONContainer) MarshalJSON() (j []byte, err error)
- func (jc *JSONContainer) PackJSON(v interface{}) error
- func (jc JSONContainer) UnpackJSON(v interface{}) error
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalJSON ¶
MarshalJSON encodes Go value as JSON and compresses result with gzip.
func UnmarshalJSON ¶
UnmarshalJSON decodes compressed JSON bytes into a Go value.
Types ¶
type JSONContainer ¶
type JSONContainer struct {
// contains filtered or unexported fields
}
JSONContainer contains compressed JSON.
func (JSONContainer) ETag ¶
func (jc JSONContainer) ETag() string
ETag returns hash of compressed bytes.
func (JSONContainer) GzipCompressedJSON ¶
func (jc JSONContainer) GzipCompressedJSON() []byte
GzipCompressedJSON returns JSON compressed with gzip.
func (JSONContainer) JSONWriteTo ¶
func (jc JSONContainer) JSONWriteTo(w io.Writer) (int, error)
JSONWriteTo writes JSON payload to writer.
func (JSONContainer) MarshalJSON ¶
func (jc JSONContainer) MarshalJSON() (j []byte, err error)
MarshalJSON returns uncompressed JSON.
func (*JSONContainer) PackJSON ¶
func (jc *JSONContainer) PackJSON(v interface{}) error
PackJSON puts Go value in JSON container.
func (JSONContainer) UnpackJSON ¶
func (jc JSONContainer) UnpackJSON(v interface{}) error
UnpackJSON unmarshals data from JSON container into a Go value.
Click to show internal directories.
Click to hide internal directories.