Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "chkit", PersistentPreRun: func(cmd *cobra.Command, args []string) { if debug, _ := cmd.Flags().GetBool("debug"); debug { np = jww.NewNotepad(jww.LevelDebug, jww.LevelDebug, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime) } else { np = jww.NewNotepad(jww.LevelInfo, jww.LevelInfo, os.Stdout, ioutil.Discard, "", log.Ldate|log.Ltime) } db, err := dbconfig.OpenOrCreate(chlib.ConfigFile, np) exitOnErr(err) apiConfig, err := db.GetHttpApiConfig() exitOnErr(err) tcpApiConfig, err := db.GetTcpApiConfig() exitOnErr(err) userConfig, err := db.GetUserInfo() exitOnErr(err) uuid := helpers.UuidV4() client = &chlib.Client{ ApiHandler: &chlib.HttpApiHandler{Config: &apiConfig, UserInfo: &userConfig, Np: np, Channel: uuid}, TcpApiHandler: &chlib.TcpApiHandler{Config: &tcpApiConfig, UserInfo: &userConfig, Np: np, Channel: uuid}, UserConfig: &userConfig, } exitOnErr(db.Close()) }, Run: func(cmd *cobra.Command, args []string) { if cmd.Flags().NFlag() == 0 { cmd.Usage() } }, BashCompletionFunction: bashCompletionFunc, }
RootCmd main cmd entrypoint
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.