libs

package
v0.0.0-...-a52fffe Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BAIDU_KEY = "baidu_top_key"
)

Functions

func BaiduTop

func BaiduTop(url string) ([]string, error)

http://top.baidu.com/buzz?b=353 单个榜单的数据

func Base64decode

func Base64decode(in string) (string, error)

func Base64encode

func Base64encode(in string) string

func CacheIsExist

func CacheIsExist(key string) bool

func CheckStringIsExist

func CheckStringIsExist(source string, check []string) bool

func ConvertToString

func ConvertToString(src string, srcCode string, tagCode string) string

func CronSaveAllBaiduTop

func CronSaveAllBaiduTop()

func GetAllBaiduTop

func GetAllBaiduTop() (map[string]interface{}, error)

func GetCache

func GetCache(key string) (interface{}, error)

func GetCacheConnId

func GetCacheConnId() (cache.Cache, error)

func GetHttpData

func GetHttpData(url string) (string, error)

func Init

func Init()

func IsCodeRe

func IsCodeRe(b string) bool

func IsEmailRe

func IsEmailRe(b string) bool

func IsIpv4Re

func IsIpv4Re(b string) bool

func IsUrlRe

func IsUrlRe(b string) bool

func Md5

func Md5(buf []byte) string

func Md5str

func Md5str(s string) string

func PathExists

func PathExists(path string) (bool, error)

func RemoveDuplicatesAndEmpty

func RemoveDuplicatesAndEmpty(a []string) (ret []string)

func SendMail

func SendMail(tomail string, subject string, conent string)

func SetCache

func SetCache(key string, val interface{}, timeout time.Duration) error

func SizeFormat

func SizeFormat(size float64) string

func TrimHtml

func TrimHtml(src string) string

Types

type Pager

type Pager struct {
	Page     int
	Totalnum int
	Pagesize int
	// contains filtered or unexported fields
}

func NewPager

func NewPager(page, totalnum, pagesize int, url string, nopath ...bool) *Pager

func (*Pager) ToString

func (this *Pager) ToString() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL