http

package
v0.0.0-...-4530040 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package http provides the HTTP routing and middleware setup for the Shortugo URL shortening service. It defines the Router function that configures all RESTful endpoints, user authentication, gzip compression, request logging, panic recovery, and exposes internal diagnostic routes via pprof.

The package integrates handlers for creating, expanding, deleting, and listing shortened URLs, as well as health checks and internal statistics. It also exposes profiling endpoints under /debug/pprof.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Router

func Router(handler *handlers.URLHandler) *chi.Mux

Router initializes the router with all the necessary routes and middleware.

func Run

func Run(cfg *config.Config, h *handlers.URLHandler, logger *logging.Logger) (*http.Server, error)

Run creates and configures and run a new HTTP server. a is the address the server will listen on. h is the handler that will be used by router the incoming requests.

Types

This section is empty.

Directories

Path Synopsis
Package handlers provides HTTP handlers for URL shortening and related operations.
Package handlers provides HTTP handlers for URL shortening and related operations.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL