app

package
v0.0.0-...-39e06ca Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (

	// InitializingStatus means app is still intializing
	InitializingStatus = "Initializing"

	// ReadyStatus means app is fully initialized and running
	ReadyStatus = "Ready"

	// TerminatedStatus means app gracefully terminated
	TerminatedStatus = "Terminated"

	// ErrorStatus indicates app encountered an error
	ErrorStatus = "Error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App interface {
	Run() Status
}

App interface

type ContextIn

type ContextIn struct {
	StartupTimeoutInSeconds int
	HTTPServer              http.Server
	ShutdownHooks           []ShutdownHook
}

ContextIn describes dependecies needed by this package

type ContextOut

type ContextOut struct {
	App    App
	Signal chan<- os.Signal
	Status <-chan Status
}

ContextOut describes dependencies exported by this package

func Bootstrap

func Bootstrap(in *ContextIn) *ContextOut

Bootstrap initializes this module with ContextIn and exports resulting ContextOut

type ShutdownHook

type ShutdownHook func()

ShutdownHook function type

type Status

type Status struct {
	Status string
	Detail string
}

Status of application

Jump to

Keyboard shortcuts

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