cmd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ErrInterrupted is returned when the signal to application to stop was caught.

Functions

This section is empty.

Types

type CommonOptionsCommander

type CommonOptionsCommander interface {
	SetCommon(commonOpts CommonOpts)
	Execute(args []string) error
}

CommonOptionsCommander extends flags.Commander with SetCommon All commands should implement this interfaces

type CommonOpts

type CommonOpts struct {
	Version string
	Logger  logx.Logger
}

CommonOpts sets externally from main, shared across all commands

func (*CommonOpts) SetCommon

func (c *CommonOpts) SetCommon(opts CommonOpts)

SetCommon satisfies CommonOptionsCommander interface and sets common option fields The method called by main for each command

type Run

type Run struct {
	ConfLocation string `short:"c" long:"config_location" env:"CONFIG_LOCATION" description:"location of the configuration file"`
	Store        struct {
		Type string `long:"type" env:"TYPE" choice:"bolt" description:"type of storage"`
		Bolt struct {
			Path    string        `long:"path" env:"PATH" default:"./var" description:"parent dir for bolt files"`
			Timeout time.Duration `long:"timeout" env:"TIMEOUT" default:"30s" description:"bolt timeout"`
		} `group:"bolt" namespace:"bolt" env-namespace:"BOLT"`
	} `group:"store" namespace:"store" env-namespace:"STORE"`
	Webhook struct {
		BaseURL string `long:"base_url" env:"BASE_URL" description:"base url for webhooks"`
		Addr    string `long:"addr" env:"ADDR" description:"local address to listen"`
	} `group:"webhook" namespace:"webhook" env-namespace:"WEBHOOK"`
	UpdateTimeout time.Duration `long:"update_timeout" env:"UPDATE_TIMEOUT" description:"amount of time per processing single update"`
	CommonOpts
}

Run starts a tracker listener.

func (Run) Execute

func (r Run) Execute(_ []string) error

Execute runs the command

Jump to

Keyboard shortcuts

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