working commit

This commit is contained in:
2026-01-23 19:26:56 +02:00
parent 772657d9be
commit d704a76bee
10 changed files with 161 additions and 76 deletions
+45 -4
View File
@@ -20,10 +20,40 @@ func (util *Util) AddFileCmds() {
putFileCmd.Flags().StringVarP(&util.putFileParams.Dest, "dest", "d", "", "Desctination path")
subCmd.AddCommand(putFileCmd)
util.rootCmd.AddCommand(subCmd)
var getFileCmd = &cobra.Command{
Use: "put",
Short: "Put file to storage",
Run: util.PutFile,
}
getFileCmd.Flags().StringVarP(&util.getFileParams.Username, "username", "u", "", "Username")
getFileCmd.Flags().StringVarP(&util.getFileParams.Password, "password", "p", "", "Password")
getFileCmd.Flags().StringVarP(&util.getFileParams.Source, "source", "s", "", "Source path")
getFileCmd.Flags().StringVarP(&util.getFileParams.Dest, "dest", "d", "", "Desctination path")
subCmd.AddCommand(getFileCmd)
util.rootCmd.AddCommand(subCmd)
}
type FileUtil struct {
fileExists FileExistsParams
putFileParams PutFileParams
getFileParams GetFileParams
deleteFileParams DeleteFileParams
}
// File exists
type FileExistsParams struct {
Filepath string
Username string
Password string
}
func (util *Util) FileExists(cmd *cobra.Command, args []string) {
}
// Put file
type PutFileParams struct {
Source string
Dest string
@@ -31,8 +61,10 @@ type PutFileParams struct {
Password string
}
func (util *Util) PutFile(cmd *cobra.Command, args []string) {}
func (util *FileUtil) PutFile(cmd *cobra.Command, args []string) {
}
// Get file
type GetFileParams struct {
Source string
Dest string
@@ -40,6 +72,15 @@ type GetFileParams struct {
Password string
}
func (util *Util) GetFile(cmd *cobra.Command, args []string) {}
func (util *FileUtil) GetFile(cmd *cobra.Command, args []string) {
}
func (util *Util) DeleteFile(cmd *cobra.Command, args []string) {}
// Delete file
type DeleteFileParams struct {
Filepath string
Username string
Password string
}
func (util *FileUtil) DeleteFile(cmd *cobra.Command, args []string) {
}