util

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogMaxAge     = 1  // one day
	LogMaxBackups = 1  // one backup
	LogMaxSize    = 10 // 10Mb
	LogFileName   = "easyss.log"
)
View Source
const Http2HeaderLen = 9

Variables

This section is empty.

Functions

func CurrentDir added in v1.3.0

func CurrentDir() string

func DirFileList added in v1.4.0

func DirFileList(dir string) ([]string, error)

func EncodeACKRstStreamHeader

func EncodeACKRstStreamHeader(dst []byte) (header []byte)

func EncodeFINRstStreamHeader

func EncodeFINRstStreamHeader(dst []byte) (header []byte)

func EncodeHTTP2DataFrameHeader

func EncodeHTTP2DataFrameHeader(protoType string, datalen int, dst []byte) (header []byte)

func FileExists

func FileExists(path string) (bool, error)

func IsIP

func IsIP(ip string) bool

func IsIPV6 added in v1.5.0

func IsIPV6(ip string) bool

func IsLoopbackIP added in v1.4.0

func IsLoopbackIP(ip string) bool

func IsPrivateIP

func IsPrivateIP(ip string) bool

func LogFilePath added in v1.3.0

func LogFilePath() string

func SetLogFileHook added in v1.4.0

func SetLogFileHook(logDir string)

func SysGatewayAndDevice added in v1.5.0

func SysGatewayAndDevice() (gw string, dev string, err error)

func SysPowershellMajorVersion

func SysPowershellMajorVersion() int

func SysSupportPowershell

func SysSupportPowershell() bool

func WriteToTemp added in v1.5.0

func WriteToTemp(filename string, content []byte) (namePath string, err error)

Types

type Bytes

type Bytes struct {
	// contains filtered or unexported fields
}

Bytes is a pool of byte slices that can be re-used.

func NewBytes

func NewBytes(capSize int) *Bytes

NewBytes returns a Bytes pool

func (*Bytes) Get

func (p *Bytes) Get(sz int) []byte

Get returns a byte slice size with at least sz capacity

func (*Bytes) Put

func (p *Bytes) Put(c []byte)

Put returns a slice back to the pool

Jump to

Keyboard shortcuts

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