Home / Type/ Encoder Type — gin Architecture

Encoder Type — gin Architecture

Architecture documentation for the Encoder type/interface in api.go from the gin codebase.

Entity Profile

Dependency Diagram

graph TD
  b89dc818_e351_94e8_b72a_cb5e3ada569d["Encoder"]
  9ca66bd0_28cc_9f2e_12e2_eb2a3002f38c["api.go"]
  b89dc818_e351_94e8_b72a_cb5e3ada569d -->|defined in| 9ca66bd0_28cc_9f2e_12e2_eb2a3002f38c
  style b89dc818_e351_94e8_b72a_cb5e3ada569d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec/json/api.go lines 22–38

type Encoder interface {
	// SetEscapeHTML specifies whether problematic HTML characters
	// should be escaped inside JSON quoted strings.
	// The default behavior is to escape &, <, and > to \u0026, \u003c, and \u003e
	// to avoid certain safety problems that can arise when embedding JSON in HTML.
	//
	// In non-HTML settings where the escaping interferes with the readability
	// of the output, SetEscapeHTML(false) disables this behavior.
	SetEscapeHTML(on bool)

	// Encode writes the JSON encoding of v to the stream,
	// followed by a newline character.
	//
	// See the documentation for Marshal for details about the
	// conversion of Go values to JSON.
	Encode(v any) error
}

Defined In

Frequently Asked Questions

What is the Encoder type?
Encoder is a type/interface in the gin codebase, defined in codec/json/api.go.
Where is Encoder defined?
Encoder is defined in codec/json/api.go at line 22.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free