cmd

package
v0.2.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 17 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CoreFlags added in v0.2.0

func CoreFlags() *flag.FlagSet

CoreFlags gives a set of hardcoded Core flags.

func HeadersFlags added in v0.2.0

func HeadersFlags() *flag.FlagSet

HeadersFlags gives a set of hardcoded Header package flags.

func Init

func Init(fsets ...*flag.FlagSet) *cobra.Command

Init constructs a CLI command to initialize Celestia Node of any type with the given flags.

func MiscFlags added in v0.2.0

func MiscFlags() *flag.FlagSet

MiscFlags gives a set of hardcoded miscellaneous flags.

func NodeFlags added in v0.2.0

func NodeFlags(tp node.Type) *flag.FlagSet

NodeFlags gives a set of hardcoded Node package flags.

func P2PFlags added in v0.2.0

func P2PFlags() *flag.FlagSet

P2PFlags gives a set of p2p flags.

func ParseCoreFlags added in v0.2.0

func ParseCoreFlags(cmd *cobra.Command, env *Env) error

ParseCoreFlags parses Core flags from the given cmd and applies values to Env.

func ParseHeadersFlags added in v0.2.0

func ParseHeadersFlags(cmd *cobra.Command, env *Env) error

ParseHeadersFlags parses Header package flags from the given cmd and applies values to Env.

func ParseMiscFlags added in v0.2.0

func ParseMiscFlags(cmd *cobra.Command) error

ParseMiscFlags parses miscellaneous flags from the given cmd and applies values to Env.

func ParseNodeFlags added in v0.2.0

func ParseNodeFlags(cmd *cobra.Command, env *Env) error

ParseNodeFlags parses Node flags from the given cmd and applies values to Env.

func ParseP2PFlags added in v0.2.0

func ParseP2PFlags(cmd *cobra.Command, env *Env) error

ParseP2PFlags parses P2P flags from the given cmd and applies values to Env.

func ParseTrustedHashFlags added in v0.2.0

func ParseTrustedHashFlags(cmd *cobra.Command, env *Env) error

ParseHeadersFlags parses Header package flags from the given cmd and applies values to Env.

func ParseTrustedPeerFlags added in v0.2.0

func ParseTrustedPeerFlags(cmd *cobra.Command, env *Env) error

ParseTrustedPeerFlags parses Header package flags from the given cmd and applies values to Env.

func Start

func Start(fsets ...*flag.FlagSet) *cobra.Command

Start constructs a CLI command to start Celestia Node daemon of any type with the given flags.

func TrustedHashFlags added in v0.2.0

func TrustedHashFlags() *flag.FlagSet

TrustedHashFlags returns a set of flags related to configuring a `TrustedHash`.

func TrustedPeerFlags added in v0.2.0

func TrustedPeerFlags() *flag.FlagSet

TrustedPeerFlags returns a set of flags related to configuring a `TrustedPeer`.

func WithEnv added in v0.2.0

func WithEnv(ctx context.Context) context.Context

WithEnv wraps given ctx with Env.

Types

type Env added in v0.2.0

type Env struct {
	NodeType  node.Type
	StorePath string
	// contains filtered or unexported fields
}

Env is an environment for CLI commands. It can be used to: 1. Propagate values from parent to child commands. 2. To group common logic that multiple commands rely on. Usage can be extended.

func GetEnv added in v0.2.0

func GetEnv(ctx context.Context) (*Env, error)

GetEnv takes Env from the given ctx, if any.

func (*Env) AddOptions added in v0.2.0

func (env *Env) AddOptions(opts ...node.Option)

AddOptions add new options to Env.

func (*Env) Options added in v0.2.0

func (env *Env) Options() []node.Option

Options returns Node Options parsed from Environment(Flags, ENV vars, etc)

func (*Env) SetNodeType added in v0.2.0

func (env *Env) SetNodeType(tp node.Type)

SetNodeType sets Node Type to the Env.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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