redactor

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoder

type Encoder json.Encoder

Encoder marshals values into JSON with redacted values included. Only use this when persisting to disk and NOT sending over HTTP.

func NewEncoder

func NewEncoder(w io.Writer) *Encoder

NewEncoder creates a new json.Encoder

func (*Encoder) Encode

func (p *Encoder) Encode(v interface{}) error

Encode calls json.Encoder.Encode

func (*Encoder) SetEscapeHTML

func (p *Encoder) SetEscapeHTML(on bool)

SetEscapeHTML calls json.Encoder.SetEscapeHTML

func (*Encoder) SetIndent

func (p *Encoder) SetIndent(prefix, indent string)

SetIndent calls json.Encoder.SetIndent

type String

type String string

String is redacted when marshaling unless using redactor.Encoder

func (String) MarshalJSON

func (s String) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

Jump to

Keyboard shortcuts

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