cfgutil

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2017 License: ISC Imports: 7 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 added in v0.1.0

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 added in v0.1.0

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

MarshalFlag satisifes the flags.Marshaler interface.

func (*AmountFlag) UnmarshalFlag added in v0.1.0

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

UnmarshalFlag satisifes the flags.Unmarshaler interface.

type CurveFlag added in v0.7.0

type CurveFlag struct {
	// contains filtered or unexported fields
}

CurveFlag describes a curve and implements the flags.Marshaler and Unmarshaler interfaces so it can be used as a config struct field.

func NewCurveFlag added in v0.7.0

func NewCurveFlag(defaultValue CurveID) *CurveFlag

NewCurveFlag creates a CurveFlag with a default curve.

func (*CurveFlag) Curve added in v0.7.0

func (f *CurveFlag) Curve() elliptic.Curve

Curve returns the elliptic.Curve specified by the flag.

func (*CurveFlag) MarshalFlag added in v0.7.0

func (f *CurveFlag) MarshalFlag() (name string, err error)

MarshalFlag satisifes the flags.Marshaler interface.

func (*CurveFlag) UnmarshalFlag added in v0.7.0

func (f *CurveFlag) UnmarshalFlag(value string) error

UnmarshalFlag satisifes the flags.Unmarshaler interface.

type CurveID added in v0.7.0

type CurveID int

CurveID specifies a recognized curve through a constant value.

const (
	CurveP224 CurveID = iota
	CurveP256
	CurveP384
	CurveP521
)

Recognized curve IDs.

Jump to

Keyboard shortcuts

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