daemon

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorSystem

type ActorSystem struct {
	system.Support
}

ActorSystem represents actor system subroutine

func NewActorSystem

func NewActorSystem(ctx context.Context, cfg config.Configuration) ActorSystem

NewActorSystem returns actor system fascade

type Server

type Server struct {
	Support
	// contains filtered or unexported fields
}

Server is a fascade for http-server following handler api of Gin and lifecycle api of http

func NewServer

func NewServer(ctx context.Context, cfg config.Configuration, system *ActorSystem) Server

NewServer returns new secure server instance

func (Server) HandleFunc

func (server Server) HandleFunc(path string, handle func(w http.ResponseWriter, r *http.Request), methods ...string) *mux.Route

HandleFunc registerer route

func (Server) Start

func (server Server) Start()

Start handles everything needed to start http-server daemon

func (Server) Stop

func (server Server) Stop()

Stop tries to shut down http-server daemon gracefully within 5 seconds

type Support

type Support struct {
	IsReady chan interface{}
	// contains filtered or unexported fields
}

Support provides support for graceful shutdown

func NewDaemonSupport

func NewDaemonSupport(parentCtx context.Context) Support

NewDaemonSupport constructor

func (Support) Done

func (s Support) Done() <-chan struct{}

Done cancel channel

func (Support) MarkDone

func (s Support) MarkDone()

MarkDone signals daemon is finished

func (Support) MarkReady

func (s Support) MarkReady()

MarkReady signals daemon is ready

func (Support) Start

func (s Support) Start()

Start daemon and wait for it to be ready

func (Support) Stop

func (s Support) Stop()

Stop daemon and wait for graceful shutdown

Jump to

Keyboard shortcuts

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