controllers

package
v0.0.0-...-10a49dc Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBController

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

func NewDBController

func NewDBController(db models.DBModel, cacher models.CahceModel) *DBController

func (*DBController) FetchURL

func (dc *DBController) FetchURL(ctx context.Context, ShortenedURL string) (string, error)

func (*DBController) StoreURL

func (dc *DBController) StoreURL(ctx context.Context, url models.URLS) error

type URLController

type URLController struct {
	DBController *DBController
	models.URLModel
}

func NewURLController

func NewURLController(urlModel models.URLModel, DBController *DBController) *URLController

func (*URLController) Redirect

func (uc *URLController) Redirect(ctx context.Context, w http.ResponseWriter, r *http.Request) error

func (*URLController) ShortenURL

func (uc *URLController) ShortenURL(ctx context.Context, url string) (string, error)

Jump to

Keyboard shortcuts

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