app

package
v0.0.0-...-24e03d9 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EnumParamFoo = "foo"
	EnumParamBar = "bar"
	EnumParamBaz = "baz"
)

Variables

This section is empty.

Functions

func NewAppDB

func NewAppDB(path string, appName string) *appDB

Types

type App

type App struct {
	AppName      string
	DatabasePath string
	ViperCfg     *viper.Viper
	Logger       *log.Logger
	// contains filtered or unexported fields
}

App gives the global persistent state for the application Example fields

func NewApp

func NewApp(appName string, databasePath string, viperCfg *viper.Viper, logger *log.Logger) *App

NewApp() creates a new App object

func (*App) Close

func (a *App) Close() error

Close tidies up any data structures, such as open database connection

func (*App) Example

func (a *App) Example() error

The logic for the "example" command, separated from CLI plumbing

func (*App) Init

func (a *App) Init() error

Init() initializes the application state Other methods are best structured in their own files

func (*App) OpenAppDB

func (a *App) OpenAppDB() error

OpenAppDB opens the application database if it exists

func (*App) SubCommand

func (a *App) SubCommand(fixedParam string, enumParam string) error

Jump to

Keyboard shortcuts

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