rest

package
v0.0.0-...-0a0b1f3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CorsHandler

func CorsHandler(w http.ResponseWriter, r *http.Request)

CorsHandler swagger:route OPTIONS /

Handler to respond to CORS preflight requests

Responses:

200: OK

func NewAPIContext

func NewAPIContext(bindAddress *string, hr application.HealthRepository, br application.BookInfoRepository) *http.Server

NewAPIContext returns a new APIContext handler with the given logger

Types

type APIContext

type APIContext struct {
	// contains filtered or unexported fields
}

APIContext handler for getting and updating Ratings

func (*APIContext) GetBookInfo

func (apiContext *APIContext) GetBookInfo(rw http.ResponseWriter, r *http.Request)

GetBookInfo gets the bookInfos of the Titanic with the given id

func (*APIContext) GetBooks

func (apiContext *APIContext) GetBooks(rw http.ResponseWriter, r *http.Request)

GetBooks gets the tree of all the bookInfos inside a space.

func (*APIContext) Index

func (p *APIContext) Index(rw http.ResponseWriter, r *http.Request)

Index returns OK handles GET requests

func (*APIContext) Live

func (ctx *APIContext) Live(rw http.ResponseWriter, r *http.Request)

Live handles GET requests

func (*APIContext) MiddlewareValidateNewBookInfo

func (apiContext *APIContext) MiddlewareValidateNewBookInfo(next http.Handler) http.Handler

MiddlewareValidateNewBookInfo Checks the integrity of new bookInfo in the request and calls next if ok

func (*APIContext) Ready

func (ctx *APIContext) Ready(rw http.ResponseWriter, r *http.Request)

Ready handles GET requests

func (*APIContext) Version

func (p *APIContext) Version(rw http.ResponseWriter, r *http.Request)

Version returns the version info for the service by reading from a static file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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