controller

package
v0.0.0-...-57f4814 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Startup

func Startup(l *log.Logger) *mux.Router

Startup initializes the controller

Types

type URLAssociationsController

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

URLAssociationsController represents the controller to handle requests for URLs

func (*URLAssociationsController) AssociateURL

func (c *URLAssociationsController) AssociateURL() http.HandlerFunc

AssociateURL generates a unique id to associate to the URL if it is a valid URL

func (*URLAssociationsController) DisassociateURL

func (c *URLAssociationsController) DisassociateURL() http.HandlerFunc

DisassociateURL removes the association of the URL to the requested id if exists

func (*URLAssociationsController) GetAllAssociatedURLs

func (c *URLAssociationsController) GetAllAssociatedURLs() http.HandlerFunc

GetAllAssociatedURLs return all the URLs associations

func (*URLAssociationsController) LogLine

func (c *URLAssociationsController) LogLine(text string)

LogLine logs the text using the controller's logger

func (*URLAssociationsController) RedirectIfExist

func (c *URLAssociationsController) RedirectIfExist() http.HandlerFunc

RedirectIfExist redirects the request id to its associated real url if exists

func (*URLAssociationsController) UpdateURL

UpdateURL updates the url associated to the requested uuid

Jump to

Keyboard shortcuts

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