v1beta1

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BadRequestErrorCode               = 400
	ResourceNotFoundErrorCode         = 404
	InvalidationUnauthorizedErrorCode = 403
)

Variables

This section is empty.

Functions

func ErrorBadRequest added in v0.0.2

func ErrorBadRequest(err error) bool

func ErrorIsUnauthorized

func ErrorIsUnauthorized(err error) bool

func ErrorResourceNotFound

func ErrorResourceNotFound(err error) bool

func NewInvalidationError

func NewInvalidationError(code int, err error, args ...interface{}) error

Types

type Distribution

type Distribution struct {
	DistributionID string `json:"-"`
	PathPrefix     string `json:"pathPrefix"`
}

type DistributionService

type DistributionService struct {
	Config     *config.Config
	Cloudfront *cloudfront.Client
}

func New

func New(config *config.Config, cloudfront *cloudfront.Client) *DistributionService

func (*DistributionService) CreateInvalidation

func (d *DistributionService) CreateInvalidation(ctx context.Context, distributionName string, paths []string) (*InvalidationResponse, error)

func (*DistributionService) GetInvalidationStatus

func (d *DistributionService) GetInvalidationStatus(ctx context.Context, distributionName string, invalidationID string) (*InvalidationResponse, error)

func (*DistributionService) List

func (d *DistributionService) List(ctx context.Context) ([]string, error)

type DistributionsResponse

type DistributionsResponse struct {
	// The Distributions a user is entitled to perform invalidations against.
	Distributions map[VanityDistributionName]Distribution `json:"distributions"`
}

swagger:model DistributionResponse

type ErrorResponse

type ErrorResponse string

swagger:model ErrorResponse

type Fake

type Fake struct {
}

func NewFake

func NewFake() *Fake

func (*Fake) CreateInvalidation

func (f *Fake) CreateInvalidation(ctx context.Context, distributionName string, paths []string) (*InvalidationResponse, error)

func (*Fake) GetInvalidationStatus

func (f *Fake) GetInvalidationStatus(ctx context.Context, distributionName string, invalidationID string) (*InvalidationResponse, error)

func (*Fake) List

func (f *Fake) List(ctx context.Context) ([]string, error)

type InvalidationError

type InvalidationError struct {
	InvalidationMeta
	Err  error `json:"-"`
	Code int   `json:"-"`
}

swagger:model InvalidationError

func (InvalidationError) Error

func (err InvalidationError) Error() string

func (InvalidationError) Unwrap

func (err InvalidationError) Unwrap() error

type InvalidationMeta

type InvalidationMeta struct {
	// The Status of the invalidation request
	Status string `json:"status"`
}

type InvalidationRequest

type InvalidationRequest struct {
	// The Paths to submit for invalidation
	Paths []string `json:"paths"`
}

swagger:model InvalidationRequest

type InvalidationResponse

type InvalidationResponse struct {
	InvalidationMeta
	// The ID of the Invalidation Request
	ID string `json:"id,omitempty"`

	// The Created time of invalidation
	Created time.Time `json:"createTime"`

	// The Paths array requested for invalidation
	Paths []string `json:"paths,omitempty"`
}

swagger:model InvalidationResponse

type VanityDistributionName

type VanityDistributionName string

Jump to

Keyboard shortcuts

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