feat: use wire

This commit is contained in:
Yuzuki616
2025-05-07 17:22:29 +09:00
parent 05a1e586ed
commit 9e18c06199
14 changed files with 418 additions and 222 deletions

21
boot/acme.go Normal file
View File

@@ -0,0 +1,21 @@
package boot
import (
"github.com/InazumaV/Ratte/acme"
"github.com/InazumaV/Ratte/conf"
log "github.com/sirupsen/logrus"
)
type AcmeGroup map[string]*acme.Acme
func initAcme(a []conf.ACME) AcmeGroup {
acmes := make(AcmeGroup, len(a))
for _, a := range a {
ac, err := acme.NewAcme(&a)
if err != nil {
log.WithError(err).Fatal("New acme failed")
}
acmes[a.Name] = ac
}
return acmes
}