encoder

package
v0.0.0-...-8688e54 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

type Component interface {
	Render(w io.Writer) error
}

type Encoder

type Encoder struct {
	// contains filtered or unexported fields
}

func NewEncoder

func NewEncoder(logger *zap.SugaredLogger, templates *template.Template) *Encoder

func (*Encoder) EncodeComponent

func (e *Encoder) EncodeComponent(w http.ResponseWriter, r *http.Request, status int, component Component)

func (*Encoder) EncodeError

func (e *Encoder) EncodeError(w http.ResponseWriter, errToEncode error)

func (*Encoder) EncodeHTML

func (e *Encoder) EncodeHTML(w http.ResponseWriter, r *http.Request, status int, contents string)

type HtmlEncoder

type HtmlEncoder interface {
	EncodeHTML(w http.ResponseWriter, r *http.Request, status int, contents string)
	EncodeComponent(w http.ResponseWriter, r *http.Request, status int, component Component)
	EncodeError(w http.ResponseWriter, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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