util

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Contains

func Contains(stringA, stringB string) bool

func DecodeKorean added in v1.1.0

func DecodeKorean(s []byte) ([]byte, error)

func Decodegbk added in v1.1.0

func Decodegbk(s []byte) ([]byte, error)

Decodegbk converts GBK to UTF-8

func ExtractTitle added in v1.1.0

func ExtractTitle(r *Response) (title string)

ExtractTitle from a response

func FaviconHash

func FaviconHash(data []byte) int32

func In

func In(target string, strs []string) bool

In 判断一个字符串是否在另一个字符数组里面,存在返回true target 中是否包含 strs 中的某一个 这个是 target 范围大, element只是一个子串

func InsertInto

func InsertInto(s string, interval int, sep rune) string

func LoadFile

func LoadFile(filename string) (lines []string)

LoadFile content to slice

func PathExists

func PathExists(path string) error

func RemoveDuplicateElement

func RemoveDuplicateElement(strs []string) []string

RemoveDuplicateElement 数组去重

Types

type Response

type Response struct {
	Status        string
	StatusCode    int
	Body          string
	RequestDump   string
	Header        http.Header
	ContentLength int
	RequestUrl    string
	Location      string
}

func HttpRequset

func HttpRequset(urlstring string, method string, postdata string, isredirect bool, headers map[string]string) (*Response, error)

Jump to

Keyboard shortcuts

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