util

package
v0.0.0-...-b0b6c98 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractHostPort

func ExtractHostPort(addr string) (string, int, error)

func FilterKeep

func FilterKeep[T any](arr []T, function func(value T) bool) []T

func GetProxyDialer

func GetProxyDialer(proxyStringOrEmpty string, uncertainTimeout time.Duration) (proxy.Dialer, error)

GetProxyDialer returns a proxy.Dialer with timeout. Note that we should convert it into proxy.ContextDialer to ensure a timeout.

func InitFs

func InitFs()

func Map

func Map[T any, E any](arr []T, function func(value T) E) []E

func MustCheckExist

func MustCheckExist(filePath string) bool

func MustLipPath

func MustLipPath(pathSeg ...string) string

func RemoveProtocol

func RemoveProtocol(addr string) (host string, port int)

func Ternary

func Ternary[T any](expression bool, trueResult T, falseResult T) T

func TransposeMatrix

func TransposeMatrix[T any](matrix [][]T) [][]T

func WriteTable

func WriteTable(matrix [][]string, writer io.Writer, reverse bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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