cloudfront

package
v1.5.10 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cloudfront reads distributions and creates cache invalidations over signed REST/XML.

Index

Constants

View Source
const ServiceName = "cloudfront"

ServiceName is the key used in the guard ServicesEnabled map.

Variables

View Source
var ErrInvalidPaths = errors.New("cloudfront: invalid paths")

ErrInvalidPaths marks a rejected invalidation path list.

View Source
var Service = awsx.Service{Name: "cloudfront", Prefix: "cloudfront", SigningName: "cloudfront"}

Service is global: one host, signed for us-east-1.

Functions

func CleanPaths

func CleanPaths(paths []string, maxPaths int) ([]string, error)

CleanPaths validates and dedupes paths. maxPaths comes from a runtime setting.

Types

type Client

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

Client is the lazy CloudFront module.

func New

func New(c *awsx.Client) *Client

New wraps a shared client.

func (*Client) CreateInvalidation

func (c *Client) CreateInvalidation(ctx context.Context, id string, paths []string) (Invalidation, error)

CreateInvalidation invalidates the given paths. Paths must already be cleaned.

func (*Client) GetDistribution

func (c *Client) GetDistribution(ctx context.Context, id string) (Distribution, error)

GetDistribution reads one distribution by id.

func (*Client) ListDistributions

func (c *Client) ListDistributions(ctx context.Context, marker string) (ListPage, error)

ListDistributions returns one page; pass the previous Next as marker.

func (*Client) ListInvalidations

func (c *Client) ListInvalidations(ctx context.Context, id, marker string) ([]Invalidation, string, error)

ListInvalidations returns one page of recent invalidations for a distribution.

type Distribution

type Distribution struct {
	ID, ARN, Status, Domain, Comment string
	Enabled                          bool
	Aliases                          []string
}

Distribution is the read view of one distribution.

type Invalidation

type Invalidation struct {
	ID, Status string
	CreatedAt  time.Time
}

Invalidation is one cache invalidation.

type ListPage

type ListPage struct {
	Items []Distribution
	Next  string
}

ListPage is one page of distributions with the marker for the next.

Jump to

Keyboard shortcuts

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