update-deps (#1)
All checks were successful
🚨 Test Code Base / 🔍 🐹 Go Tests (push) Successful in 1m22s
🚨 Test Code Base / 🧹 Lint (push) Successful in 1m31s
🏗️✨ Build Workflow / 🖥️ 🔨 Build (push) Successful in 11m11s

Reviewed-on: #1
Co-authored-by: Ron Rise <ron@siteworxpro.com>
Co-committed-by: Ron Rise <ron@siteworxpro.com>
This commit was merged in pull request #1.
This commit is contained in:
2025-08-26 16:36:17 +00:00
committed by Siteworx Pro Gitea
parent aa1699243a
commit ff66877192
12 changed files with 197 additions and 30 deletions

16
main.go
View File

@@ -2,17 +2,22 @@ package main
import (
"context"
"net/http"
"os"
"strings"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"github.com/labstack/gommon/log"
tphttp "github.com/siteworxpro/top-wallpaper/http"
"github.com/siteworxpro/top-wallpaper/reddit"
"github.com/siteworxpro/top-wallpaper/redis"
"net/http"
"os"
"strings"
)
type contextKey string
const ContextKeyLogger contextKey = "logger"
func main() {
ctx, fn := context.WithCancel(context.Background())
@@ -22,7 +27,8 @@ func main() {
if err != nil {
log.Error("Could not initialize Redis client: ", err)
os.Exit(1)
return
}
e := echo.New()
@@ -55,7 +61,7 @@ func main() {
}
ctx = redis.WithContext(ctx, rc)
ctx = context.WithValue(ctx, "logger", e.Logger)
ctx = context.WithValue(ctx, ContextKeyLogger, e.Logger)
go reddit.Fetch(ctx)