util

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func Command

func Command(name string, arg ...string) (string, error)

func CommandContext

func CommandContext(ctx context.Context, name string, arg ...string) (string, error)

func CurrentDir

func CurrentDir() string

func DirFileList

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

func FileExists

func FileExists(path string) (bool, error)

func IsIP

func IsIP(ip string) bool

func IsIPV6

func IsIPV6(ip string) bool

func IsLoopbackIP

func IsLoopbackIP(ip string) bool

func IsPrivateIP

func IsPrivateIP(ip string) bool

func LogFilePath

func LogFilePath() string

func RandomBetween

func RandomBetween(min, max int64) int64

func ReadFileLines

func ReadFileLines(file string) ([]string, error)

func ReadFileLinesMap

func ReadFileLinesMap(file string) (map[string]struct{}, error)

func SetLogFileHook

func SetLogFileHook(logDir string)

func SetSysDNS

func SetSysDNS(v []string) error

func SysDNS

func SysDNS() ([]string, error)

func SysGatewayAndDevice

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

func SysPowershellMajorVersion

func SysPowershellMajorVersion() int

func SysSupportPowershell

func SysSupportPowershell() bool

func WriteToTemp

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

Types

This section is empty.

Directories

Path Synopsis
Package bytespool provides a pool of []byte.
Package bytespool provides a pool of []byte.

Jump to

Keyboard shortcuts

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