Example #1
0
// Stop tears down all components and finally stops thrust and webserver
func (b *Blank) Stop() {
	// TODO graceful shutdown (teardown http, then exit)
	log.Println("shutting down...")

	for _, c := range components.Components() {
		c.Teardown()
	}

	thrust.Exit()
	os.Exit(0)
}
Example #2
0
// Start initializes thrust and starts the http server
func (b *Blank) Start() error {
	// load config
	if err := b.initThrust(); err != nil {
		return err
	}

	for _, c := range components.Components() {
		c.Setup(b, b.tunnel)
	}

	return b.startHTTP()
}