Documentation
¶
Index ¶
- func GetDestructorManager() *callstack.CallStack
- func RegisterDestructor(fn callstack.CallableFn)
- func Shutdown(arg error)
- type Container
- func (c *Container) AbortFatal(err error)
- func (c *Container) Exists(name string) bool
- func (c *Container) Get(name string) (interface{}, bool)
- func (c *Container) GetContext() context.Context
- func (c *Container) Register(name string, service interface{})
- func (c *Container) Run(mainFn ...RuntimeFn)
- func (c *Container) Terminate(err error)
- type RuntimeFn
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
// contains filtered or unexported fields
}
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
|
|
|
provider
|
|
|
clickhouse
The code on this file is mostly imported from the clickhouse-go project in https://github.com/ClickHouse/clickhouse-go/blob/main/struct_map.go; The original license is maintained
|
The code on this file is mostly imported from the clickhouse-go project in https://github.com/ClickHouse/clickhouse-go/blob/main/struct_map.go; The original license is maintained |
|
pgsql
AdvisoryLock implements primitives to use PostgreSQL's advisory locks.
|
AdvisoryLock implements primitives to use PostgreSQL's advisory locks. |
|
etcd
module
|
|
|
franz
module
|
|
|
s3
module
|
|
|
smtp
module
|
|
|
samples
|
|
|
application
command
|
|
|
ch-migrations
command
|
|
|
clickhouse
command
|
|
|
console
command
|
|
|
dbgrid
command
|
|
|
filelogging
command
|
|
|
htpasswd
command
|
|
|
http-csrf
command
|
|
|
httpserver
command
|
|
|
httpserver-authtoken
command
|
|
|
jwtprovider-example
command
|
|
|
kafka
command
|
|
|
metrics
command
|
|
|
mqtt
command
|
|
|
nats
command
|
|
|
nextjs-api-demo
command
|
|
|
pgsql
command
|
|
|
pgsql_migrations
command
|
|
|
session
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 |