func NewCache(certificateGetter certificate.Getter, ttl, ttlNoCert time.Duration) Cache {
	return Cache{
		ttl:               ttl,
		ttlNoCert:         ttlNoCert,
		certificateGetter: certificateGetter,
		nameToCertificate: map[string]tlsCertificate{},
		mu:                &sync.RWMutex{},
	}
}
NewCache creates a new instance of Cache.
package certificateCache
import (
	"crypto/tls"
	"errors"
	"fmt"
	"sync"
	"time"
	"gopherpit.com/gopherpit/services/certificate"
)
var ErrCertificateNotFound = errors.New("certificate not found")
type tlsCertificate struct {
	*tls.Certificate
	TTL time.Time
}
type Cache struct {
	ttl               time.Duration
	ttlNoCert         time.Duration
	certificateGetter certificate.Getter
	nameToCertificate map[string]tlsCertificate
	mu                *sync.RWMutex
}