cmd

package
v0.0.0-...-5d80154 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = "unknown"
	Build   = "unknown"
	Time    = "unknown"
)

Build number and versions injected at compile time

View Source
var VersionCmd = &cobra.Command{
	Use:   "version",
	Short: "Show build, version and build date",
	Long:  versionHelp,
	Run: func(cmd *cobra.Command, args []string) {
		fmt.Printf("Build: %s\nVersion: %s\nBuild Date: %s\n", Build, Version, Time)
	},
}

VersionCmd is a command that will display the build number and version (if any)

Functions

func AddAllFlags

func AddAllFlags(c *cobra.Command)

AddAllFlags will add all the flags provided in this package to the provided command and will bind those flags with viper.

func AddChiaFlags

func AddChiaFlags(c *cobra.Command)

AddChiaFlags adds support for various chia related command line flags

func AddConfigurationFlag

func AddConfigurationFlag(c *cobra.Command)

AddConfigurationFlag adds support to provide a configuration file on the command line.

func AddLoggerFlags

func AddLoggerFlags(c *cobra.Command)

AddLoggerFlags adds support to configure the level of the logger.

func NewLogger

func NewLogger(c *Conf) zerolog.Logger

NewLogger will return a new logger

Types

type ChiaConf

type ChiaConf struct {
	Network string `mapstructure:"network"`
}

type Conf

type Conf struct {
	Log  LogConf  `mapstructure:"log"`
	Chia ChiaConf `mapstructure:"chia"`
}

func NewConf

func NewConf() (*Conf, error)

NewConf will parse and return the configuration

type LogConf

type LogConf struct {
	Level  string `mapstructure:"level"`
	Type   string `mapstructure:"type"`
	Caller bool   `mapstructure:"caller"`
}

Jump to

Keyboard shortcuts

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