Documentation
¶
Index ¶
- Constants
- Variables
- func Decode(value string, r interface{}) error
- func Encode(value interface{}) (string, error)
- func FormatBytes(size int64) string
- func HttpPostJson(url, body string) (*simplejson.Json, error)
- func HttpPutJson(url, body string) error
- func InMap(maps map[int]bool, key int) (ret bool)
- func Krand(size int, kind int) []byte
- func NewPaginations(rollPage, totalRows, listRows, currentPage int, urlPrefix string, ...) html1.HTML
- func ParseTitleFromMdHtml(html string) (title string)
- func PasswordHash(pass string) (string, error)
- func PasswordVerify(hashing string, pass string) (bool, error)
- func ScoreFloat(score int) string
- func ShowImg(img string, style ...string) (url string)
- func Substr(s string, length int) string
- type BooksLock
Constants ¶
View Source
const ( KC_RAND_KIND_NUM = 0 // 数字 KC_RAND_KIND_LOWER = 1 // 小写字母 KC_RAND_KIND_UPPER = 2 // 大写字母 KC_RAND_KIND_ALL = 3 // 全部 )
View Source
const ( Version = "1.0" StoreLocal string = "local" StoreOss string = "oss" )
更多存储类型有待扩展
Variables ¶
View Source
var (
BasePath, _ = filepath.Abs(filepath.Dir(os.Args[0]))
StoreType = beego.AppConfig.String("store_type") //存储类型
)
View Source
var BooksRelease = BooksLock{Books: make(map[int]bool)}
Functions ¶
func FormatBytes ¶
func HttpPostJson ¶
func HttpPutJson ¶
func NewPaginations ¶
func NewPaginations(rollPage, totalRows, listRows, currentPage int, urlPrefix string, urlSuffix string, urlParams ...interface{}) html1.HTML
分页函数(这个分页函数不具有通用性) rollPage:展示分页的个数 totalRows:总记录 currentPage:每页显示记录数 urlPrefix:url链接前缀 urlParams:url键值对参数
func ParseTitleFromMdHtml ¶
从md的html文件中提取文章标题(从h1-h6)
func PasswordHash ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.