jsend

package
v0.12.6 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCodeRequestFatalError string
)

Functions

func NewResponsesHandler

func NewResponsesHandler(
	mode *goflagsmode.Flag,
	encoder gonethttpresponse.Encoder,
) (*gonethttpresponsehandler.ResponsesHandler, error)

NewResponsesHandler creates a new default response handler

Parameters:

  • mode: The flag mode
  • encoder: The HTTP response encoder

Returns:

  • *ResponsesHandler: The default handler
  • error: The error if any

Types

type RawErrorHandler

type RawErrorHandler struct{}

RawErrorHandler struct

func NewRawErrorHandler

func NewRawErrorHandler() *RawErrorHandler

NewRawErrorHandler creates a new default response handler

Returns:

  • *ResponsesHandler: The default handler

func (RawErrorHandler) HandleRawError

func (r RawErrorHandler) HandleRawError(
	w http.ResponseWriter,
	err error,
	handleResponseFn func(
		w http.ResponseWriter,
		response gonethttpresponse.Response,
	),
)

HandleRawError handles the raw error response

Parameters:

  • w: The HTTP response writer
  • err: The error to handle
  • handleResponseFn: The function to handle the response

Jump to

Keyboard shortcuts

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