Documentation ¶
Overview ¶
Package utils is a collection of misc tools shared any gourd application
Index ¶
- func CborDecoder(buffer *[]byte) *codec.Decoder
- func CborEncoder(buffer *[]byte) *codec.Encoder
- func EnvStr() string
- func Exec(name string, arg ...string) error
- func HomeDir() string
- func LogDebug(args ...interface{})
- func LogDebugf(msg string, args ...interface{})
- func LogError(args ...interface{})
- func LogErrorf(msg string, args ...interface{})
- func LogFatal(args ...interface{})
- func LogFatalf(msg string, args ...interface{})
- func LogInfo(args ...interface{})
- func LogInfof(msg string, args ...interface{})
- func LogTrace(args ...interface{})
- func LogTracef(msg string, args ...interface{})
- func LogWarn(args ...interface{})
- func LogWarnf(msg string, args ...interface{})
- func MkdirIfNotExist(dir string)
- func ReadJSON(path string, data interface{}) error
- func SetupLogging(fn func(*log.Logger, *log.Logger))
- func UserCanExec(path string) (bool, error)
- func Username() string
- func WriteJSON(path string, data interface{}) error
- type Env
- type FileError
- type GourdID
- type OsInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CborDecoder ¶
CborDecoder will decode data from a cbor format
func CborEncoder ¶
CborEncoder will encode data in cbor format
func EnvStr ¶
func EnvStr() string
EnvStr returns a human readable form of value for the current environment
func HomeDir ¶
func HomeDir() string
HomeDir returns the filesystem path to the current user's $HOME directory
func LogDebugf ¶
func LogDebugf(msg string, args ...interface{})
LogDebugf logs messages at the debug level
func LogErrorf ¶
func LogErrorf(msg string, args ...interface{})
LogErrorf logs messages at the error level
func LogFatalf ¶
func LogFatalf(msg string, args ...interface{})
LogFatalf logs messages at the error level
func LogInfof ¶
func LogInfof(msg string, args ...interface{})
LogInfof logs messages at the info level
func LogTracef ¶
func LogTracef(msg string, args ...interface{})
LogTracef logs messages at the trace level
func LogWarnf ¶
func LogWarnf(msg string, args ...interface{})
LogWarnf logs messages at the warning level
func SetupLogging ¶
SetupLogging is used to configure the primary loggers
func UserCanExec ¶
UserCanExec checks to see if a file can be executed by the current $USER
Types ¶
type FileError ¶
type FileError int
FileError is used to tell the difference between different kind of file errors
type GourdID ¶
type GourdID struct { // GID is the system gourd group id GID int // UID is the system gourd user id UID int }
GourdID holds the system's IDs for the gourd group and user
func GetGourdID ¶
GetGourdID returns the IDs for the gourd user and group
type OsInfo ¶
type OsInfo struct { KernelName string `json:"kernel_name"` NodeName string `json:"node_name"` KernelRelease string `json:"kernel_release"` Machine string `json:"machine"` OperatingSystem string `json:"operating_system"` }
OsInfo represents data about the host machine's operating system