trans to private
Some checks failed
release / goreleaser (push) Failing after 2m23s
docker / prepare-and-build (push) Failing after 2m55s

This commit is contained in:
Nite07 2024-11-20 19:09:04 +08:00
parent dd46edb310
commit 304517e241
71 changed files with 169 additions and 176 deletions

View File

@ -17,8 +17,7 @@ jobs:
uses: docker/metadata-action@v5
with:
images: |
nite07/pcgamedb
git.drevox.top/code/pcgamedb
git.nite07.com/nite07/pcgamedb
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
@ -30,12 +29,6 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to Gitea
uses: docker/login-action@v3
with:

View File

@ -16,7 +16,7 @@ builds:
- arm
- "386"
ldflags:
- -s -w -X github.com/nitezs/pcgamedb/constant.Version={{ .Version }}
- -s -w -X pcgamedb/constant.Version={{ .Version }}
flags:
- -trimpath
archives:

View File

@ -14,7 +14,7 @@ ARG version=dev
RUN if [ "$version" = "dev" ]; then \
version=$(git describe --tags --always); \
fi && \
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X github.com/nitezs/pcgamedb/constant.Version=${version}" -o pcgamedb .
CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X pcgamedb/constant.Version=${version}" -o pcgamedb .
FROM alpine:latest
WORKDIR /app

View File

@ -1,4 +1,4 @@
go install github.com/swaggo/swag/cmd/swag@latest
swag init
CGO_ENABLED=0
go build -o pcgamedb -ldflags "-s -w -X github.com/nitezs/pcgamedb/constant.Version=$(git describe --tags --always)" .
go build -o pcgamedb -ldflags "-s -w -X pcgamedb/constant.Version=$(git describe --tags --always)" .

4
cache/redis.go vendored
View File

@ -6,8 +6,8 @@ import (
"sync"
"time"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/config"
"pcgamedb/log"
"github.com/redis/go-redis/v9"
)

View File

@ -1,8 +1,8 @@
package cmd
import (
"github.com/nitezs/pcgamedb/log"
"github.com/nitezs/pcgamedb/task"
"pcgamedb/log"
"pcgamedb/task"
"github.com/spf13/cobra"
)

View File

@ -6,9 +6,9 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/log"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/crawler"
"pcgamedb/log"
"pcgamedb/utils"
"github.com/spf13/cobra"
"go.uber.org/zap"

View File

