json

package
v0.0.0-...-fab57c2 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package json provides a mockable wrapper for encoding/json.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Impl

type Impl struct{}

func (*Impl) Compact

func (*Impl) Compact(dst *bytes.Buffer, src []byte) error

func (*Impl) HTMLEscape

func (*Impl) HTMLEscape(dst *bytes.Buffer, src []byte)

func (*Impl) Indent

func (*Impl) Indent(dst *bytes.Buffer, src []byte, prefix string, indent string) error

func (*Impl) Marshal

func (*Impl) Marshal(v any) ([]byte, error)

func (*Impl) MarshalIndent

func (*Impl) MarshalIndent(v any, prefix string, indent string) ([]byte, error)

func (*Impl) NewDecoder

func (*Impl) NewDecoder(r io.Reader) *json.Decoder

func (*Impl) NewEncoder

func (*Impl) NewEncoder(w io.Writer) *json.Encoder

func (*Impl) Unmarshal

func (*Impl) Unmarshal(data []byte, v any) error

func (*Impl) Valid

func (*Impl) Valid(data []byte) bool

type Interface

type Interface interface {
	Compact(dst *bytes.Buffer, src []byte) error
	HTMLEscape(dst *bytes.Buffer, src []byte)
	Indent(dst *bytes.Buffer, src []byte, prefix string, indent string) error
	Marshal(v any) ([]byte, error)
	MarshalIndent(v any, prefix string, indent string) ([]byte, error)
	NewDecoder(r io.Reader) *json.Decoder
	NewEncoder(w io.Writer) *json.Encoder
	Unmarshal(data []byte, v any) error
	Valid(data []byte) bool
}

Jump to

Keyboard shortcuts

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