htmltil

package
v0.0.0-...-8d6dda1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

README

html处理小工具

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compress

func Compress(HtmlStr string, DoesTrimAllSpace ...bool) (NewHtmlStr string)

html压缩【非gzip压缩,只是去掉多余的空格或者是换行和tab】 @param HtmlStr 需要压缩的html字符串 @param DoesTrimAllSpace 是否存在预览的代码,如果html页面中存在code,如python代码等,则不能替换掉空格,所以这里要慎重 @return NewHtmlStr 处理后的html字符串

func OpenByBrowser

func OpenByBrowser(uri string) (err error)

golang调用浏览器打开指定链接 @param uri 需要打开的url链接地址 @return err 错误

func ParseUrlQuery

func ParseUrlQuery(QueryStr string) (params map[string]interface{})

url的query请求解析,如:http://example.com?name=truthhun&age=18&hobbies[]=football&hobbies[]=swimming,则这里的QueryStr为问号后面的部分 @param QueryStr 请求字符串 @return params 解析后的参数,如果有select或者checkbox等多选的情况下,则interface{}为[]string类型,否则都是string,在使用的时候,用类型断言即可 需要注意的是,如果请求参数中的参数名带有“[]”,那么解析后的参数中也是带有中括号的 功能类似url.ParseQuery

Types

This section is empty.

Jump to

Keyboard shortcuts

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