busy

package
v1.14.4 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2022 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 added in v1.10.0

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 added in v1.10.0

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 added in v1.10.0

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