This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
e621-sdk-go/example/highlevel/dbexport.go
2023-11-15 13:21:13 +01:00

47 lines
784 B
Go

package main
import (
"git.dragse.it/anthrove/e621-sdk-go/pkg/e621"
_ "github.com/joho/godotenv/autoload"
"log"
"os"
)
func main() {
client := e621.NewClient(os.Getenv("API_USER"), os.Getenv("API_KEY"))
{
fileName, _, err := client.GetLatestPoolsDBExportDataAsBytes()
if err != nil {
panic(err)
}
log.Println(fileName)
}
{
latestDBPoolExport, err := client.GetLatestPoolsDBExportDataAsStruct()
if err != nil {
panic(err)
}
log.Println(latestDBPoolExport[0])
}
{
fileName, _, err := client.GetLatestPostsDBExportDataAsBytes()
if err != nil {
panic(err)
}
log.Println(fileName)
}
{
latestDBPoolExport, err := client.GetLatestPostsDBExportDataAsStruct()
if err != nil {
panic(err)
}
log.Println(latestDBPoolExport[0])
}
}