helpers

package
v0.0.0-...-041f5a1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendStringToFile

func AppendStringToFile(path, text string) error

AppendStringToFile - Add string to the bottom of a file

func Copy

func Copy(src, dst string) error

Copy makes a replica of a file in a new location

func CreateFile

func CreateFile(dst string) error

CreateFile makes a blank file at the specified path

func GetCommandOutput

func GetCommandOutput(logger *logger.Logger, command string, args []string) (output string)

GetCommandOutput runs a command in a subshell and returns the output as a string

func ReadFile

func ReadFile(src string) (string, error)

ReadFile returns the cotents of a file as a string

func StartLogger

func StartLogger(name, filename string, verbose bool) *logger.Logger

StartLogger creates a logger named $name in /var/log/gogios/$filename.log

func WriteStringToFile

func WriteStringToFile(path, text string) error

WriteStringToFile - Replace contents of the file

Types

type Duration

type Duration struct {
	Duration time.Duration
}

Duration allows config files to set durations

func (*Duration) UnmarshalTOML

func (d *Duration) UnmarshalTOML(b []byte) error

UnmarshalTOML parses the duration from the TOML config file

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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