helper

package
v1.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrFileNotFound file not found
	ErrFileNotFound = errors.New("file not found")
	// ErrInvalidJsonFileFormat Contains all errors reported during json decode.
	ErrInvalidJsonFileFormat = errors.New("invalid json file")
)

Functions

func AddFirewallRules added in v1.20.0

func AddFirewallRules(pid, tcp, udp int) error

func CheckMd5Sum

func CheckMd5Sum(path string) (string, error)

func Copy

func Copy(srcFile, dstFile string) error

func CopyDirectory

func CopyDirectory(scrDir, dest string) error

func CreateIfNotExists

func CreateIfNotExists(dir string, perm os.FileMode) error

CreateIfNotExists creates a new directory if not exists

func Decode

func Decode(f io.ReadSeeker, obj interface{}) error

func DelFirewallRules added in v1.20.0

func DelFirewallRules(pid int) error

func Encode

func Encode(obj interface{}) ([]byte, error)

func Exists

func Exists(filePath string) bool

func GenerateTokenKeysIfNotPresent added in v1.16.2

func GenerateTokenKeysIfNotPresent(publicKeyPath string, privateKeyPath string)

func LoadFromPath

func LoadFromPath(baseDir, filename string, obj interface{}) error

func SaveToPath

func SaveToPath(baseDir, filename string, obj interface{}) error

func SetCoreAffinity added in v1.20.0

func SetCoreAffinity(pid int, value uint) error

func SetCpuPriority added in v1.20.0

func SetCpuPriority(pid int, p uint) error

func WrapErrors

func WrapErrors(errs ...error) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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