render

package
v0.0.0-...-37004a0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(ctx context.Context, err error, w http.ResponseWriter, log *log.Logger)

Error processes internal errors and returns a JSON response.

func Success

func Success(ctx context.Context, data any, statusCode int, w http.ResponseWriter, log *log.Logger)

Success processes successful requests and returns a JSON response.

Types

type ErrorReason

type ErrorReason string

ErrorReason is the reason for the error

const (
	ReasonAPIError     ErrorReason = "api_error"
	ReasonRequestError ErrorReason = "request_error"
)

Jump to

Keyboard shortcuts

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