var ( // ErrAllRetriesFailed indicates that all purge submission attempts have // failed. ErrAllRetriesFailed = errors.New("all attempts to submit purge request failed") )
func CheckSignature(secret string, url string, r *http.Request, body []byte) error
CheckSignature is exported for use in tests and akamai-test-srv.
func GeneratePurgeURLs(cert, issuer *x509.Certificate) ([]string, error)
GeneratePurgeURLs generates akamai URLs that can be POSTed to in order to purge akamai's cache of the corresponding OCSP responses. The URLs encode the contents of the OCSP request, so this method constructs a full OCSP request.
CachePurgeClient talks to the Akamai CCU REST API. It is safe to make concurrent requests using this client.
type CachePurgeClient struct {
// contains filtered or unexported fields
}
func NewCachePurgeClient( baseURL, clientToken, secret, accessToken, network string, retries int, retryBackoff time.Duration, log blog.Logger, scope prometheus.Registerer, ) (*CachePurgeClient, error)
NewCachePurgeClient performs some basic validation of supplied configuration and returns a newly constructed CachePurgeClient.
func (cpc *CachePurgeClient) Purge(urls []string) error
Purge dispatches the provided URLs in a request to the Akamai Fast-Purge API. The request will be attempted cpc.retries number of times before giving up and returning ErrAllRetriesFailed.
func (cpc *CachePurgeClient) PurgeTags(tags []string) error
PurgeTags constructs and dispatches a request to purge a batch of Tags.