middleware

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetUpMiddleware

func SetUpMiddleware(router *mux.Router)

SetUpMiddleware contains the middleware that applies to every request. Reference middlewares here --> https://github.com/urfave/negroni#logger and here --> https://github.com/go-chi/chi The Google example here should be used as an additional base element for the architecture: https://blog.golang.org/context

func SetupAuth

func SetupAuth(router *mux.Router)

SetupAuth - Will enable authentication middleware if appropriate environment variables are set. For now, will always setup and will add future flags when needed to support on/off + diff authentication styles The assumption for all users as that this will setup the auth only, the determination of correct level of auth will be determined by the api functions themselves

func SetupCORS

func SetupCORS(router *mux.Router)

SetupCORS - Eables CORS Middleware. Presently usurping all Options requests (TODO: Future Optional)

func SetupErrorHandler

func SetupErrorHandler(router *mux.Router)

SetupErrorHandler - Will setup last resort error handler For now, will always setup and will add future flags when needed to support on/off For now I am not writing a speific http response here but that may be the right thing to do eventually. Preference is these are all exception to rule so no need The assumption is this is the last middleware to be called to enable the most available context to be available for error logging separately

Types

This section is empty.

Jump to

Keyboard shortcuts

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