errutil

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Debug is the logger function for the debug level.
	Debug func(string, ...interface{})
	// Info is the logger function for the info level.
	Info func(string, ...interface{})
	// Warn is the logger function for the warning level.
	Warn func(string, error) error
	// Error is the logger function for the error level.
	Error func(string, error) error
)

Functions

func Check

func Check(err error)

Check checks if an error is present. If it is present, it displays the error and exits with status 1. If you want to display a custom message use CheckWithMessage.

func Exit

func Exit(code int)

Exit quits the application with a given value.

Types

type ErrAlreadyExists

type ErrAlreadyExists struct {
	Filename string
	Location Location
}

ErrAlreadyExists signifies, that a file or directory can't be overriden, because it already exists.

func (*ErrAlreadyExists) Error

func (err *ErrAlreadyExists) Error() string

Error returns the whole error about the existing file.

type ErrNotFound

type ErrNotFound ErrAlreadyExists

ErrNotFound is returned when a source copied from doesn't exists.

func (*ErrNotFound) Error

func (err *ErrNotFound) Error() string

Error returns the whole error about the existing file.

type Location

type Location int

Location is an enum for choosing between local file system of Google Cloud Storage.

const (
	// Lfs is the local file system enum value.
	Lfs Location = iota
	// Gcs is the Google Cloud Storage enum value.
	Gcs
)

Jump to

Keyboard shortcuts

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