docs/stdlib-json.md

Summary

Maintainability
Test Coverage

[//]: <> (Generated by ugodoc. DO NOT EDIT.)

# `json` Module

## Types

### encoderOptions

Go Type

```go
// EncoderOptions represents the encoding options (quote, html escape) to
// Marshal any Object.
type EncoderOptions struct {
    ugo.ObjectImpl
    Value      ugo.Object
    Quote      bool
    EscapeHTML bool
}
```

#### encoderOptions Getters

| Selector  | Return Type |
|:----------|:------------|
|.Value     | any         |
|.Quote     | bool        |
|.EscapeHTML| bool        |

#### encoderOptions Setters

| Selector  | Value Type  |
|:----------|:------------|
|.Value     | any         |
|.Quote     | bool        |
|.EscapeHTML| bool        |

### rawMessage

Go Type

```go
// RawMessage represents raw encoded json message to directly use value of
// MarshalJSON without encoding.
type RawMessage struct {
    ugo.ObjectImpl
    Value []byte
}
```

#### rawMessage Getters

| Selector  | Return Type |
|:----------|:------------|
|.Value     | bytes       |

#### rawMessage Setters

| Selector  | Value Type  |
|:----------|:------------|
|.Value     | bytes       |

## Functions

`Marshal(v any) -> bytes`

Returns the JSON encoding v or error.

---

`MarshalIndent(v any, prefix string, indent string) -> bytes`

MarshalIndent is like Marshal but applies Indent to format the output.

---

`Indent(src bytes, prefix string, indent string) -> bytes`

Returns indented form of the JSON-encoded src or error.

---

`RawMessage(v bytes) -> rawMessage`

Returns a wrapped bytes to provide raw encoded JSON value to Marshal
functions.

---

`Compact(data bytes, escape bool) -> bytes`

Returns elided insignificant space characters from data or error.

---

`Quote(v any) -> encoderOptions`

Returns a wrapped object to provide Marshal functions to quote v.

---

`NoQuote(v any) -> encoderOptions`

Returns a wrapped object to provide Marshal functions not to quote while
encoding.
This can be used not to quote all array or map items.

---

`NoEscape(v any) -> encoderOptions`

Returns a wrapped object to provide Marshal functions not to escape html
while encoding.

---

`Unmarshal(p bytes) -> any`

Unmarshal parses the JSON-encoded p and returns the result or error.

---

`Valid(p bytes) -> bool`

Reports whether p is a valid JSON encoding.