util

package
v0.25.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: GPL-3.0 Imports: 7 Imported by: 83

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, s string) []string

AppendIfMissing append to the slice if missing

func Distinct added in v0.4.0

func Distinct(ss []string) (distincted []string)

Distinct a slice

func GenWorkers

func GenWorkers(num int) chan<- func()

GenWorkers generates goroutine http://qiita.com/na-o-ys/items/65373132b1c5bc973cca

func GetHTTPClient added in v0.15.7

func GetHTTPClient(proxy string) (*http.Client, error)

GetHTTPClient return http.Client

func IP added in v0.7.0

func IP() (ipv4Addrs []string, ipv6Addrs []string, err error)

IP returns scanner network ip addresses

func Major added in v0.15.0

func Major(version string) string

Major return the major version of the given semantic version

func PrependProxyEnv

func PrependProxyEnv(cmd string) string

PrependProxyEnv prepends proxy environment variable

func Truncate added in v0.1.6

func Truncate(str string, length int) string

Truncate truncates string to the length

func URLPathJoin

func URLPathJoin(baseURL string, paths ...string) (string, error)

URLPathJoin make URL

func URLPathParamJoin

func URLPathParamJoin(baseURL string, paths []string, params map[string]string) (string, error)

URLPathParamJoin make URL

Types

This section is empty.

Jump to

Keyboard shortcuts

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