cmd

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 9, 2023 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfCmd = &cobra.Command{
	Use:   "conf",
	Short: "conf",
	Long:  `config file`,
	RunE:  Conf,
}
View Source
var InitCmd = &cobra.Command{
	Use:   "init",
	Short: "init and check config",
	Long:  `auto create config file or check config, and auto add new key and delete old key`,
	RunE:  Init,
}
View Source
var RootCmd = &cobra.Command{
	Use:   "synctv-server",
	Short: "synctv-server",
	Long:  `synctv-server https://github.com/synctv-org/synctv`,
}
View Source
var ServerCmd = &cobra.Command{
	Use:               "server",
	Short:             "Start synctv-server",
	Long:              `Start synctv-server`,
	PersistentPreRunE: Init,
	PreRunE:           func(cmd *cobra.Command, args []string) error { return InitGinMode() },
	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", conf.Version)
		fmt.Printf("- web/version: %s\n", conf.WebVersion)
		fmt.Printf("- git/commit: %s\n", conf.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

func Conf added in v0.2.0

func Conf(cmd *cobra.Command, args []string) error

func Execute

func Execute()

func Init

func Init(cmd *cobra.Command, args []string) error

func InitGinMode

func InitGinMode() error

func Server

func Server(cmd *cobra.Command, args []string)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL