Skip to content

Instantly share code, notes, and snippets.

@ayjayt
Created October 31, 2018 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayjayt/d675b85a39a6428c98d93dd8c5a8b9dd to your computer and use it in GitHub Desktop.
Save ayjayt/d675b85a39a6428c98d93dd8c5a8b9dd to your computer and use it in GitHub Desktop.
This is the basic idea behind the just* Go packages for easy API access with http handlers

The basic idea of all just* packages is to

A) Configure their config structures in main.go or wherever you set the http handlers.

B) Import them (or an interface that supports a class of them) when defining your handler.

C) Negotiate with the configurations that main.go has supplied and...

D) Use a closure to return a HandlerFunc for http.HandleFunc or initialize a type

E) Define and instantiate a type that fufills the Handler interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment