add swagger

This commit is contained in:
yanghao05
2023-06-09 14:32:21 +08:00
parent 37bf456102
commit 3f27dee0b2
23 changed files with 245 additions and 89 deletions

View File

@@ -3,19 +3,23 @@ package container
import (
"context"
"log"
"os/signal"
"syscall"
"github.com/rogeecn/atom/utils/opt"
"github.com/spf13/viper"
"go.uber.org/dig"
)
var Container *dig.Container = dig.New()
var Cancel context.CancelFunc
var closeable []func()
var (
Container *dig.Container = dig.New()
Cancel context.CancelFunc
closeable []func()
)
func init() {
if err := Container.Provide(func() context.Context {
ctx, cancel := context.WithCancel(context.Background())
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
Cancel = cancel
return ctx
}); err != nil {