json5

package
v0.0.0-...-d47e5ee Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TokenColon   TokenType = "':'"
	TokenComma   TokenType = "','"
	TokenLBrace  TokenType = "'{'"
	TokenRBrace  TokenType = "'}'"
	TokenLSquare TokenType = "'['"
	TokenRSquare TokenType = "']'"
	TokenPlus    TokenType = "'+'"
	TokenMinus   TokenType = "'-'"
)

Variables

This section is empty.

Functions

func Load

func Load(path string, v interface{}) error

Load is a convenience function to load a JSON5 document into the value pointed at by v. It is functionally equivalent to NewDecoder(<file at path>).Decode(v).

func Marshal

func Marshal(v interface{}) ([]byte, error)

func MarshalIndent

func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error)

func MarshalJSON

func MarshalJSON(v interface{}) ([]byte, error)

func NewDecoder

func NewDecoder(rd io.Reader) encoding.Decoder

func NewEncoder

func NewEncoder(out io.Writer) encoding.Encoder

func Save

func Save(path string, v interface{}) error

Save is a convenience function to save the value pointed at by v into a JSON5 document at path. It is functionally equivalent to NewEncoder(<file at path>).Encode(v).

Types

type EncoderOption

type EncoderOption func(*encoder)

func JSON

func JSON() EncoderOption

func Prefix

func Prefix(prefix string) EncoderOption

Jump to

Keyboard shortcuts

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