app

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is the application.

func New

func New(name, dataDir string, opts ...Option) (*App, error)

New initializes a new application with the given options. dataDir specifies the directory where application data will be stored, though this can be overriden with the DISCO_DATA_DIR environment variable, and --data-dir CLI flag.

func (*App) Run

func (app *App) Run(args []string) error

Run initializes the application environment and starts execution of the application.

type Option

type Option func(*App)

Option is a function that allows configuring the application.

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets the main context.

func WithDB

func WithDB(d *db.DB) Option

WithDB sets the main Disco database.

func WithEnv

func WithEnv(env actx.Environment) Option

WithEnv sets the process environment used by the application.

func WithFDs

func WithFDs(stdin io.Reader, stdout, stderr io.Writer) Option

WithFDs sets the file descriptors used by the application.

func WithFS

func WithFS(fs vfs.FileSystem) Option

WithFS sets the filesystem used by the application.

func WithLogger

func WithLogger(isStdoutTTY, isStderrTTY bool) Option

WithLogger initializes the logger used by the application.

func WithStore

func WithStore(store store.Store) Option

WithStore sets the key-value store.

func WithUser

func WithUser(user *models.User) Option

WithUser sets the local user of the app.

Directories

Path Synopsis
Package context contains the application context types.
Package context contains the application context types.

Jump to

Keyboard shortcuts

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