init
This commit is contained in:
24
main.go
Normal file
24
main.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"iptv/core"
|
||||
)
|
||||
|
||||
func main() {
|
||||
core.UpdateFmmIpv6M3u()
|
||||
//core.UpdateFmmIpv6ToTxtM3u()
|
||||
core.CronRegister("0 */5 * * * ?", core.UpdateFmmIpv6M3u)
|
||||
core.CronRegister("0 */2 * * * ?", core.UpdateFmmIpv6ToTxtM3u)
|
||||
core.CronRun()
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
r := gin.Default()
|
||||
r.GET("/ipv6-iptv.m3u", core.HandlerIpv6M3u)
|
||||
r.GET("/diyp-ipv6-iptv.m3u", core.HandlerDiypIpv6IptvM3u)
|
||||
err := r.Run("0.0.0.0:6677")
|
||||
if err != nil {
|
||||
fmt.Printf("gin服务启动失败:%s\n", err.Error())
|
||||
return
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user