util

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2018 License: Apache-2.0 Imports: 4 Imported by: 35

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) (err error)

copied from http://stackoverflow.com/questions/21060945/simple-way-to-copy-a-file-in-golang CopyFile copies a file from src to dst. If src and dst files exist, and are the same, then return success. Otherwise, attempt to create a hard link between the two files. If that fail, copy the file contents from src to dst.

func EnsureDir

func EnsureDir(dir string, mode os.FileMode) error

Ensure the directory exists or create it if needed.

func Fatalf

func Fatalf(format string, args ...interface{})

Prints an error message to stderr and exits with status code 1

func IsAddress

func IsAddress(str string) bool

Is the candidate a proper public address string (20 bytes, hex).

func IsDir

func IsDir(directory string) bool

Check whether the provided directory exists

func IsHash

func IsHash(str string) bool

Is the candidate a hash (32 bytes, same as public keys)

func IsHex

func IsHex(str string) bool

Is the candidate a proper hex string.

func IsPrivKey

func IsPrivKey(str string) bool

Is the candidate a private key string (64 bytes, hex). This is not a good name.

func IsPubKey

func IsPubKey(str string) bool

Is the candidate a public key string (32 bytes). This is not a good name.

Types

This section is empty.

Directories

Path Synopsis
logging
cmd
snatives

Jump to

Keyboard shortcuts

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