create seprate pocketbase client
This commit is contained in:
parent
654df98711
commit
2837293474
6 changed files with 245 additions and 43 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue