serializer

package
v0.0.0-...-92a07c5 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Serializer

type Serializer interface {
	Encode(w http.ResponseWriter, status int, headers ...http.Header) error
	Decode(w http.ResponseWriter, r *http.Request, data any) error
	ErrorJson(w http.ResponseWriter, err error, status ...int) error
}

Serializer provides an interface to read and write JSON data passed between server and client.

func NewSerializer

func NewSerializer(err bool, msg string, data any) Serializer

NewSerializer instantiates a new serializer struct to carry out encoding/decoding.

Jump to

Keyboard shortcuts

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