kos/cmd/main.go

36 lines
544 B
Go
Raw Normal View History

2023-04-23 17:57:36 +08:00
package main
import (
"context"
"embed"
"flag"
"git.nspix.com/golang/kos"
"git.nspix.com/golang/kos/pkg/log"
)
//go:embed web
var webDir embed.FS
type subServer struct {
}
func (s *subServer) Start(ctx context.Context) (err error) {
kos.Http().Embed("/ui/web", "web", webDir)
return
}
func (s *subServer) Stop() (err error) {
log.Debugf("stopxxx")
return
}
func main() {
flag.Parse()
svr := kos.Init(
kos.WithName("git.nspix.com/golang/test", "0.0.1"),
kos.WithServer(&subServer{}),
2023-05-31 11:14:15 +08:00
kos.WithDirectHttp(),
2023-04-23 17:57:36 +08:00
)
svr.Run()
}