cmdutil

package
v1.4.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterrupted = errors.New("interrupted")

Functions

func Check

func Check(err error)

func Checkf

func Checkf(err error, format string, otherArgs ...interface{})

func ContextForMainProcess added in v1.4.0

func ContextForMainProcess(ctx context.Context) context.Context

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 Fatalf

func Fatalf(format string, args ...interface{})

func LoadKey

func LoadKey(s string) ed25519.PrivateKey

LoadKey attempts to parse the given string as a secret key address or file.

func NewConsoleLogger

func NewConsoleLogger(levels string) log.Logger

func Warnf

func Warnf(format string, args ...interface{})

Types

type JsonFlag added in v1.4.0

type JsonFlag[V any] struct {
	V V
}

func JsonFlagOf added in v1.4.0

func JsonFlagOf[V any](v V) *JsonFlag[V]

func (*JsonFlag[V]) Set added in v1.4.0

func (f *JsonFlag[V]) Set(s string) error

func (*JsonFlag[V]) String added in v1.4.0

func (f *JsonFlag[V]) String() string

func (*JsonFlag[V]) Type added in v1.4.0

func (f *JsonFlag[V]) Type() string

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

type UrlFlag

type UrlFlag struct {
	V *url.URL
}

func (*UrlFlag) Set

func (f *UrlFlag) Set(s string) error

func (*UrlFlag) String

func (f *UrlFlag) String() string

func (*UrlFlag) Type

func (f *UrlFlag) Type() string

Jump to

Keyboard shortcuts

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