use new PocketBaseClient in microblog package
This commit is contained in:
parent
2837293474
commit
506a12c06c
3 changed files with 119 additions and 115 deletions
|
|
@ -4,15 +4,17 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
|
||||
"gemini_site/internal/microblog"
|
||||
"gemini_site/internal/pocketbase"
|
||||
)
|
||||
|
||||
func main() {
|
||||
pbClient := pocketbase.NewPocketBaseClient()
|
||||
res, err := pbClient.GetList("micro_blog_posts", 1, 10, "-posted")
|
||||
mb := microblog.NewMicroBlog(pbClient)
|
||||
res, err := mb.GetRecentPosts(2)
|
||||
// res, err := pbClient.GetList("micro_blog_posts", 1, 10, "-posted")
|
||||
fmt.Println("Getting page 1 of microblog posts")
|
||||
// posts, err := client.GetPosts(1)
|
||||
|
||||
if err != nil {
|
||||
log.Printf("Error getting posts: %v", err)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue