rest

package
v0.0.0-...-f0eb034 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: MIT Imports: 19 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, pr application.DocumentRepository) *http.Server

NewAPIContext returns a new APIContext handler with the given logger func NewAPIContext(dc DBContext, bindAddress *string, ur application.UserRepository) *http.Server {

Types

type APIContext

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

APIContext handler for getting and updating Ratings

func (*APIContext) DeleteDocument

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

DeleteDocument deletes the documents of the Titanic with the given id

func (*APIContext) GetDocument

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

GetDocument gets the documents of the Titanic with the given id

func (*APIContext) GetSpace

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

GetSpace gets the tree of all the documents 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) MiddlewareValidateNewDocument

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

MiddlewareValidateNewDocument Checks the integrity of new document 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