response

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOK    = "OK"
	StatusError = "Error"
)

Variables

This section is empty.

Functions

func Err

func Err(w http.ResponseWriter, r *http.Request, log *slog.Logger, op string, err error, msg string, httpStatus int)

Types

type Response

type Response struct {
	Status string `json:"status"`
	Error  string `json:"error,omitempty"`
	Data   any    `json:"data,omitempty"`
}

func DataOK

func DataOK(data any) Response

func DataWithError

func DataWithError(msg string, data any) Response

func Error added in v1.2.1

func Error(msg string) Response

func OK

func OK() Response

Jump to

Keyboard shortcuts

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