util

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileSize

func FileSize(filepath string) (int64, errors.GitGhostError)

FileSize returns file size of a given file

func GenerateFileContentHash

func GenerateFileContentHash(filepath string) (string, errors.GitGhostError)

func GetExitCode added in v0.1.3

func GetExitCode(err error) int

func IsDir

func IsDir(path string) (bool, errors.GitGhostError)

IsSymlink returns whether a given file is a directory

func IsSymlink(path string) (bool, errors.GitGhostError)

IsSymlink returns whether a given file is a symlink

func JustOutputCmd

func JustOutputCmd(cmd *exec.Cmd) ([]byte, errors.GitGhostError)

func JustRunCmd

func JustRunCmd(cmd *exec.Cmd) errors.GitGhostError

func LogDeferredError

func LogDeferredError(f func() error)

LogDeferredError calls a given function and log an error according to the result

func LogDeferredGitGhostError

func LogDeferredGitGhostError(f func() errors.GitGhostError)

LogDeferredGitGhostError calls a given function and log an GitGhostError according to the result

func MergeFields

func MergeFields(fieldss ...log.Fields) log.Fields

func ToFields

func ToFields(structObj interface{}) (fields log.Fields)

func UniqueStringSlice

func UniqueStringSlice(slice []string) []string
func WalkSymlink(dir, path string, cb func([]string, string) errors.GitGhostError) errors.GitGhostError

WalkSymlink reads a symlink and call a given callback until the resolved path is not a symlink.WalkSymlink

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