Documentation ¶
Index ¶
Constants ¶
View Source
const SelfUpdateLong = `` /* 207-byte string literal not displayed */
Variables ¶
View Source
var ConfCmd = &cobra.Command{ Use: "conf", Short: "init or check", Long: `Init or check config file for correctness`, PreRunE: func(cmd *cobra.Command, args []string) error { return bootstrap.New(bootstrap.WithContext(cmd.Context())).Add( bootstrap.InitConfig, ).Run() }, RunE: Conf, }
View Source
var RootCmd = &cobra.Command{ Use: "synctv", Short: "synctv", Long: `synctv https://github.com/synctv-org/synctv`, PersistentPreRun: func(cmd *cobra.Command, args []string) { s, err := utils.GetEnvFiles(flags.DataDir) if err != nil { logrus.Warnf("get env files error: %v", err) } if flags.Dev { ss, err := utils.GetEnvFiles(".") if err != nil { logrus.Warnf("get env files error: %v", err) } s = append(s, ss...) } if len(s) != 0 { if flags.EnvFileOverload { log.Infof("overload env from: %v", s) err = godotenv.Overload(s...) } else { log.Infof("load env from: %v", s) err = godotenv.Load(s...) } if err != nil { logrus.Fatalf("load env error: %v", err) } } }, }
View Source
var SelfUpdateCmd = &cobra.Command{ Use: "self-update", Short: "self-update", Long: SelfUpdateLong, PreRunE: func(cmd *cobra.Command, args []string) error { return bootstrap.New(bootstrap.WithContext(cmd.Context())).Add( bootstrap.InitStdLog, ).Run() }, RunE: SelfUpdate, }
View Source
var ServerCmd = &cobra.Command{ Use: "server", Short: "Start synctv-server", Long: `Start synctv-server`, PreRunE: func(cmd *cobra.Command, args []string) error { boot := bootstrap.New(bootstrap.WithContext(cmd.Context())).Add( bootstrap.InitSysNotify, bootstrap.InitConfig, bootstrap.InitGinMode, bootstrap.InitLog, bootstrap.InitDatabase, bootstrap.InitProvider, bootstrap.InitOp, bootstrap.InitRtmp, bootstrap.InitVendorBackend, bootstrap.InitSetting, ) if !flags.DisableUpdateCheck { boot.Add(bootstrap.InitCheckUpdate) } return boot.Run() }, Run: Server, }
View Source
var VersionCmd = &cobra.Command{ Use: "version", Short: "Print the version number of Sync TV Server", Long: `All software has versions. This is Sync TV Server's`, Run: func(cmd *cobra.Command, args []string) { fmt.Printf("synctv %s\n", version.Version) fmt.Printf("- web/version: %s\n", version.WebVersion) fmt.Printf("- git/commit: %s\n", version.GitCommit) fmt.Printf("- os/platform: %s\n", runtime.GOOS) fmt.Printf("- os/arch: %s\n", runtime.GOARCH) fmt.Printf("- go/version: %s\n", runtime.Version()) fmt.Printf("- go/compiler: %s\n", runtime.Compiler) }, }
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.