Documentation
¶
Index ¶
- func DBHandler(db *sql.DB, fallback http.Handler) http.HandlerFunc
- func JSONHandler(json []byte, fallback http.Handler) (http.HandlerFunc, error)
- func MapHandler(pathsToUrls map[string]string, fallback http.Handler) http.HandlerFunc
- func YAMLHandler(yml []byte, fallback http.Handler) (http.HandlerFunc, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DBHandler ¶
DBHandler will query the database for provided path and redirect the user to the URL corresponding to the shortcut If the path is not found in the database, then the fallback http.Handler will be called instead.
func JSONHandler ¶
func MapHandler ¶
MapHandler will return an http.HandlerFunc that will attempt to map any paths to their corresponding URL If the path is not provided in the map, then the fallback http.Handler will be called instead.
func YAMLHandler ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.