aboutsummaryrefslogtreecommitdiff
path: root/clients
diff options
context:
space:
mode:
authorMike Crute <mike@crute.us>2023-08-01 18:07:50 -0700
committerMike Crute <mike@crute.us>2023-08-01 18:07:50 -0700
commit3bd6b5f3ea7e4b2a6039b8cc3f4d89332303e521 (patch)
treeaf4316c7097f3491ecadacbddcb7fe50086e2789 /clients
parent7fbdc96ad276b7a24fca428e42578494c0dcc35b (diff)
downloadgolib-3bd6b5f3ea7e4b2a6039b8cc3f4d89332303e521.tar.bz2
golib-3bd6b5f3ea7e4b2a6039b8cc3f4d89332303e521.tar.xz
golib-3bd6b5f3ea7e4b2a6039b8cc3f4d89332303e521.zip
clients/autocert: make names more readable
Diffstat (limited to 'clients')
-rw-r--r--clients/autocert/autocert_wrapper.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/clients/autocert/autocert_wrapper.go b/clients/autocert/autocert_wrapper.go
index f871101..567d2c2 100644
--- a/clients/autocert/autocert_wrapper.go
+++ b/clients/autocert/autocert_wrapper.go
@@ -21,8 +21,8 @@ type AutocertConfig struct {
21 21
22type AutocertWrapper struct { 22type AutocertWrapper struct {
23 *autocert.Manager 23 *autocert.Manager
24 hl *glautocert.ACMEHostList 24 hostList *glautocert.ACMEHostList
25 pr chan string 25 primingNotify chan string
26} 26}
27 27
28func MustNewAutocertWrapper(ctx context.Context, c AutocertConfig) *AutocertWrapper { 28func MustNewAutocertWrapper(ctx context.Context, c AutocertConfig) *AutocertWrapper {
@@ -34,14 +34,14 @@ func MustNewAutocertWrapper(ctx context.Context, c AutocertConfig) *AutocertWrap
34} 34}
35 35
36func NewAutocertWrapper(ctx context.Context, c AutocertConfig) (*AutocertWrapper, error) { 36func NewAutocertWrapper(ctx context.Context, c AutocertConfig) (*AutocertWrapper, error) {
37 hl := glautocert.NewACMEHostList(c.Hosts...) 37 hostList := glautocert.NewACMEHostList(c.Hosts...)
38 return &AutocertWrapper{ 38 return &AutocertWrapper{
39 hl: hl, 39 hostList: hostList,
40 pr: make(chan string, 10), 40 primingNotify: make(chan string, 10),
41 Manager: &autocert.Manager{ 41 Manager: &autocert.Manager{
42 Cache: autocert.DirCache("ssl/"), 42 Cache: autocert.DirCache("ssl/"),
43 Prompt: autocert.AcceptTOS, 43 Prompt: autocert.AcceptTOS,
44 HostPolicy: hl.HostPolicy, 44 HostPolicy: hostList.HostPolicy,
45 Email: c.Email, 45 Email: c.Email,
46 StapleOCSP: true, 46 StapleOCSP: true,
47 DNSManager: &dns.AcmeDNSServiceClient{ 47 DNSManager: &dns.AcmeDNSServiceClient{
@@ -53,7 +53,7 @@ func NewAutocertWrapper(ctx context.Context, c AutocertConfig) (*AutocertWrapper
53} 53}
54 54
55func (w *AutocertWrapper) PrimeCache() error { 55func (w *AutocertWrapper) PrimeCache() error {
56 return w.hl.PrimeCache(w.Manager, w.pr) 56 return w.hostList.PrimeCache(w.Manager, w.primingNotify)
57} 57}
58 58
59func (w *AutocertWrapper) PrimingReporter(l log.LeveledLogger) service.RunnerFunc { 59func (w *AutocertWrapper) PrimingReporter(l log.LeveledLogger) service.RunnerFunc {
@@ -62,7 +62,7 @@ func (w *AutocertWrapper) PrimingReporter(l log.LeveledLogger) service.RunnerFun
62 defer wg.Done() 62 defer wg.Done()
63 63
64 select { 64 select {
65 case m := <-w.pr: 65 case m := <-w.primingNotify:
66 l.Info(m) 66 l.Info(m)
67 case <-c.Done(): 67 case <-c.Done():
68 return nil 68 return nil