s11n

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONSerializer

type JSONSerializer[E jsonEncocder, D jsonDecoder] struct {
	Encoder func(w io.Writer) E
	Decoder func(r io.Reader) D
}

JSONSerializer is a JSON serializer for Echo framework.

func (*JSONSerializer[E, D]) Deserialize

func (j *JSONSerializer[E, D]) Deserialize(c echo.Context, i interface{}) error

Deserialize reads the JSON from the request and stores it in i.

func (*JSONSerializer[E, D]) Serialize

func (j *JSONSerializer[E, D]) Serialize(c echo.Context, i interface{}, indent string) error

Serialize writes the JSON encoding of i to the response.

Jump to

Keyboard shortcuts

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