redirector

package module
v0.0.0-...-27a683d Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(repo Repository, middlewares ...Middleware) http.Handler

NewHandler returns a new Handler.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type Middleware

type Middleware func(http.Handler) http.Handler

Middleware is a middleware.

type Redirector

type Redirector struct {
	// contains filtered or unexported fields
}

func New

func New(port string, h http.Handler) *Redirector

func (*Redirector) Run

func (r *Redirector) Run(ctx context.Context) error

type Repository

type Repository interface {
	GetURLAndUpdateStats(ctx context.Context, name string) (*url.URL, error)
}

func NewRepository

func NewRepository(c *firestore.Client) Repository

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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