api

package
v0.0.0-...-ad73e1a Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func APInit

func APInit(db *URLMap, signal *chan bool)

func Cleanup

func Cleanup(db URLMap, endGoRoutines *chan bool)

func GetIP

func GetIP(r *http.Request) string

func GetTimestamp

func GetTimestamp() string

func HandleRequests

func HandleRequests(urlMap URLMap)

func SetupCloseHandler

func SetupCloseHandler(db URLMap, endGoRoutines *chan bool)

Types

type ShortenRequest

type ShortenRequest struct {
	URL string `json:"URL"`
}

type ShortenResponse

type ShortenResponse struct {
	URL string `json:"URL"`
}

type URLItem

type URLItem struct {
	ToURL     string `json:"ToURL"`
	Timestamp string `json:"Timestamp"`
	Link      string `json:"Link"`
	Redirects int    `json:"Redirects"`
}

type URLMap

type URLMap map[string]URLItem

Jump to

Keyboard shortcuts

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