Documentation
¶
Overview ¶
Package jwriter contains a JSON writer.
Index ¶
- type BufWriter
- func (w *BufWriter) Base64Bytes(data []byte) error
- func (w *BufWriter) Bool(v bool) error
- func (w *BufWriter) BuildBytes(reuse ...[]byte) ([]byte, error)
- func (w *BufWriter) Close() error
- func (w *BufWriter) DumpTo(out io.Writer) (written int, err error)
- func (w *BufWriter) Flags() Flags
- func (w *BufWriter) Float32(n float32) error
- func (w *BufWriter) Float32Str(n float32) error
- func (w *BufWriter) Float64(n float64) error
- func (w *BufWriter) Float64Str(n float64) error
- func (w *BufWriter) Flush() error
- func (w *BufWriter) Int(n int) error
- func (w *BufWriter) Int8(n int8) error
- func (w *BufWriter) Int8Str(n int8) error
- func (w *BufWriter) Int16(n int16) error
- func (w *BufWriter) Int16Str(n int16) error
- func (w *BufWriter) Int32(n int32) error
- func (w *BufWriter) Int32Str(n int32) error
- func (w *BufWriter) Int64(n int64) error
- func (w *BufWriter) Int64Str(n int64) error
- func (w *BufWriter) IntStr(n int) error
- func (w *BufWriter) RawByte(c byte) error
- func (w *BufWriter) RawBytes(data []byte) error
- func (w *BufWriter) RawBytesWithErr(data []byte, err error) error
- func (w *BufWriter) RawString(s string) error
- func (w *BufWriter) RawTextWithErr(data []byte, err error) error
- func (w *BufWriter) SetFlags(f Flags)
- func (w *BufWriter) Size() int
- func (w *BufWriter) String(s string) error
- func (w *BufWriter) Uint(n uint) error
- func (w *BufWriter) Uint8(n uint8) error
- func (w *BufWriter) Uint8Str(n uint8) error
- func (w *BufWriter) Uint16(n uint16) error
- func (w *BufWriter) Uint16Str(n uint16) error
- func (w *BufWriter) Uint32(n uint32) error
- func (w *BufWriter) Uint32Str(n uint32) error
- func (w *BufWriter) Uint64(n uint64) error
- func (w *BufWriter) Uint64Str(n uint64) error
- func (w *BufWriter) UintStr(n uint) error
- func (w *BufWriter) UintptrStr(n uintptr) error
- type Flags
- type Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufWriter ¶
type BufWriter struct {
Buffer buffer.Buffer
NoEscapeHTML bool
// contains filtered or unexported fields
}
Writer is a JSON writer.
func (*BufWriter) Base64Bytes ¶
Base64Bytes appends data to the buffer after base64 encoding it
func (*BufWriter) BuildBytes ¶
BuildBytes returns writer data as a single byte slice. You can optionally provide one byte slice as argument that it will try to reuse.
func (*BufWriter) Float32Str ¶
func (*BufWriter) Float64Str ¶
func (*BufWriter) RawBytesWithErr ¶
func (*BufWriter) UintptrStr ¶
type Flags ¶
type Flags int
Flags describe various encoding options. The behavior may be actually implemented in the encoder, but Flags field in Writer is used to set and pass them around.
type Writer ¶
type Writer interface {
Flags() Flags
Flush() error
// Close resets the buffer.
Close() error
// RawByte appends raw binary data to the buffer.
RawByte(c byte) error
// RawByte appends raw binary data to the buffer.
RawBytes(data []byte) error
RawBytesWithErr(data []byte, err error) error
RawTextWithErr(data []byte, err error) error
// RawByte appends raw binary data to the buffer.
RawString(s string) error
// Base64Bytes appends data to the buffer after base64 encoding it
Base64Bytes(data []byte) error
Uint8(n uint8) error
Uint16(n uint16) error
Uint32(n uint32) error
Uint(n uint) error
Uint64(n uint64) error
Int8(n int8) error
Int16(n int16) error
Int32(n int32) error
Int(n int) error
Int64(n int64) error
Uint8Str(n uint8) error
Uint16Str(n uint16) error
Uint32Str(n uint32) error
UintStr(n uint) error
Uint64Str(n uint64) error
UintptrStr(n uintptr) error
Int8Str(n int8) error
Int16Str(n int16) error
Int32Str(n int32) error
IntStr(n int) error
Int64Str(n int64) error
Float32(n float32) error
Float32Str(n float32) error
Float64(n float64) error
Float64Str(n float64) error
Bool(v bool) error
String(s string) error
}
Click to show internal directories.
Click to hide internal directories.