links

package
Version: v0.5.4 Latest Latest
Warning

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

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

Documentation

Overview

Package links provides a higher level interface to shortening links using the links.wtf shortener service (with support for using your custom links.wtf service as well.)

Index

Constants

This section is empty.

Variables

View Source
var URI = "https://links.wtf"

URI is the endpoint which we use to shorten the link. Must be stripped of trailing slashes. Defaults to "https://links.wtf".

Functions

func Shorten

func Shorten(link, passwd string, httpClient *http.Client) (uri *url.URL, err error)

Shorten shortens a supplied URL with the given links.wtf service, optionally with a given encryption string. If you run a custom links.wtf service, make sure to update the links.URL variable with the URI of where that service is located.

If passwd is blank, no encryption is used. Supply your own httpClient to utilize a proxy, or change the timeout (defaults to 4 seconds if no config is supplied.)

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto