tinyurl

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRedirect

func HandleRedirect(a App, w http.ResponseWriter, r *http.Request)

func HandleRoot

func HandleRoot(a App, w http.ResponseWriter, r *http.Request)

func HandleTinyfication

func HandleTinyfication(a App, w http.ResponseWriter, r *http.Request)

Types

type App

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

func NewApp

func NewApp(version string, store UrlStore) App

type HandleFunc

type HandleFunc = func(http.ResponseWriter, *http.Request)

func MakeHandleFunction

func MakeHandleFunction(a App, fn func(App, http.ResponseWriter, *http.Request)) HandleFunc

type ServerConfig added in v0.0.2

type ServerConfig struct {
	Host string
	Port string
}

func NewConfig added in v0.0.2

func NewConfig() *ServerConfig

type TinyRequestPayload

type TinyRequestPayload struct {
	Url string
}

type TinyRequestResponse

type TinyRequestResponse struct {
	Code string
}

type UrlStore

type UrlStore interface {
	GetById(int) (string, error)
	Store(string) (int, error)
}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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