convert pbPost to post
This commit is contained in:
parent
506a12c06c
commit
ef5f5e33ab
2 changed files with 34 additions and 12 deletions
|
|
@ -2,7 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"log"
|
||||
"log/slog"
|
||||
|
||||
"gemini_site/internal/microblog"
|
||||
"gemini_site/internal/pocketbase"
|
||||
|
|
@ -11,14 +11,13 @@ import (
|
|||
func main() {
|
||||
pbClient := pocketbase.NewPocketBaseClient()
|
||||
mb := microblog.NewMicroBlog(pbClient)
|
||||
res, err := mb.GetRecentPosts(2)
|
||||
res, err := mb.GetRecentPosts(10)
|
||||
// res, err := pbClient.GetList("micro_blog_posts", 1, 10, "-posted")
|
||||
fmt.Println("Getting page 1 of microblog posts")
|
||||
fmt.Println("Getting page 1 of microblog posts, 10 posts")
|
||||
// posts, err := client.GetPosts(1)
|
||||
if err != nil {
|
||||
log.Printf("Error getting posts: %v", err)
|
||||
slog.Error("Error getting posts", "error", err)
|
||||
} else {
|
||||
fmt.Printf("Got first page of microblog posts\n")
|
||||
fmt.Printf("First post: %v\n", res)
|
||||
slog.Info("Got microblog posts", "posts", res)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue