Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CORS ¶
type CORS struct { // Origin is a function that returns a value of // an Access-Control-Allow-Origin header. It cannot be nil. Origin func(r *http.Request) string // Headers is a function that returns a value of // an Access-Control-Allow-Headers header. It cannot be nil. Headers func(r *http.Request) string // Methods is a function that returns a value of // an Access-Control-Allow-Methods. It cannot be nil. Methods func(r *http.Request) string }
CORS adds a basic support for CORS preflight requests.
type Logger ¶
type Logger struct { // Log is an instance of a log.Logger. It cannot be nil, otherwise code will panic. Log log.Logger }
Logger prints logs for each request. If the log level is set to debug, it will print the contents of requests and responses.
Click to show internal directories.
Click to hide internal directories.