os

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: Apache-2.0 Imports: 6 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

CopyFile copies a file. It truncates the destination file if it exists.

func EnsureDir

func EnsureDir(dir string, mode os.FileMode) error

func Exit

func Exit(s string)

func FileExists

func FileExists(filePath string) bool

func Kill added in v0.0.7

func Kill() error

Kill the running process by sending itself SIGTERM.

func MustReadFile added in v0.0.7

func MustReadFile(filePath string) []byte

func MustWriteFile added in v0.0.7

func MustWriteFile(filePath string, contents []byte, mode os.FileMode)

func ReadFile added in v0.0.7

func ReadFile(filePath string) ([]byte, error)

func TrapSignal

func TrapSignal(logger logger, cb func())

TrapSignal catches the SIGTERM/SIGINT and executes cb function. After that it exits with code 0.

func WriteFile added in v0.0.7

func WriteFile(filePath string, contents []byte, mode os.FileMode) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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