refactor(config): reduce references to config.GetInstance()

This commit is contained in:
yusing
2025-10-07 21:49:00 +08:00
parent 584db2efce
commit a150f1a628
8 changed files with 36 additions and 11 deletions

View File

@@ -10,6 +10,7 @@ import (
"path"
"slices"
"strings"
"sync/atomic"
"time"
"github.com/go-acme/lego/v4/certificate"
@@ -49,6 +50,9 @@ const (
requestCooldownDuration = 15 * time.Second
)
// could be nil
var ActiveProvider atomic.Pointer[Provider]
func NewProvider(cfg *Config, user *User, legoCfg *lego.Config) *Provider {
return &Provider{
cfg: cfg,