Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AddCmd = &cobra.Command{ Use: "add PATH [PATH...]", Short: "Add file or folder to server", Long: `Add file or folder to server`, Run: func(cmd *cobra.Command, args []string) { if len(args) == 0 { fmt.Println("Error: Empty arguments") } if err := lib.InitSettings(lib.ConfigFile(), &appSettings); err != nil { fmt.Printf("Error: %s\n", err.Error()) } for _, arg := range args { if err := runAddCmd(arg, appSettings); err != nil { fmt.Printf("Error: %s\n", err.Error()) } } }, }
View Source
var PsCmd = &cobra.Command{ Use: "ps", Short: "List files or folders from server", Long: `List files or folders from server`, Run: func(cmd *cobra.Command, args []string) { if err := lib.InitSettings(lib.ConfigFile(), &appSettings); err != nil { fmt.Printf("Error: %s\n", err.Error()) } runPsCmd(appSettings) }, }
View Source
var RmCmd = &cobra.Command{ Use: "rm UUID [UUID...]", Short: "Remove file or folder from server", Long: `Remove file or folder from server`, Run: func(cmd *cobra.Command, args []string) { if len(args) == 0 { fmt.Println("Error: Empty arguments") } if err := lib.InitSettings(lib.ConfigFile(), &appSettings); err != nil { fmt.Printf("Error: %s\n", err.Error()) } for _, arg := range args { runRmCmd(arg, appSettings) } }, }
View Source
var RootCmd = &cobra.Command{ Use: "share", Short: "Share is a cli to share quickly a file with http protocol", Long: `Share is a cli to share quickly a file with http protocol with go. Complete documentation is available at https://github.com/devcows/share`, Run: func(cmd *cobra.Command, args []string) { fmt.Println("TODO use add, ps or rm") }, }
View Source
var ServerCmd = &cobra.Command{ Use: "server", Short: "Server APIREST", Long: `Server APIREST`, Run: func(cmd *cobra.Command, args []string) { if err := runServerCmd(lib.ConfigFile(), &appSettings); err != nil { log.Error(fmt.Sprintf("Error: %s", err)) os.Exit(-1) } log.Info("Running servers...") go lib.RunFileServer(appSettings) runShareServer(appSettings) }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.