Skip to content

Go package for standardize web service functionality across our library's go projects

License

Notifications You must be signed in to change notification settings

caltechlibrary/wsfn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wsfn

wsfn is a package for common web functions Caltech Library uses in various Golang based Caltech Library tools and services. The goal is to standardize our handling of web interactions.

  • wsfn.CORSPolicy is a structure for adding CORS headers to a http Handler
  • StaticRouter is a http Handler Function for working with static routes
  • RedirectRouter handles simple target prefix, destination prefix redirect handling
    • AddRedirectRoute adds a target prefix and destination prefix
    • HasRedirectRoutes return true if any redirect routes are configured
    • RedirectRouter uses the internal redirect data to handle redirects
  • ReverseProxy router lets front other web services.

An example webserver is also provided to demonstrate some of the functionality available with this package. The webserver is intended for instructional purposes only and shouldn't be used in a production setting.