123456789101112131415161718192021222324252627 |
- package main
- import (
- "baize-playground/gateway/api"
- DEATH "github.com/vrecan/death"
- "syscall"
- )
- func main() {
- api.NewGateway()
- defer api.DestroyGateway()
- go func() {
- if err := api.Start(); err != nil {
- panic(err)
- }
- }()
- defer func() {
- if err := api.Finish(); err != nil {
- panic(err)
- }
- }()
- death := DEATH.NewDeath(syscall.SIGINT, syscall.SIGTERM)
- _ = death.WaitForDeath()
- }
|