sho
github.com/kaimixu/shorturl
go get github.com/kaimixu/shorturl
sho

github.com/kaimixu/shorturl

短链接生成算法

go get github.com/kaimixu/shorturl
Readme

shorturl

Installation

$ go get github.com/kaimixu/shorturl

Usage

package main

import (
    "fmt"           
    "github.com/kaimixu/shorturl"
)

func main() {
    url := "http://www.example.com?a=1&b=2&c=3&d=4"

    cb := func(url, keyword string) bool {
        // todo 查db或缓存判断keyword是否重复
    return true
    }

    domain := "http://shorturl.cn"
    surl := shorturl.Generator(shorturl.CHARSET_ALPHANUMERIC, domain, url, cb)
    fmt.Println(surl)
}

GitHub Stars

12

LAST COMMIT

5yrs ago

MAINTAINERS

0

CONTRIBUTORS

1

OPEN ISSUES

0

OPEN PRs

0
VersionTagPublished
v0.0.0-20171119141032-a20f6952f298
3yrs ago
No alternatives found
No tutorials found
Add a tutorial