utils

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrorApp  = "app"
	ErrorUser = "user"
)

Error types

Variables

This section is empty.

Functions

func EnsureFolder

func EnsureFolder(path string) error

EnsureFolder creates a folder if it doesn't exist already

func ExitWithError

func ExitWithError(errType string, errMessage string, errData error)

ExitWithError prints and error then terminates the app

func GPGDecrypt added in v0.3.0

func GPGDecrypt(in []byte) (out []byte, err error)

GPGDecrypt decrypts data using the GPG binary

func GPGEncrypt added in v0.3.0

func GPGEncrypt(in []byte, key string) (out []byte, err error)

GPGEncrypt encrypts data using the GPG binary

func IsIgnoredFile added in v0.2.1

func IsIgnoredFile(file string) bool

IsIgnoredFile returns true if the file should be ignored and not added to the repository Ignored files include OS metadata files etc

func IsRegularFile

func IsRegularFile(path string) (bool, error)

IsRegularFile returns true if the path is a file

func PathExists

func PathExists(path string) (bool, error)

PathExists returns true if the path exists on disk

func SanitizeMimeType added in v0.3.0

func SanitizeMimeType(mime string) string

SanitizeMimeType sanitizes a mime type

func SanitizePath added in v0.2.0

func SanitizePath(path string) string

SanitizePath removes certain problematic characters from path names

Types

This section is empty.

Jump to

Keyboard shortcuts

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