@ -4,8 +4,8 @@ import (
"os"
"path/filepath"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/db"
"pcgamedb/log"
"go.uber.org/zap"
"github.com/spf13/cobra"

View File

@ -3,9 +3,9 @@ package cmd
import (
"strings"
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/crawler"
"pcgamedb/db"
"pcgamedb/log"
"github.com/spf13/cobra"
"go.uber.org/zap"

View File

@ -1,8 +1,8 @@
package cmd
import (
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/db"
"pcgamedb/log"
"github.com/spf13/cobra"
"go.uber.org/zap"
)

View File

@ -1,8 +1,8 @@
package cmd
import (
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/db"
"pcgamedb/log"
"github.com/spf13/cobra"
"go.uber.org/zap"

View File

@ -1,9 +1,9 @@
package cmd
import (
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/crawler"
"pcgamedb/db"
"pcgamedb/log"
"github.com/spf13/cobra"
"go.uber.org/zap"

View File

@ -4,9 +4,9 @@ import (
"encoding/json"
"os"
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/crawler"
"pcgamedb/db"
"pcgamedb/log"
"github.com/spf13/cobra"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -1,8 +1,8 @@
package cmd
import (
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/server"
"pcgamedb/config"
"pcgamedb/server"
"github.com/spf13/cobra"
)

View File

@ -1,8 +1,8 @@
package cmd
import (
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/crawler"
"pcgamedb/log"
"go.uber.org/zap"
"github.com/spf13/cobra"

View File

@ -1,8 +1,8 @@
package cmd
import (
"github.com/nitezs/pcgamedb/log"
"github.com/nitezs/pcgamedb/task"
"pcgamedb/log"
"pcgamedb/task"
"github.com/robfig/cron/v3"
"github.com/spf13/cobra"

View File

@ -1,9 +1,9 @@
package cmd
import (
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/crawler"
"pcgamedb/db"
"pcgamedb/log"
"github.com/spf13/cobra"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -4,7 +4,7 @@ import (
"fmt"
"runtime"
"github.com/nitezs/pcgamedb/constant"
"pcgamedb/constant"
"github.com/spf13/cobra"
)

View File

@ -8,10 +8,10 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -11,9 +11,9 @@ import (
"strings"
"time"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/jlaffaye/ftp"
"go.uber.org/zap"

View File

@ -7,10 +7,10 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -1,7 +1,7 @@
package crawler
import (
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
"go.uber.org/zap"
)

View File

@ -4,8 +4,8 @@ import (
"regexp"
"strings"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/model"
"pcgamedb/utils"
"go.uber.org/zap"
)

View File

@ -8,10 +8,10 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -8,11 +8,11 @@ import (
"regexp"
"strings"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/config"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -6,9 +6,9 @@ import (
"strings"
"time"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"go.uber.org/zap"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -5,10 +5,10 @@ import (
"regexp"
"strings"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -6,11 +6,11 @@ import (
"strings"
"time"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/config"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"go.uber.org/zap"
)

View File

@ -10,12 +10,12 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/cache"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/cache"
"pcgamedb/config"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
)
var TwitchToken string

View File

@ -4,7 +4,7 @@ import (
"regexp"
"strings"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
"go.uber.org/zap"
)

View File

@ -11,11 +11,11 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/config"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -9,12 +9,12 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/cache"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/cache"
"pcgamedb/config"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
)
func _GetSteamID(name string) (int, error) {

View File

@ -8,12 +8,12 @@ import (
"strconv"
"time"
"github.com/nitezs/pcgamedb/cache"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/cache"
"pcgamedb/config"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
)

View File

@ -7,10 +7,10 @@ import (
"regexp"
"strings"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -8,10 +8,10 @@ import (
"strconv"
"strings"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/constant"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"github.com/PuerkitoBio/goquery"
"go.uber.org/zap"

View File

@ -1,7 +1,7 @@
package db
import (
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
)
func GetDODIGameItems() ([]*model.GameItem, error) {

View File

@ -1,6 +1,6 @@
package db
import "github.com/nitezs/pcgamedb/model"
import "pcgamedb/model"
func IsARMGDDNCrawled(flag string) bool {
return IsGameCrawled(flag, "armgddn")

View File

@ -3,7 +3,7 @@ package db
import (
"context"
"github.com/nitezs/pcgamedb/config"
"pcgamedb/config"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"

View File

@ -6,8 +6,8 @@ import (
"sync"
"time"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/config"
"pcgamedb/log"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"

View File

@ -5,7 +5,7 @@ import (
"encoding/json"
"time"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
"go.mongodb.org/mongo-driver/bson"
)

View File

@ -1,6 +1,6 @@
package db
import "github.com/nitezs/pcgamedb/model"
import "pcgamedb/model"
func GetFitgirlAllGameItems() ([]*model.GameItem, error) {
return GetGameItemsByAuthor("fitgirl")

View File

@ -1,7 +1,7 @@
package db
import (
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
)
func GetFreeGOGGameItems() ([]*model.GameItem, error) {

View File

@ -10,9 +10,9 @@ import (
"strings"
"time"
"github.com/nitezs/pcgamedb/cache"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/cache"
"pcgamedb/config"
"pcgamedb/model"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -5,7 +5,7 @@ import (
"encoding/json"
"os"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
)
func ImportGameInfo(filePath string) error {

View File

@ -1,7 +1,7 @@
package db
import (
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
)
func GetOnlineFixGameItems() ([]*model.GameItem, error) {

View File

@ -1,7 +1,7 @@
package db
import (
"github.com/nitezs/pcgamedb/model"
"pcgamedb/model"
)
func GetXatabGameItems() ([]*model.GameItem, error) {

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/nitezs/pcgamedb
module pcgamedb
go 1.23

View File

@ -4,7 +4,7 @@ import (
"os"
"strings"
"github.com/nitezs/pcgamedb/config"
"pcgamedb/config"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"

View File

@ -3,8 +3,8 @@ package main
import (
"strings"
"github.com/nitezs/pcgamedb/cmd"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/cmd"
"pcgamedb/log"
"go.uber.org/zap"
)

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/log"
"github.com/nitezs/pcgamedb/task"
"pcgamedb/log"
"pcgamedb/task"
"github.com/gin-gonic/gin"
)

View File

@ -3,7 +3,7 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"pcgamedb/db"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -3,7 +3,7 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"pcgamedb/db"
"github.com/gin-gonic/gin"
)

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
)

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/mongo"

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/mongo"

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
)

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/crawler"
"pcgamedb/model"
"github.com/gin-gonic/gin"
)

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
)

View File

@ -6,9 +6,9 @@ import (
"runtime"
"time"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/constant"
"github.com/nitezs/pcgamedb/db"
"pcgamedb/config"
"pcgamedb/constant"
"pcgamedb/db"
"github.com/gin-gonic/gin"
)

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/crawler"
"pcgamedb/model"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -3,8 +3,8 @@ package handler
import (
"net/http"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
)

View File

@ -4,9 +4,9 @@ import (
"net/http"
"strings"
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"pcgamedb/crawler"
"pcgamedb/db"
"pcgamedb/model"
"github.com/gin-gonic/gin"
"go.mongodb.org/mongo-driver/bson/primitive"

View File

@ -4,7 +4,7 @@ import (
"net/http"
"strings"
"github.com/nitezs/pcgamedb/config"
"pcgamedb/config"
"github.com/gin-gonic/gin"
)

View File

@ -5,7 +5,7 @@ import (
"strings"
"time"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/log"
"github.com/gin-gonic/gin"
"go.uber.org/zap"

View File

@ -3,7 +3,7 @@ package middleware
import (
"net/http"
"github.com/nitezs/pcgamedb/log"
"pcgamedb/log"
"github.com/gin-gonic/gin"
"go.uber.org/zap"

View File

@ -1,13 +1,13 @@
package server
import (
"github.com/nitezs/pcgamedb/server/handler"
"github.com/nitezs/pcgamedb/server/middleware"
"pcgamedb/server/handler"
"pcgamedb/server/middleware"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
docs "github.com/nitezs/pcgamedb/docs"
docs "pcgamedb/docs"
swaggerfiles "github.com/swaggo/files"
ginSwagger "github.com/swaggo/gin-swagger"

View File

@ -4,12 +4,12 @@ import (
"io"
"time"
"github.com/nitezs/pcgamedb/cache"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/log"
"github.com/nitezs/pcgamedb/server/middleware"
"github.com/nitezs/pcgamedb/task"
"pcgamedb/cache"
"pcgamedb/config"
"pcgamedb/db"
"pcgamedb/log"
"pcgamedb/server/middleware"
"pcgamedb/task"
"github.com/gin-gonic/gin"
"github.com/robfig/cron/v3"

View File

@ -1,7 +1,7 @@
package task
import (
"github.com/nitezs/pcgamedb/db"
"pcgamedb/db"
"go.uber.org/zap"
)

View File

@ -4,11 +4,11 @@ import (
"net/http"
"net/url"
"github.com/nitezs/pcgamedb/config"
"github.com/nitezs/pcgamedb/crawler"
"github.com/nitezs/pcgamedb/db"
"github.com/nitezs/pcgamedb/model"
"github.com/nitezs/pcgamedb/utils"
"pcgamedb/config"
"pcgamedb/crawler"
"pcgamedb/db"
"pcgamedb/model"
"pcgamedb/utils"
"go.uber.org/zap"
)