fn

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DomList = func() []string {
	return []string{"html", "base", "head", "link", "meta", "style", "title", "body", "address", "article", "aside", "footer", "header", "h1", "h2", "h3", "h4", "h5", "h6", "main", "nav", "section", "blockquote", "dd", "div", "dl", "dt", "figcaption", "figure", "hr", "li", "menu", "ol", "p", "pre", "ul", "a", "abbr", "b", "bdi", "bdo", "br", "cite", "code", "data", "dfn", "em", "i", "kbd", "mark", "q", "rp", "rt", "ruby", "s", "samp", "small", "span", "strong", "sub", "sup", "time", "u", "var", "wbr", "area", "audio", "img", "map", "track", "video", "embed", "iframe", "object", "picture", "portal", "source", "svg", "math", "canvas", "noscript", "script", "del", "ins", "caption", "col", "colgroup", "table", "tbody", "td", "tfoot", "th", "thead", "tr", "button", "datalist", "fieldset", "form", "input", "label", "legend", "meter", "optgroup", "option", "output", "progress", "select", "textarea", "details", "dialog", "summary", "slot", "template", "acronym", "applet", "bgsound", "big", "blink", "center", "content", "dir", "font", "frame", "frameset", "image", "keygen", "marquee", "menuitem", "nobr", "noembed", "noframes", "param", "plaintext", "rb", "rtc", "shadow", "spacer", "strike", "tt", "xmp"}
}()

ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element

Functions

func Base64Decode

func Base64Decode(input string) string

func Base64Encode

func Base64Encode(input string) string

func DecodeHTMLBody

func DecodeHTMLBody(body io.Reader, charset string) (io.Reader, error)

decodeHTMLBody returns an decoding reader of the html Body for the specified `charset` If `charset` is empty, decodeHTMLBody tries to guess the encoding from the content

func DetectContentEncoding

func DetectContentEncoding(body io.Reader) string

According to the returned content, automatically determine the content encoding format

func ExpireBySecond

func ExpireBySecond(n int) time.Duration

func GetFileContent

func GetFileContent(file string) []byte

func GetFileSHA1

func GetFileSHA1(src []byte) string

func Html2Md

func Html2Md(html string) string

func I2T

func I2T(n int) time.Duration

func IsBoolString

func IsBoolString(input string) bool

func IsCssSelector

func IsCssSelector(field string) bool

func IsDir

func IsDir(src string) bool

func IsDomTagName

func IsDomTagName(field string) bool

func IsFile

func IsFile(src string) bool

func IsNotEmptyAndNotDefaultString

func IsNotEmptyAndNotDefaultString(value string, defaults string) bool

func IsStrInArray

func IsStrInArray(arr []string, s string) bool

func IsVaildAddr

func IsVaildAddr(addr string) bool

func IsVaildAddrWithHttpProtocol

func IsVaildAddrWithHttpProtocol(addr string) bool

func IsVaildAddrWithWsProtocol

func IsVaildAddrWithWsProtocol(addr string) bool

func IsVaildHeadlessAddr

func IsVaildHeadlessAddr(addr string) bool

func IsVaildIPAddr

func IsVaildIPAddr(addr string) bool

func IsVaildLogLevel

func IsVaildLogLevel(level string) bool

func IsVaildPortRange

func IsVaildPortRange(port int) bool

func IsVaildProxyAddr

func IsVaildProxyAddr(addr string) bool

func JSONStringify

func JSONStringify(r interface{}) string

func LinkResolveRelative

func LinkResolveRelative(resolveUrl string, baseUrl string) (string, error)

func ScanDirFiles

func ScanDirFiles(baseDir string) (files []string)

func StringToPositiveInteger

func StringToPositiveInteger(s string) int

Types

This section is empty.

Jump to

Keyboard shortcuts

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