Documentation ¶
Index ¶
- Variables
- func DisplayIndex(w http.ResponseWriter, r *http.Request)
- func GenerateHash(rawUrl string) string
- func GenerateId(n int) string
- func GetQualifiedTinyUrl(r *http.Request, id string) string
- func JsonError(w http.ResponseWriter, err interface{}, code int)
- func RedirectUrl(w http.ResponseWriter, r *http.Request)
- func ShortenUrl(w http.ResponseWriter, r *http.Request)
- func TrimSlash(rawUrl string) string
- func ValidateUrl(rawUrl string) bool
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var Db *sql.DB
Functions ¶
func DisplayIndex ¶
func DisplayIndex(w http.ResponseWriter, r *http.Request)
func GetQualifiedTinyUrl ¶
GetQualifiedTinyUrl returns the qualified tinyurl
func JsonError ¶
func JsonError(w http.ResponseWriter, err interface{}, code int)
JSONError writes an error to the response
func RedirectUrl ¶
func RedirectUrl(w http.ResponseWriter, r *http.Request)
func ShortenUrl ¶
func ShortenUrl(w http.ResponseWriter, r *http.Request)
Types ¶
Click to show internal directories.
Click to hide internal directories.