init: 0.0.4

This commit is contained in:
loveuer
2025-04-27 16:38:51 +08:00
commit fb96934abe
24 changed files with 3297 additions and 0 deletions

25
main.go Normal file
View File

@ -0,0 +1,25 @@
package main
import (
"context"
"flag"
"github.com/loveuer/ushare/internal/api"
"github.com/loveuer/ushare/internal/opt"
"os/signal"
"syscall"
)
func init() {
flag.BoolVar(&opt.Cfg.Debug, "debug", false, "debug mode")
flag.StringVar(&opt.Cfg.Address, "address", "0.0.0.0:80", "")
flag.Parse()
}
func main() {
ctx, cancel := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
defer cancel()
api.Start(ctx)
<-ctx.Done()
}