Documentation ¶
Index ¶
- Variables
- func Check(err error)
- func Checkf(err error, format string, otherArgs ...interface{})
- func ContextForMainProcess(ctx context.Context) context.Context
- func Fatalf(format string, args ...interface{})
- func LoadKey(s string) ed25519.PrivateKey
- func NewConsoleLogger(levels string) log.Logger
- func Warnf(format string, args ...interface{})
- type JsonFlag
- type MultiaddrFlag
- type MultiaddrSliceFlag
- type PrivateKeyFlag
- type UrlFlag
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInterrupted = errors.New("interrupted")
Functions ¶
func ContextForMainProcess ¶ added in v1.4.0
ContextForMainProcess creates a context that is canceled if the process receives SIGINT or SIGTERM. Once SIGINT/SIGTERM is received the handler is removed, so a second signal will terminate the process as normal. When canceled via a signal, context.Context.Error will return ErrInterrupted.
SeeAlso signal.NotifyContext - the only difference is that this version cancels with ErrInterrupted.
func LoadKey ¶
func LoadKey(s string) ed25519.PrivateKey
LoadKey attempts to parse the given string as a secret key address or file.
func NewConsoleLogger ¶
Types ¶
type JsonFlag ¶ added in v1.4.0
type JsonFlag[V any] struct { V V }
func JsonFlagOf ¶ added in v1.4.0
type MultiaddrFlag ¶
type MultiaddrFlag struct {
Value *multiaddr.Multiaddr
}
func (MultiaddrFlag) Set ¶
func (m MultiaddrFlag) Set(s string) error
func (MultiaddrFlag) String ¶
func (m MultiaddrFlag) String() string
func (MultiaddrFlag) Type ¶
func (m MultiaddrFlag) Type() string
type MultiaddrSliceFlag ¶
type MultiaddrSliceFlag []multiaddr.Multiaddr
func (*MultiaddrSliceFlag) Set ¶
func (m *MultiaddrSliceFlag) Set(s string) error
func (MultiaddrSliceFlag) String ¶
func (m MultiaddrSliceFlag) String() string
func (MultiaddrSliceFlag) Type ¶
func (m MultiaddrSliceFlag) Type() string
type PrivateKeyFlag ¶ added in v1.4.0
type PrivateKeyFlag struct {
Value run.PrivateKey
}
func (*PrivateKeyFlag) Set ¶ added in v1.4.0
func (f *PrivateKeyFlag) Set(s string) error
func (*PrivateKeyFlag) String ¶ added in v1.4.0
func (f *PrivateKeyFlag) String() string
func (*PrivateKeyFlag) Type ¶ added in v1.4.0
func (f *PrivateKeyFlag) Type() string
Click to show internal directories.
Click to hide internal directories.