You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
673 B
Go

3 years ago
package main
import (
"flag"
"fmt"
"git.noahlan.cn/northlan/ntools-go/logger"
3 years ago
"live-gateway/bilibili"
"live-gateway/config"
"sync"
)
var configFile = flag.String("f", "./config.yml", "the config file")
3 years ago
func main() {
flag.Parse()
config.Init(*configFile)
if err := logger.InitLogger(&config.Config.Log.File, &config.Config.Log.Console); err != nil {
fmt.Println("初始化logger错误", err)
}
defer logger.Sync()
3 years ago
var wg sync.WaitGroup
if config.Config.Bilibili.Enabled {
wg.Add(1)
bLive := bilibili.NewLiveBilibili()
go func() {
if err := bLive.Serve(); err != nil {
logger.SLog.Error("err", err)
wg.Done()
}
}()
}
3 years ago
wg.Wait()
}