Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

appcore

appcore is a small lifecycle manager for Go services. Each component is run in its own goroutine. When any component exits, every component receives a Shutdown call and Wait waits for the complete shutdown.

mgr := appcore.NewServiceMgr(appcore.WithLogger(logger))
mgr.Add(apiService, databaseService, appcoreServices.NewSignalService())

if err := mgr.StartAllService(); err != nil {
    return err
}
return mgr.Wait()

A component implements:

type IComponent interface {
    Init() error
    Start() error
    Shutdown()
    Name() string
}

Init calls are synchronous and ordered. No Start method runs unless every component initialized successfully. Start should block for the service's lifetime. Shutdown must cause its corresponding Start call to return.

About

golang app frame work

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages