beautyrest

package module
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 19 Imported by: 0

README

beautyrest

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BeautyPrint *beautyPrinter
View Source
var ReportErrorFunc func(err error, r *http.Request) error

Functions

func HandleRoute

func HandleRoute(route string, get interface{}, post interface{}, put interface{}, delete interface{})

func InitBeautyPrinter

func InitBeautyPrinter(basePath string, requestsPath string, responsesPath string)

func TestDeleteEndpoint

func TestDeleteEndpoint(path string, body interface{}, responseStruct interface{}, idToken string) error

func TestGetEndpoint

func TestGetEndpoint(path string, responseStruct interface{}, idToken string) error

func TestPostEndpoint

func TestPostEndpoint(path string, body interface{}, responseStruct interface{}, idToken string) error

func TestPutEndpoint

func TestPutEndpoint(path string, body interface{}, responseStruct interface{}, idToken string) error

func WrapEndpointHandlers

func WrapEndpointHandlers(handlers EndpointHandlers) func(http.ResponseWriter, *http.Request)

Types

type AuthInterface

type AuthInterface interface {
	MakeFromRequest(r *http.Request) (interface{}, error)
}

type EndpointHandlers

type EndpointHandlers struct {
	Get    interface{}
	Post   interface{}
	Put    interface{}
	Delete interface{}
}

Jump to

Keyboard shortcuts

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