Documentation ¶
Overview ¶
2017-10-31 14:30 Package gxurl implements URL function encapsulation
Index ¶
- Constants
- Variables
- func GenBaiduShortURL(uri string) (string, error)
- func GenGitioShortURL(uri string) (string, error)
- func GenSinaShortURL(uri string) (string, error)
- func GenSinaShortURLByGoogd(uri string) (string, error)
- func GenSo985ShortURL(uri string) (string, error)
- type BaiduResult
- type GoogdResult
- type GoogdResults
- type SinaResult
- type So985Result
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=" So985ShortURL = "http://api.c7.gg/api.php?format=json&url=" )
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
func GenSo985ShortURL ¶ added in v0.3.0
GenSo985ShortURL generates short url by git.io.
Types ¶
type BaiduResult ¶
type GoogdResult ¶
type GoogdResults ¶
type GoogdResults struct {
Urls []GoogdResult `json:"urls"`
}
type SinaResult ¶
type SinaResult struct {
UrlShort string `json:"url_short"`
}
type So985Result ¶ added in v0.3.0
Click to show internal directories.
Click to hide internal directories.