Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDestructorManager ¶
GetDestructorManager Retrieve callback manager
func RegisterDestructor ¶
func RegisterDestructor(fn callstack.CallableFn)
RegisterDestructor Register a function to perform shutdown procedures
Types ¶
type Container ¶
type Container struct {
Config config.ConfigInterface
Context context.Context
CancelCtx context.CancelFunc
}
func NewContainer ¶
func NewContainer(config config.ConfigInterface) *Container
NewContainer create new container runtime with the specified config provider and a new application context
func (*Container) AbortFatal ¶
AbortFatal aborts execution in case of fatal error
func (*Container) GetContext ¶
GetContext helper function to retrieve context
func (*Container) Run ¶
Run runs application container mainFn is a collection of non-blocking functions; they will be executed in order. each one will receive the Container object as the parameter: Example:
object.Run(func(app interface{}) error{
app := a.(*Container)
app.AbortFatal(nil) // won't abort because arg is nil
return nil
})
the main loop will wait for an os signal on the 'monitor' channel; when signal is received, the application is terminated in an orderly fashion by invoking Terminate()
Directories
¶
| Path | Synopsis |
|---|---|
|
crypt
|
|
|
log
|
|
|
provider
|
|
|
pgsql
AdvisoryLock implements primitives to use PostgreSQL's advisory locks.
|
AdvisoryLock implements primitives to use PostgreSQL's advisory locks. |
|
etcd
module
|
|
|
franz
module
|
|
|
hmacprovider
module
|
|
|
htpasswd
module
|
|
|
jwtprovider
module
|
|
|
nats
module
|
|
|
prometheus
module
|
|
|
redis
module
|
|
|
s3
module
|
|
|
smtp
module
|
|
|
sample
|
|
|
application
command
|
|
|
clickhouse
command
|
|
|
console
command
|
|
|
httpserver
command
|
|
|
kafka
command
|
|
|
metrics
command
|
|
|
mqtt
command
|
|
|
pgsql
command
|
|
|
pgsql_migrations
command
|
|
|
types
|
|
|
threadsafe
* imported from https://github.com/hayageek/threadsafe * (c) Copyright (c) 2024 Ravishanker Kusuma - MIT License * See LICENSE for more details
|
* imported from https://github.com/hayageek/threadsafe * (c) Copyright (c) 2024 Ravishanker Kusuma - MIT License * See LICENSE for more details |