Changed project structure

This commit is contained in:
2025-05-11 20:43:56 +03:30
parent 8be6290635
commit 3e7f6b92d3
6 changed files with 4 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
package main package main
import ( import (
"CatsOfMastodonBotGo/helpers" "CatsOfMastodonBotGo/internal/helpers"
"context" "context"
"log" "log"
"os" "os"
@@ -21,6 +21,7 @@ func main() {
if instance == "" { if instance == "" {
instance = "https://haminoa.net" instance = "https://haminoa.net"
} }
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel() defer cancel()
err, posts := helpers.GetPosts(ctx, tag, instance) err, posts := helpers.GetPosts(ctx, tag, instance)
@@ -40,7 +41,6 @@ func main() {
var existingAccountIds = helpers.GetExistingAccountIds(db) var existingAccountIds = helpers.GetExistingAccountIds(db)
var newPosts = helpers.GetNewPosts(existingPostIds, posts) var newPosts = helpers.GetNewPosts(existingPostIds, posts)
var newAccounts = helpers.GetNewAccounts(existingAccountIds, newPosts) var newAccounts = helpers.GetNewAccounts(existingAccountIds, newPosts)
log.Println("Number of existing posts: ", len(existingPostIds)) log.Println("Number of existing posts: ", len(existingPostIds))
log.Println("Number of existing accounts: ", len(existingAccountIds)) log.Println("Number of existing accounts: ", len(existingAccountIds))

View File

@@ -1,7 +1,7 @@
package helpers package helpers
import ( import (
"CatsOfMastodonBotGo/models" "CatsOfMastodonBotGo/internal/models"
"gorm.io/gorm" "gorm.io/gorm"
) )

View File

@@ -1,7 +1,7 @@
package helpers package helpers
import ( import (
"CatsOfMastodonBotGo/models" "CatsOfMastodonBotGo/internal/models"
"context" "context"
"encoding/json" "encoding/json"
"fmt" "fmt"