mirror of
https://github.com/InazumaV/Ratte.git
synced 2026-02-04 12:40:12 +00:00
feat: use wire
This commit is contained in:
21
boot/acme.go
Normal file
21
boot/acme.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user