os

package
v0.0.40 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ShutdownSignals = []os.Signal{syscall.SIGINT, syscall.SIGTERM}

CTRL + C for SIGINT docker stop for SIGTERM

Functions

func GetEnvAsFloat64OrFallback

func GetEnvAsFloat64OrFallback(key string, defaultValue float64) (float64, error)

GetEnvAsFloat64OrFallback returns the env variable (parsed as float64) for the given key and falls back to the given defaultValue if not set

func GetEnvAsIntOrFallback

func GetEnvAsIntOrFallback(key string, defaultValue int) (int, error)

GetEnvAsIntOrFallback returns the env variable (parsed as integer) for the given key and falls back to the given defaultValue if not set

func GetEnvAsStringOrFallback

func GetEnvAsStringOrFallback(key, defaultValue string) string

GetEnvAsStringOrFallback returns the env variable for the given key and falls back to the given defaultValue if not set

func GetPidsByName added in v0.0.5

func GetPidsByName(
	timeout time.Duration,
	name string) ([]int, string, error)

func Getwd

func Getwd() (string, error)

func IsDir added in v0.0.40

func IsDir(path string) (bool, error)

func MakeDir

func MakeDir(name string) error

func MakeDirAll

func MakeDirAll(name string) error

MkdirAll creates a directory named path, along with any necessary parents, and returns nil, or else returns an error. The permission(0755) bits perm (before umask) are used for all directories that MkdirAll creates. If path is already a directory, MkdirAll does nothing

func OpenAll

func OpenAll(path string, flag int, perm os.FileMode) (*os.File, error)

func OpenFile

func OpenFile(path string, appended bool) (file *os.File, err error)

func PathExist added in v0.0.27

func PathExist(path string) (bool, error)

func ReadDirFileNames added in v0.0.40

func ReadDirFileNames(path string, filterHiddenFile bool) ([]string, error)

func ReadDirNames added in v0.0.40

func ReadDirNames(path string, filterHiddenFile bool) ([]string, error)

include subdir, file and hidden file

func ReadDirSubDirNames added in v0.0.40

func ReadDirSubDirNames(path string, filterHiddenFile bool) ([]string, error)

only inlcude subdir filterHiddenFile is true, then filter hidden files from result

func RemoveBatch added in v0.0.27

func RemoveBatch(filenames []string) error

func RemoveWithGlob added in v0.0.27

func RemoveWithGlob(pattern string) error

func SameFile

func SameFile(fi1, fi2 string) bool

SameFile reports whether fi1 and fi2 describe the same file.

func SymLink(oldname, newname string) error

oldname and newname is full path

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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