busy

package
v2.0.2-ea Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package busy implements a dispatcher for BusyBox-style multi-call binaries.

BUG(lukeshu): Global state is bad, but this package has global state in the form of the global log level.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogLevel

func GetLogLevel() logrus.Level

GetLogLevel gets the global program-wide log level.

BUG(lukeshu): GetLogLevel accesses global state, and global state is bad.

func Main

func Main(binName, humanName string, version string, cmds map[string]Command)

Main should be called from your actual main() function.

func SetLogLevel

func SetLogLevel(lvl logrus.Level)

SetLogLevel sets the global program-wide log level.

BUG(lukeshu): SetLogLevel mutates global state, and global state is bad.

Types

type Command

type Command struct {
	Setup func()
	Run   func(ctx context.Context, version string, args ...string) error
}

Notes

Bugs

  • Global state is bad, but this package has global state in the form of the global log level.

  • SetLogLevel mutates global state, and global state is bad.

  • GetLogLevel accesses global state, and global state is bad.

Jump to

Keyboard shortcuts

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