-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathmain.go
40 lines (32 loc) · 1.1 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"log"
"github.com/AmbitiousJun/go-emby2alist/internal/config"
"github.com/AmbitiousJun/go-emby2alist/internal/util/colors"
"github.com/AmbitiousJun/go-emby2alist/internal/web"
)
const CurrentVersion = "v1.4.0"
const RepoAddr = "https://github.com/AmbitiousJun/go-emby2alist"
func main() {
printBanner()
log.Println("正在加载配置...")
if err := config.ReadFromFile("config.yml"); err != nil {
log.Fatal(err)
}
log.Println(colors.ToBlue("正在启动服务..."))
if err := web.Listen(); err != nil {
log.Fatal(colors.ToRed(err.Error()))
}
}
func printBanner() {
log.Printf(colors.ToYellow(`
_ ____ _ _ _
__ _ ___ ___ _ __ ___ | |__ _ _|___ \ __ _| (_)___| |_
/ _| |/ _ \ _____ / _ \ '_ | _ \| '_ \| | | | __) / _| | | / __| __|
| (_| | (_) |_____| __/ | | | | | |_) | |_| |/ __/ (_| | | \__ \ |_
\__, |\___/ \___|_| |_| |_|_.__/ \__, |_____\__,_|_|_|___/\__|
|___/ |___/
Repository: %s
Version: %s
`), RepoAddr, CurrentVersion)
}