response

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequest

func BadRequest(w http.ResponseWriter, err error)

func Forbidden

func Forbidden(w http.ResponseWriter, err error)

Forbidden response error

func InternalServerError

func InternalServerError(w http.ResponseWriter, err error)

func NotAuthorized added in v0.4.0

func NotAuthorized(w http.ResponseWriter)

func NotAutorized deprecated

func NotAutorized(w http.ResponseWriter)

Deprecated: Use NotAuthorized instead.

func Ok

func Ok(w http.ResponseWriter, data any)

Done data response

func Paged

func Paged(w http.ResponseWriter, data any, p request.Pager)

Paged data response

func SessionExpired

func SessionExpired(w http.ResponseWriter)

Types

type Detail

type Detail struct {
	// Data of api response
	//
	// it will nil in case of error
	Data any `json:"data"`

	// Error if any occurred during api call
	Error *string `json:"error,omitempty"`

	// Pager is used for paged data response
	Pager *request.Pager `json:"pager,omitempty"`
}

Detail of api response

Jump to

Keyboard shortcuts

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