create seprate pocketbase client

This commit is contained in:
Travis Shears 2025-09-27 14:39:18 +02:00
parent 654df98711
commit 2837293474
6 changed files with 245 additions and 43 deletions

View file

@ -4,17 +4,19 @@ import (
"fmt"
"log"
"gemini_site/internal/microblog"
"gemini_site/internal/pocketbase"
)
func main() {
client := microblog.NewPocketBaseClient()
pbClient := pocketbase.NewPocketBaseClient()
res, err := pbClient.GetList("micro_blog_posts", 1, 10, "-posted")
fmt.Println("Getting page 1 of microblog posts")
posts, err := client.GetPosts(1)
// posts, err := client.GetPosts(1)
if err != nil {
log.Printf("Error getting posts: %v", err)
} else {
fmt.Printf("Got first page of microblog posts\n")
fmt.Printf("First post: %v\n", posts[0])
fmt.Printf("First post: %v\n", res)
}
}