Move module declaration and all internal imports from github.com/Snider/Borg to forge.lthn.ai/Snider/Borg. Also updates Enchantrix dependency path to forge.lthn.ai/Snider/Enchantrix. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
682 B
Go
32 lines
682 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"forge.lthn.ai/Snider/Borg/pkg/website"
|
|
)
|
|
|
|
func main() {
|
|
log.Println("Collecting website...")
|
|
|
|
// Download and package the website.
|
|
dn, err := website.DownloadAndPackageWebsite("https://example.com", 2, nil)
|
|
if err != nil {
|
|
log.Fatalf("Failed to collect website: %v", err)
|
|
}
|
|
|
|
// Serialize the DataNode to a tarball.
|
|
tarball, err := dn.ToTar()
|
|
if err != nil {
|
|
log.Fatalf("Failed to serialize datanode to tar: %v", err)
|
|
}
|
|
|
|
// Write the tarball to a file.
|
|
err = os.WriteFile("website.dat", tarball, 0644)
|
|
if err != nil {
|
|
log.Fatalf("Failed to write datanode file: %v", err)
|
|
}
|
|
|
|
log.Println("Successfully created website.dat")
|
|
}
|