uauth/main.go

22 lines
401 B
Go
Raw Normal View History

2024-10-23 17:46:15 +08:00
package main
import (
2024-10-23 22:42:13 +08:00
"context"
"github.com/loveuer/nf/nft/log"
"os/signal"
"syscall"
"uauth/internal/cmd"
2024-10-23 17:46:15 +08:00
)
// 假设这是你的用户认证函数
func main() {
2024-10-23 22:42:13 +08:00
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)
defer cancel()
2024-10-23 17:46:15 +08:00
2024-10-23 22:42:13 +08:00
if err := cmd.Command.ExecuteContext(ctx); err != nil {
log.Error(err.Error())
}
2024-10-23 17:46:15 +08:00
}