akamai

package
v0.0.0-...-94d1468 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: MPL-2.0 Imports: 20 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAllRetriesFailed indicates that all purge submission attempts have
	// failed.
	ErrAllRetriesFailed = errors.New("all attempts to submit purge request failed")
)

Functions

func CheckSignature

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

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.

Types

type CachePurgeClient

type CachePurgeClient struct {
	// contains filtered or unexported fields
}

CachePurgeClient talks to the Akamai CCU REST API. It is safe to make concurrent requests using this client.

func NewCachePurgeClient

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 (*CachePurgeClient) Purge

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 (*CachePurgeClient) PurgeTags

func (cpc *CachePurgeClient) PurgeTags(tags []string) error

PurgeTags constructs and dispatches a request to purge a batch of Tags.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL