重构 page

This commit is contained in:
dragon
2025-11-10 17:33:08 +08:00
parent 851ae52733
commit a0e6bb668e
19 changed files with 348 additions and 925 deletions

View File

@@ -13,7 +13,7 @@ import (
"time"
"go.uber.org/zap"
"gopkg.d7z.net/gitea-pages/pkg/middleware/config"
"gopkg.d7z.net/middleware/kv"
"gopkg.in/yaml.v3"
"github.com/gobwas/glob"
@@ -31,13 +31,14 @@ type ServerMeta struct {
Domain string
client *http.Client
cache config.KVConfig
ttl time.Duration
cache kv.KV
ttl time.Duration
locker *utils.Locker
}
func NewServerMeta(client *http.Client, backend Backend, kv config.KVConfig, domain string, ttl time.Duration) *ServerMeta {
func NewServerMeta(client *http.Client, backend Backend, kv kv.KV, domain string, ttl time.Duration) *ServerMeta {
return &ServerMeta{backend, domain, client, kv, ttl, utils.NewLocker()}
}