json

package
v0.0.0-...-edf7215 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicErrorMapper

func BasicErrorMapper(err error) ([]byte, int)

func JsonHealthEncoder

func JsonHealthEncoder(health crossbowhttp.ServerHealth) ([]byte, int)

Types

type JsonMarshaller

type JsonMarshaller[M any, O any] struct {
	JsonErrorMapper func(error) ([]byte, int)
}

func (*JsonMarshaller[M, O]) Decode

func (j *JsonMarshaller[M, O]) Decode(r *http.Request) (M, error)

func (*JsonMarshaller[M, O]) Encode

func (j *JsonMarshaller[M, O]) Encode(val O, err error) ([]byte, int, error)

func (*JsonMarshaller[M, O]) MapError

func (j *JsonMarshaller[M, O]) MapError(err error) ([]byte, int)

type ServerHealthJson

type ServerHealthJson struct {
	Fails      uint64 `json:"fails"`
	Panics     uint64 `json:"panics"`
	MailboxLen int    `json:"mailbox_length"`
	Terminated bool   `json:"terminated"`
}

Jump to

Keyboard shortcuts

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