cfgutil

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 10, 2016 License: ISC Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(filePath string) (bool, error)

FileExists reports whether the named file or directory exists.

func NormalizeAddress

func NormalizeAddress(addr string, defaultPort string) (hostport string, err error)

NormalizeAddress returns the normalized form of the address, adding a default port if necessary. An error is returned if the address, even without a port, is not valid.

func NormalizeAddresses

func NormalizeAddresses(addrs []string, defaultPort string) ([]string, error)

NormalizeAddresses returns a new slice with all the passed peer addresses normalized with the given default port, and all duplicates removed.

Types

type AmountFlag

type AmountFlag struct {
	dcrutil.Amount
}

AmountFlag embeds a dcrutil.Amount and implements the flags.Marshaler and Unmarshaler interfaces so it can be used as a config struct field.

func NewAmountFlag added in v0.1.3

func NewAmountFlag(defaultValue dcrutil.Amount) *AmountFlag

NewAmountFlag creates an AmountFlag with a default dcrutil.Amount.

func (*AmountFlag) MarshalFlag

func (a *AmountFlag) MarshalFlag() (string, error)

MarshalFlag satisifes the flags.Marshaler interface.

func (*AmountFlag) UnmarshalFlag

func (a *AmountFlag) UnmarshalFlag(value string) error

UnmarshalFlag satisifes the flags.Unmarshaler interface.

Jump to

Keyboard shortcuts

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