util

package
v0.0.0-...-bebc87d Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2014 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Debug bool

Debug is a global flag for debugging.

View Source
var ErrNotFound = ds.ErrNotFound

ErrNotFound is returned when a search fails to find anything

View Source
var ErrNotImplemented = errors.New("Error: not implemented yet.")

ErrNotImplemented signifies a function has not been implemented yet.

View Source
var ErrSearchIncomplete = errors.New("Error: Search Incomplete.")

ErrSeErrSearchIncomplete implies that a search type operation didnt find the expected node, but did find 'a' node.

View Source
var ErrTimeout = errors.New("Error: Call timed out.")

ErrTimeout implies that a timeout has been triggered

Functions

func ContextWithErrorLog

func ContextWithErrorLog(parent context.Context) (context.Context, <-chan error)

ContextWithErrorLog returns a copy of parent and an error channel that can be used to receive errors sent with the LogError method.

func DErr

func DErr(format string, a ...interface{})

DErr is a shorthand debug printing function to output to Stderr. Will only print if Debug is true.

func DOut

func DOut(format string, a ...interface{})

DOut is a shorthand debug printing function to output to Stdout. Will only print if Debug is true.

func ExpandPathnames

func ExpandPathnames(paths []string) ([]string, error)

ExpandPathnames takes a set of paths and turns them into absolute paths

func Hash

func Hash(data []byte) (mh.Multihash, error)

Hash is the global IPFS hash function. uses multihash SHA2_256, 256 bits

func LogError

func LogError(ctx context.Context, err error)

LogError logs the error to the owner of the context.

If this context was created with ContextWithErrorLog, then this method passes the error to context creator over an unbuffered channel.

If this context was created by other means, this method is a no-op.

func PErr

func PErr(format string, a ...interface{})

PErr is a shorthand printing function to output to Stderr.

func POut

func POut(format string, a ...interface{})

POut is a shorthand printing function to output to Stdout.

func TildeExpansion

func TildeExpansion(filename string) (string, error)

TildeExpansion expands a filename, which may begin with a tilde.

Types

type Key

type Key string

Key is a string representation of multihash for use with maps.

func (Key) Pretty

func (k Key) Pretty() string

Pretty returns Key in a b58 encoded string

type KeySet

type KeySet interface {
	Add(Key)
	Remove(Key)
	Keys() []Key
}

func NewKeySet

func NewKeySet() KeySet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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