start command doc
This commit is contained in:
+4
-8
@@ -30,13 +30,9 @@ import (
|
|||||||
// startCmd represents the start command
|
// startCmd represents the start command
|
||||||
var startCmd = &cobra.Command{
|
var startCmd = &cobra.Command{
|
||||||
Use: "start",
|
Use: "start",
|
||||||
Short: "A brief description of your command",
|
Short: "start telegram receive service",
|
||||||
Long: `A longer description that spans multiple lines and likely contains examples
|
Long: `open serial port
|
||||||
and usage of using your command. For example:
|
start a tcp server for processing`,
|
||||||
|
|
||||||
Cobra is a CLI library for Go that empowers applications.
|
|
||||||
This application is a tool to generate the needed files
|
|
||||||
to quickly create a Cobra application.`,
|
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
start()
|
start()
|
||||||
},
|
},
|
||||||
@@ -86,7 +82,7 @@ func start() {
|
|||||||
// above sending a value on `done`) and then exit.
|
// above sending a value on `done`) and then exit.
|
||||||
fmt.Println("awaiting signal")
|
fmt.Println("awaiting signal")
|
||||||
_ = utils.InitDb(dbFile, dbInit)
|
_ = utils.InitDb(dbFile, dbInit)
|
||||||
utils.Listen(socketAddress)
|
go utils.Listen(socketAddress)
|
||||||
for utils.ServerRunning {
|
for utils.ServerRunning {
|
||||||
if !utils.IsPortOpen() {
|
if !utils.IsPortOpen() {
|
||||||
log.Println("try to open port")
|
log.Println("try to open port")
|
||||||
|
|||||||
Reference in New Issue
Block a user