response

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: MIT Imports: 4 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 NotAutorized

func NotAutorized(w http.ResponseWriter)

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