Documentation ¶
Overview ¶
Package web contains main web and API handlers.
Index ¶
- func GetContext(ctx context.Context) (string, error)
- func HandleAPI(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)
- func HandleHTML(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)
- func HandleRedirect(ctx context.Context, w http.ResponseWriter, r *http.Request) (int, error)
- func ResetTplCache(cfg *conf.Cfg) error
- func SetContext(ctx context.Context, path string) context.Context
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContext ¶
GetContext reads path from context.
func HandleHTML ¶
HandleHTML returns an index HTML page.
func HandleRedirect ¶
HandleRedirect finds short URL and redirects a request.
Types ¶
Click to show internal directories.
Click to hide internal directories.