Documentation ¶
Overview ¶
Package jsonconv provides functions to encode and decode JSON string literals
Index ¶
- func AppendQuote(dest []byte, s string) []byte
- func AppendQuoteBytes(dest, s []byte) []byte
- func AppendQuoteBytesEscapeHTML(dest, s []byte) []byte
- func AppendQuoteEscapeHTML(dest []byte, s string) []byte
- func IsValidNumber(s string) bool
- func IsValidNumberBytes(s []byte) bool
- func Unquote(s []byte) (t string, ok bool)
- func UnquoteBytes(s []byte) (t []byte, ok bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppendQuote ¶
AppendQuote appends the string s to dest as a quoted JSON string literal, escaping as necessary.
func AppendQuoteBytes ¶
AppendQuoteBytes appends the string stored in s to dest as a quoted JSON string literal, escaping as necessary.
func AppendQuoteBytesEscapeHTML ¶
AppendQuoteBytesEscapeHTML behaves as AppendQuoteBytes but also escapes <, >, and &
func AppendQuoteEscapeHTML ¶
AppendQuoteEscapeHTML behaves as AppendQuote but also escapes <, >, and &
func IsValidNumber ¶
IsValidNumber reports whether s is a valid JSON number literal.
func IsValidNumberBytes ¶
IsValidNumberBytes reports whether s is a valid JSON number literal.
func Unquote ¶
Unquote converts a quoted JSON string literal s into an actual string t. The rules are different than for Go, so cannot use strconv.Unquote.
func UnquoteBytes ¶
Types ¶
This section is empty.