stapler is an internal in-memory implementation of the staple retriever and cache
| 91 | |
| 92 | // stapler is an internal in-memory implementation of the staple retriever and cache |
| 93 | type stapler struct { |
| 94 | // host stapler is a cached OCSP response for particular host |
| 95 | v map[string]*hostStapler |
| 96 | mtx *sync.Mutex |
| 97 | clock timetools.TimeProvider |
| 98 | // eventsC is used to communicate updates from the timer-based updaters |
| 99 | eventsC chan *stapleFetched |
| 100 | // cnt used to generate unique id for each staple update job |
| 101 | cnt int32 |
| 102 | // closeC singlas close for all running operations |
| 103 | closeC chan struct{} |
| 104 | // client used to query OCSP responders |
| 105 | client *http.Client |
| 106 | // subcscibrers holds a list of subscribers for OCSP updates |
| 107 | subscribers map[int32]chan *StapleUpdated |
| 108 | |
| 109 | // these channels are set up for test purposes |
| 110 | discardC chan bool |
| 111 | beforeUpdateC chan bool |
| 112 | kickC chan bool |
| 113 | } |
| 114 | |
| 115 | func (s *stapler) StapleHost(host *engine.Host, opts ...StapleHostOption) (*StapleResponse, error) { |
| 116 | if host.Settings.KeyPair == nil && host.Settings.AutoCert == nil { |
nothing calls this directly
no outgoing calls
no test coverage detected