Documentation ¶
Index ¶
- func Check(err error) bool
- func Debug(a ...interface{})
- func Debugc(fn func() string)
- func Debugf(format string, a ...interface{})
- func Debugs(a interface{})
- func Error(a ...interface{})
- func Errorc(fn func() string)
- func Errorf(format string, a ...interface{})
- func Errors(a interface{})
- func Fatal(a ...interface{})
- func Fatalc(fn func() string)
- func Fatalf(format string, a ...interface{})
- func Fatals(a interface{})
- func FileExists(filePath string) (bool, error)
- func Info(a ...interface{})
- func Infoc(fn func() string)
- func Infof(format string, a ...interface{})
- func Infos(a interface{})
- func NormalizeAddress(addr string, defaultPort string) (hostport string, err error)
- func NormalizeAddresses(addrs []string, defaultPort string) ([]string, error)
- func Trace(a ...interface{})
- func Tracec(fn func() string)
- func Tracef(format string, a ...interface{})
- func Traces(a interface{})
- func Warn(a ...interface{})
- func Warnc(fn func() string)
- func Warnf(format string, a ...interface{})
- func Warns(a interface{})
- type AmountFlag
- type ExplicitString
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileExists ¶
FileExists reports whether the named file or directory exists.
func NormalizeAddress ¶
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 ¶
NormalizeAddresses returns a new slice with all the passed peer addresses normalized with the given default port, and all duplicates removed.
Types ¶
type AmountFlag ¶
AmountFlag embeds a util.Amount and implements the flags.Marshaler and Unmarshaler interfaces so it can be used as a config struct field.
func NewAmountFlag ¶
func NewAmountFlag(defaultValue util.Amount) *AmountFlag
NewAmountFlag creates an AmountFlag with a default util.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.
type ExplicitString ¶
type ExplicitString struct { Value string // contains filtered or unexported fields }
ExplicitString is a string value implementing the flags.Marshaler and flags.Unmarshaler interfaces so it may be used as a config struct field. It records whether the value was explicitly set by the flags package.
This is useful when behavior must be modified depending on whether a flag was set by the user or left as a default.
Without recording this, it would be impossible to determine whether flag with a default value was unmodified or explicitly set to the default.
func NewExplicitString ¶
func NewExplicitString(defaultValue string) *ExplicitString
NewExplicitString creates a string flag with the provided default value.
func (*ExplicitString) ExplicitlySet ¶
func (e *ExplicitString) ExplicitlySet() bool
ExplicitlySet returns whether the flag was explicitly set through the flags.Unmarshaler interface.
func (*ExplicitString) MarshalFlag ¶
func (e *ExplicitString) MarshalFlag() (string, error)
MarshalFlag implements the flags.Marshaler interface.
func (*ExplicitString) UnmarshalFlag ¶
func (e *ExplicitString) UnmarshalFlag(value string) error
UnmarshalFlag implements the flags.Unmarshaler interface.