utils

package
v0.0.0-...-160a1fa Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(sourcePath string, targetPath string) error

CopyFile copy a file's binary contents to another file

func GenerateRandomString

func GenerateRandomString(length int) string

GenerateRandomString generate a random string

func GetRandomFileName

func GetRandomFileName(parentPath string) (string, error)

GetRandomFileName get a random file name unique from the files found in the parentPath

func GetRandomFilePath

func GetRandomFilePath(parentPath string) (string, error)

GetRandomFilePath get a random file name unique from the file paths found in the parentPath

func HandleExitCode

func HandleExitCode(err error) int

HandleExitCode retrieve a command exit code from an error

func MergePaths

func MergePaths(rootSourcePath string, rootTargetDir string) error

MergePaths merge a source path into a target path

func ReturnError

func ReturnError(e error) string

ReturnError returns a formatted error

func ReturnFormattedOutput

func ReturnFormattedOutput(output interface{}) string

ReturnFormattedOutput returns a formatted message

Types

type BuildInfo

type BuildInfo struct {
	Version    string
	Date       string
	CommitSha1 string
	Runtime    string
}

BuildInfo contains Volback build informations

type MsgFormat

type MsgFormat struct {
	Type    string      `json:"type"`
	Content interface{} `json:"content"`
}

MsgFormat is a format used to communicate with the Volback API

type OutputFormat

type OutputFormat struct {
	Stdout   string `json:"stdout"`
	ExitCode int    `json:"rc"`
}

OutputFormat stores output of Restic commands

Jump to

Keyboard shortcuts

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