Documentation
¶
Overview ¶
Package cloudfront reads distributions and creates cache invalidations over signed REST/XML.
Index ¶
- Constants
- Variables
- func CleanPaths(paths []string, maxPaths int) ([]string, error)
- type Client
- func (c *Client) CreateInvalidation(ctx context.Context, id string, paths []string) (Invalidation, error)
- func (c *Client) GetDistribution(ctx context.Context, id string) (Distribution, error)
- func (c *Client) ListDistributions(ctx context.Context, marker string) (ListPage, error)
- func (c *Client) ListInvalidations(ctx context.Context, id, marker string) ([]Invalidation, string, error)
- type Distribution
- type Invalidation
- type ListPage
Constants ¶
const ServiceName = "cloudfront"
ServiceName is the key used in the guard ServicesEnabled map.
Variables ¶
var ErrInvalidPaths = errors.New("cloudfront: invalid paths")
ErrInvalidPaths marks a rejected invalidation path list.
var Service = awsx.Service{Name: "cloudfront", Prefix: "cloudfront", SigningName: "cloudfront"}
Service is global: one host, signed for us-east-1.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the lazy CloudFront module.
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 ¶
GetDistribution reads one distribution by id.
func (*Client) ListDistributions ¶
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 ¶
Distribution is the read view of one distribution.
type Invalidation ¶
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.