utils

package
v0.1.47 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfDefaultPath = []string{
	"fofax.yaml",
	filepath.Join(getHomedir(), "fofax.yaml"),
	"/etc/fofax/fofax.yaml",
	"/etc/fofax.yaml",
}

Functions

func BinBaseDir

func BinBaseDir() string

func ConvertByte2String

func ConvertByte2String(byte []byte, charset string) string

ConvertByte2String 解决 windows cmd 下不能正确显示中文的问题

func FetchIpv6AndIpv4HostAndPort added in v0.1.45

func FetchIpv6AndIpv4HostAndPort(uHost string) string

"[240e:468:810:ab69:2042:7ff:fe58:881a]:8080"

func FileContent2List

func FileContent2List(path string) ([]string, error)

func FileExist

func FileExist(path string) bool

func FixFofaHostsHttpIpv6 added in v0.1.45

func FixFofaHostsHttpIpv6(ipv6URL string) (*url.URL, error)

is_ipv6=true && port="8080" "https://2407:c080:17ef:ffff::7703:d86e"

func FixFullHostInfoScheme

func FixFullHostInfoScheme(fields []string) string

func FixFullHostIpv6 added in v0.1.45

func FixFullHostIpv6(fullUrl string) string

func GetDefaultConf

func GetDefaultConf() string

func GetHidePasswd

func GetHidePasswd(key string) string

func GetSerialNumber

func GetSerialNumber(client *http.Client, url string) string

GetSerialNumber 转换证书

func HasStdin

func HasStdin() bool

func HiddenUrlKey added in v0.1.37

func HiddenUrlKey(sp bool, fullURL string) string

func IsHttp added in v0.1.29

func IsHttp(url string) bool

func IsHttps added in v0.1.29

func IsHttps(url string) bool

func IsWebsite added in v0.1.29

func IsWebsite(url string) bool

func JsonStrToMAp

func JsonStrToMAp(jsonStr string) (map[string]string, error)

func MapToJsonStr

func MapToJsonStr(m map[string]string) (string, error)

func OpenFofa

func OpenFofa(fofaOpenUrl, query string)

func StructToMap

func StructToMap(in interface{}, tagName string) (map[string]interface{}, error)

StructToMap Struct 转 Map

Types

type FixUrl

type FixUrl struct {
	HostInfo      string //ip:port 肯定带端口
	FixedHostInfo string //scheme://host 不一定带端口,默认情况下会省略
	IP            string
	Port          string
	Path          string // 不包含参数?
	Dir           string // 解析后的
	Method        string
	ContentType   string
	Data          string
	PostDataType  string

	ParseWithScheme bool //是否解析的时候自带scheme
	// contains filtered or unexported fields
}

func NewFixUrl

func NewFixUrl(hostinfo string) (*FixUrl, error)

NewFixUrl 归一化url格式

func (*FixUrl) Scheme

func (fu *FixUrl) Scheme() string

func (*FixUrl) String

func (fu *FixUrl) String() string

Jump to

Keyboard shortcuts

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