response

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var StatusCtxKey = CtxKeyType(0)

Functions

func Status

func Status(r *http.Request, status int)

func WriteJSON

func WriteJSON(w http.ResponseWriter, r *http.Request, v any)

Types

type CtxKeyType

type CtxKeyType int

type Response

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

func Error

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