-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.go
More file actions
43 lines (35 loc) · 1.03 KB
/
main.go
File metadata and controls
43 lines (35 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package main
import (
"fmt"
"log"
"github.com/prashanth1k/gingest"
)
func main() {
// Example 1: Process local directory
fmt.Println("=== Processing Local Directory ===")
config := gingest.Config{
Source: "../../", // Process the gingest repo itself
OutputFile: "local_digest.md",
MaxFileSize: 1024 * 1024, // 1MB limit
}
err := gingest.ProcessAndWriteDigest(config)
if err != nil {
log.Printf("Error processing local directory: %v", err)
} else {
fmt.Printf("Local digest created: %s\n", config.OutputFile)
}
// Example 2: Process remote repository
fmt.Println("\n=== Processing Remote Repository ===")
remoteConfig := gingest.Config{
Source: "https://github.com/golang/example.git",
OutputFile: "remote_digest.md",
TargetBranch: "master",
MaxFileSize: 2 * 1024 * 1024, // 2MB limit
}
err = gingest.ProcessAndWriteDigest(remoteConfig)
if err != nil {
log.Printf("Error processing remote repository: %v", err)
} else {
fmt.Printf("Remote digest created: %s\n", remoteConfig.OutputFile)
}
}