rest

package
v0.0.0-...-22f568f Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2022 License: MIT Imports: 22 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, io.Closer)

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) AddDocument

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

Adddocument adds a new documents to the Titanic

func (*APIContext) DeleteDocument

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

DeleteDocument deletes the documents of the Titanic with the given id

func (*APIContext) GetDocument

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

GetDocument gets the documents of the Titanic with the given id

func (*APIContext) GetFolder

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

GetFolder gets all the documents and folders inside the specified folder. If no folder is specified, it returns the root folder.

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 (ctx *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) UpdateDocument

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

UpdateDocument updates an existing documents on the Titanic

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