build

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2016 License: MIT Imports: 9 Imported by: 11

Documentation

Index

Constants

View Source
const (
	// Version is the current version of siad.
	Version = "1.0.4"

	// MaxEncodedVersionLength is the maximum length of a version string encoded
	// with the encode package. 100 is much larger than any version number we send
	// now, but it allows us to send additional information in the version string
	// later if we choose. For example appending the version string with the HEAD
	// commit hash.
	MaxEncodedVersionLength = 100
)
View Source
const DEBUG = false
View Source
const Release = "standard"

Variables

View Source
var (
	// SiaTestingDir is the directory that contains all of the files and
	// folders created during testing.
	SiaTestingDir = filepath.Join(os.TempDir(), "SiaTesting")
)

Functions

func CopyDir added in v1.0.0

func CopyDir(source, dest string) error

CopyDir copies a directory and all of its contents to the destination directory.

func CopyFile added in v1.0.0

func CopyFile(source, dest string) error

CopyFile copies a file from a source to a destination.

func Critical added in v1.0.0

func Critical(v ...interface{})

Critical should be called if a sanity check has failed, indicating developer error. Critical is called with an extended message guiding the user to the issue tracker on Github. If the program does not panic, the call stack for the running goroutine is printed to help determine the error.

func IsVersion added in v1.0.0

func IsVersion(str string) bool

IsVersion returns whether str is a valid version number.

func JoinErrors added in v1.0.0

func JoinErrors(errs []error, sep string) error

JoinErrors concatenates the elements of errs to create a single error. The separator string sep is placed between elements in the resulting error. Nil errors are skipped. If errs is empty or only contains nil elements, JoinErrors returns nil.

func Severe added in v1.0.3

func Severe(v ...interface{})

Severe will print a message to os.Stderr. If DEBUG has been set panic will be called as well. Severe should be called in situations which indicate significant problems for the user (such as disk failure or random number generation failure), but where crashing is not strictly required to preserve integrity.

func TempDir added in v0.3.2

func TempDir(dirs ...string) string

TempDir joins the provided directories and prefixes them with the Sia testing directory.

func VersionCmp added in v1.0.0

func VersionCmp(a, b string) int

VersionCmp returns an int indicating the difference between a and b. It follows the convention of bytes.Compare and big.Cmp:

-1 if a <  b
 0 if a == b
+1 if a >  b

One important quirk is that "1.1.0" is considered newer than "1.1", despite being numerically equal.

Types

This section is empty.

Jump to

Keyboard shortcuts

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