Documentation
¶
Overview ¶
2017-10-31 14:30 Package gxurl implements URL function encapsulation
Index ¶
Constants ¶
View Source
const ( GitioShortURL = "https://git.io" BaiduShortURL = "http://dwz.cn/create.php" // SinaShortURL = "http://api.t.sina.com.cn/short_url/shorten.json?source=3271760578&url_long=" SinaShortURL = "http://api.t.sina.com.cn/short_url/shorten.json?source=1681459862&url_long=" GoogdShortURL = "http://www.goo.gd/action/json.php?source=1681459862&url_long=" )
Variables ¶
View Source
var (
ErrorHTTPPrefix = fmt.Errorf("The url should start with http:// or https://")
)
Functions ¶
func GenBaiduShortURL ¶
GenBaiduShortURL generates short url by dwz.com
func GenGitioShortURL ¶
GenGitioShortURL generates short url by git.io.
func GenSinaShortURL ¶
GenSinaShortURL generates short url by sina.com ref doc: http://open.weibo.com/wiki/Short_url/shorten
func GenSinaShortURLByGoogd ¶
GenSinaShortURL generates short url by sina.com
Types ¶
type BaiduResult ¶
type GoogdResult ¶
type GoogdResults ¶
type GoogdResults struct {
Urls []GoogdResult `json:"urls"`
}
type SinaResult ¶
type SinaResult struct {
UrlShort string `json:"url_short"`
}
Click to show internal directories.
Click to hide internal directories.