mirror of
https://github.com/elyby/chrly.git
synced 2024-12-26 15:00:25 +05:30
22 lines
317 B
Go
22 lines
317 B
Go
package di
|
|
|
|
import (
|
|
"context"
|
|
"os"
|
|
"os/signal"
|
|
"syscall"
|
|
|
|
"github.com/defval/di"
|
|
)
|
|
|
|
var contextDiOptions = di.Options(
|
|
di.Provide(newBaseContext),
|
|
)
|
|
|
|
func newBaseContext() context.Context {
|
|
ctx := context.Background()
|
|
ctx, _ = signal.NotifyContext(ctx, os.Interrupt, syscall.SIGTERM, os.Kill)
|
|
|
|
return ctx
|
|
}
|