appactions

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppRunErr = errors.New("An error occurred running the application")
View Source
var AppSetupErr = errors.New("An error occurred setting up the application")
View Source
var AppTeardownErr = errors.New("An error occurred tearing down the application")
View Source
var UnknownActionErr = errors.New(
	"The supplied enum value has no associated action",
)

Functions

func NewAppActionParser

func NewAppActionParser[E enum.Value, EP enum.Pntr[E]](val *E) *argparse.Parser

Creates a parser that has -a and --action falgs. These flags will be used to set an enum value that should be use to tell your application what action it needs to perform.

Types

type Action

type Action interface {
	Setup() error
	Run() error
	Teardown() error
}

type ActionRegistry

type ActionRegistry map[enum.Value]Action

func (ActionRegistry) PerformAction

func (a ActionRegistry) PerformAction(e enum.Value) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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