utils

package
v1.7.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyBuffer

func CopyBuffer(dst io.Writer, src io.Reader, buf []byte) (written int64, err error)

CopyBuffer is the actual implementation of Copy and CopyBuffer. if buf is nil, one is allocated. Note that this is a copy function of io from the built-in, the only changes is let preset buffer size respect the transport settings.

func ExtractDomain

func ExtractDomain(s string) string

func ForceClose

func ForceClose(closer io.Closer)

ForceClose forces close the closer

func ForceCloseAll

func ForceCloseAll(closers ...io.Closer)

ForceCloseAll force close all closers

func LoadProxy

func LoadProxy(p string) (proxy.Dialer, error)

func PathExist

func PathExist(path string) bool

func PrintErrorIfCritical

func PrintErrorIfCritical(err error, msg string)

PrintErrorIfCritical prints only error that critical

func SplitHostPort

func SplitHostPort(s string) (string, uint16, error)

SplitHostPort uses net.SplitHostPort but converts port to uint16 format

Types

This section is empty.

Jump to

Keyboard shortcuts

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