app

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App added in v0.0.6

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

Shutdown logic follows this example https://gist.github.com/akhenakh/38dbfea70dc36964e23acc19777f3869

func New added in v0.0.6

func New(cfg config.Config, env env.SpaceEnv) *App

func (*App) Run added in v0.0.6

func (a *App) Run(name string, component core.Component)

Run registers this component to be cleaned up on Shutdown

func (*App) RunAsync added in v0.0.6

func (a *App) RunAsync(name string, component core.AsyncComponent, fn func() error)

RunAsync performs the same function as Run() but also accepts an function to be run async to initialize the component.

func (*App) Shutdown added in v0.0.6

func (a *App) Shutdown() error

Shutdown would perform a graceful shutdown of all components added through the Run() or RunAsync() functions

func (*App) Start added in v0.0.6

func (a *App) Start(ctx context.Context) error

Start is the Entry point for the app. All module components are initialized and managed here. When a top level module that need to be shutdown on exit is initialized. It should be added to the apps list of tracked components using the `Run()` function, but if the component has a blocking start/run function it should be tracked with the `RunAsync()` function and call the blocking function in the input function block.

Jump to

Keyboard shortcuts

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