sourcePath := "example_file.txt" destinationPath := "/home/user/example_file.txt" err := uploader.Upload(sourcePath, destinationPath) if err != nil { fmt.Println("Failed to upload file:", err) }
timeout := 60 * time.Second sourceDir := "example_directory" destinationDir := "/home/user/example_directory" err := uploader.UploadDir(sourceDir, destinationDir, timeout) if err != nil { fmt.Println("Failed to upload directory:", err) }This code example shows how to upload an entire directory named "example_directory" to the remote system at the path "/home/user/example_directory". The timeout parameter sets a maximum duration for the upload process.