Get returns a certificate data for the specified key. If there's no such key, Get returns ErrCacheMiss.
(ctx context.Context, key string)
| 32 | // Get returns a certificate data for the specified key. |
| 33 | // If there's no such key, Get returns ErrCacheMiss. |
| 34 | func (ng *memAutoCertCache) Get(ctx context.Context, key string) ([]byte, error) { |
| 35 | ng.mtx.Lock() |
| 36 | defer ng.mtx.Unlock() |
| 37 | val, ok := ng.kv[key] |
| 38 | if ok { |
| 39 | return val, nil |
| 40 | } |
| 41 | return nil, autocert.ErrCacheMiss |
| 42 | } |
| 43 | |
| 44 | // Put stores the data in the cache under the specified key. |
| 45 | // Inderlying implementations may use any data storage format, |
no outgoing calls