diff options
author | Mike Crute <mike@crute.us> | 2023-08-01 18:07:50 -0700 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2023-08-01 18:07:50 -0700 |
commit | 3bd6b5f3ea7e4b2a6039b8cc3f4d89332303e521 (patch) | |
tree | af4316c7097f3491ecadacbddcb7fe50086e2789 /clients | |
parent | 7fbdc96ad276b7a24fca428e42578494c0dcc35b (diff) | |
download | golib-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.go | 16 |
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 | ||
22 | type AutocertWrapper struct { | 22 | type 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 | ||
28 | func MustNewAutocertWrapper(ctx context.Context, c AutocertConfig) *AutocertWrapper { | 28 | func MustNewAutocertWrapper(ctx context.Context, c AutocertConfig) *AutocertWrapper { |
@@ -34,14 +34,14 @@ func MustNewAutocertWrapper(ctx context.Context, c AutocertConfig) *AutocertWrap | |||
34 | } | 34 | } |
35 | 35 | ||
36 | func NewAutocertWrapper(ctx context.Context, c AutocertConfig) (*AutocertWrapper, error) { | 36 | func 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 | ||
55 | func (w *AutocertWrapper) PrimeCache() error { | 55 | func (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 | ||
59 | func (w *AutocertWrapper) PrimingReporter(l log.LeveledLogger) service.RunnerFunc { | 59 | func (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 |