Documentation
¶
Overview ¶
Package cloudfront provides CloudFront service emulation for kumo.
Index ¶
- type ActiveTrustedKeyGroups
- type ActiveTrustedKeyGroupsXML
- type ActiveTrustedSigners
- type ActiveTrustedSignersXML
- type Aliases
- type AliasesXML
- type AllowedMethods
- type AllowedMethodsXML
- type CacheBehavior
- type CacheBehaviors
- type CacheBehaviorsXML
- type CachedMethods
- type CachedMethodsXML
- type CookieNames
- type CookiePreference
- type CookiesXML
- type CreateDistributionRequest
- type CreateDistributionResult
- type CreateInvalidationRequest
- type CustomErrorResponsesXML
- type CustomOriginConfig
- type CustomOriginConfigXML
- type DefaultCacheBehavior
- type DefaultCacheBehaviorXML
- type Distribution
- type DistributionConfig
- type DistributionConfigXML
- type DistributionListXML
- type DistributionSummaryList
- type DistributionSummaryXML
- type DistributionXML
- type Error
- type ErrorDetail
- type ErrorResponse
- type ForwardedValues
- type ForwardedValuesXML
- type GeoRestrictionXML
- type GetDistributionResult
- type Headers
- type HeadersXML
- type Invalidation
- type InvalidationBatch
- type InvalidationBatchXML
- type InvalidationListXML
- type InvalidationSummaryList
- type InvalidationSummaryXML
- type InvalidationXML
- type ItemsXML
- type MemoryStorage
- func (s *MemoryStorage) Close() error
- func (s *MemoryStorage) CreateDistribution(_ context.Context, config *CreateDistributionRequest) (*Distribution, error)
- func (s *MemoryStorage) CreateInvalidation(_ context.Context, distributionID string, batch *CreateInvalidationRequest) (*Invalidation, error)
- func (s *MemoryStorage) DeleteDistribution(_ context.Context, id, etag string) error
- func (s *MemoryStorage) GetDistribution(_ context.Context, id string) (*Distribution, error)
- func (s *MemoryStorage) GetInvalidation(_ context.Context, distributionID, invalidationID string) (*Invalidation, error)
- func (s *MemoryStorage) ListDistributions(_ context.Context, marker string, maxItems int) ([]*Distribution, string, error)
- func (s *MemoryStorage) ListInvalidations(_ context.Context, distributionID, marker string, maxItems int) ([]*Invalidation, string, error)
- func (s *MemoryStorage) MarshalJSON() ([]byte, error)
- func (s *MemoryStorage) UnmarshalJSON(data []byte) error
- func (s *MemoryStorage) UpdateDistribution(_ context.Context, id string, config *CreateDistributionRequest, etag string) (*Distribution, error)
- type Option
- type Origin
- type OriginList
- type OriginSSLProtocols
- type OriginSSLProtocolsXML
- type OriginXML
- type Origins
- type OriginsXML
- type Paths
- type PathsXML
- type QueryStringCacheKeys
- type RestrictionsXML
- type S3OriginConfig
- type S3OriginConfigXML
- type Service
- func (s *Service) Close() error
- func (s *Service) CreateDistribution(w http.ResponseWriter, r *http.Request)
- func (s *Service) CreateInvalidation(w http.ResponseWriter, r *http.Request)
- func (s *Service) DeleteDistribution(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetDistribution(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetDistributionConfig(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetInvalidation(w http.ResponseWriter, r *http.Request)
- func (s *Service) ListDistributions(w http.ResponseWriter, r *http.Request)
- func (s *Service) Name() string
- func (s *Service) RegisterRoutes(r service.Router)
- func (s *Service) UpdateDistribution(w http.ResponseWriter, r *http.Request)
- type Storage
- type TrustedKeyGroups
- type TrustedKeyGroupsXML
- type TrustedSigners
- type TrustedSignersXML
- type ViewerCertificate
- type ViewerCertificateXML
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActiveTrustedKeyGroups ¶
ActiveTrustedKeyGroups represents active trusted key groups.
type ActiveTrustedKeyGroupsXML ¶
type ActiveTrustedKeyGroupsXML struct {
Enabled bool `xml:"Enabled"`
Quantity int `xml:"Quantity"`
}
ActiveTrustedKeyGroupsXML represents active trusted key groups in XML.
type ActiveTrustedSigners ¶
ActiveTrustedSigners represents active trusted signers.
type ActiveTrustedSignersXML ¶
ActiveTrustedSignersXML represents active trusted signers in XML.
type AliasesXML ¶
AliasesXML represents aliases in XML format.
type AllowedMethods ¶
AllowedMethods represents allowed HTTP methods.
type AllowedMethodsXML ¶
type AllowedMethodsXML struct {
Quantity int `xml:"Quantity"`
Items []string `xml:"Items>Method,omitempty"`
CachedMethods *CachedMethodsXML `xml:"CachedMethods,omitempty"`
}
AllowedMethodsXML represents allowed methods in XML format.
type CacheBehavior ¶
type CacheBehavior struct {
PathPattern string
TargetOriginID string
ViewerProtocolPolicy string
AllowedMethods *AllowedMethods
CachedMethods *CachedMethods
ForwardedValues *ForwardedValues
MinTTL int64
DefaultTTL int64
MaxTTL int64
Compress bool
SmoothStreaming bool
CachePolicyID string
OriginRequestPolicyID string
ResponseHeadersPolicyID string
TrustedSigners *TrustedSigners
TrustedKeyGroups *TrustedKeyGroups
FieldLevelEncryptionID string
RealtimeLogConfigArn string
}
CacheBehavior represents a cache behavior.
type CacheBehaviors ¶
type CacheBehaviors struct {
Quantity int
Items []CacheBehavior
}
CacheBehaviors represents cache behaviors.
type CacheBehaviorsXML ¶
type CacheBehaviorsXML struct {
Quantity int `xml:"Quantity"`
}
CacheBehaviorsXML represents cache behaviors in XML format.
type CachedMethods ¶
CachedMethods represents cached HTTP methods.
type CachedMethodsXML ¶
type CachedMethodsXML struct {
Quantity int `xml:"Quantity"`
Items []string `xml:"Items>Method,omitempty"`
}
CachedMethodsXML represents cached methods in XML format.
type CookieNames ¶
CookieNames represents a list of cookie names.
type CookiePreference ¶
type CookiePreference struct {
Forward string
WhitelistedNames *CookieNames
}
CookiePreference represents cookie forwarding preference.
type CookiesXML ¶
type CookiesXML struct {
Forward string `xml:"Forward"`
}
CookiesXML represents cookies configuration in XML format.
type CreateDistributionRequest ¶
type CreateDistributionRequest struct {
XMLName xml.Name `xml:"DistributionConfig"`
CallerReference string `xml:"CallerReference"`
Aliases *AliasesXML `xml:"Aliases,omitempty"`
DefaultRootObject string `xml:"DefaultRootObject,omitempty"`
Origins *OriginsXML `xml:"Origins"`
DefaultCacheBehavior *DefaultCacheBehaviorXML `xml:"DefaultCacheBehavior"`
CacheBehaviors *CacheBehaviorsXML `xml:"CacheBehaviors,omitempty"`
Comment string `xml:"Comment"`
Enabled bool `xml:"Enabled"`
PriceClass string `xml:"PriceClass,omitempty"`
ViewerCertificate *ViewerCertificateXML `xml:"ViewerCertificate,omitempty"`
HTTPVersion string `xml:"HttpVersion,omitempty"`
IsIPV6Enabled bool `xml:"IsIPV6Enabled,omitempty"`
}
CreateDistributionRequest is the request for CreateDistribution.
type CreateDistributionResult ¶
type CreateDistributionResult struct {
XMLName xml.Name `xml:"Distribution"`
Xmlns string `xml:"xmlns,attr"`
Distribution Distribution `xml:",innerxml"`
}
CreateDistributionResult is the response for CreateDistribution.
type CreateInvalidationRequest ¶
type CreateInvalidationRequest struct {
XMLName xml.Name `xml:"InvalidationBatch"`
Paths *PathsXML `xml:"Paths"`
CallerReference string `xml:"CallerReference"`
}
CreateInvalidationRequest is the request for CreateInvalidation.
type CustomErrorResponsesXML ¶
type CustomErrorResponsesXML struct {
Quantity int `xml:"Quantity"`
}
CustomErrorResponsesXML represents custom error responses in XML format.
type CustomOriginConfig ¶
type CustomOriginConfig struct {
HTTPPort int
HTTPSPort int
OriginProtocolPolicy string
OriginSSLProtocols *OriginSSLProtocols
OriginReadTimeout int
OriginKeepaliveTimeout int
}
CustomOriginConfig represents custom origin configuration.
type CustomOriginConfigXML ¶
type CustomOriginConfigXML struct {
HTTPPort int `xml:"HTTPPort"`
HTTPSPort int `xml:"HTTPSPort"`
OriginProtocolPolicy string `xml:"OriginProtocolPolicy"`
OriginSSLProtocols *OriginSSLProtocolsXML `xml:"OriginSslProtocols,omitempty"`
OriginReadTimeout int `xml:"OriginReadTimeout,omitempty"`
OriginKeepaliveTimeout int `xml:"OriginKeepaliveTimeout,omitempty"`
}
CustomOriginConfigXML represents custom origin config in XML format.
type DefaultCacheBehavior ¶
type DefaultCacheBehavior struct {
TargetOriginID string
ViewerProtocolPolicy string
AllowedMethods *AllowedMethods
CachedMethods *CachedMethods
ForwardedValues *ForwardedValues
MinTTL int64
DefaultTTL int64
MaxTTL int64
Compress bool
SmoothStreaming bool
CachePolicyID string
OriginRequestPolicyID string
ResponseHeadersPolicyID string
TrustedSigners *TrustedSigners
TrustedKeyGroups *TrustedKeyGroups
FieldLevelEncryptionID string
RealtimeLogConfigArn string
}
DefaultCacheBehavior represents the default cache behavior.
type DefaultCacheBehaviorXML ¶
type DefaultCacheBehaviorXML struct {
TargetOriginID string `xml:"TargetOriginId"`
ViewerProtocolPolicy string `xml:"ViewerProtocolPolicy"`
AllowedMethods *AllowedMethodsXML `xml:"AllowedMethods,omitempty"`
ForwardedValues *ForwardedValuesXML `xml:"ForwardedValues,omitempty"`
MinTTL int64 `xml:"MinTTL,omitempty"`
DefaultTTL int64 `xml:"DefaultTTL,omitempty"`
MaxTTL int64 `xml:"MaxTTL,omitempty"`
Compress bool `xml:"Compress,omitempty"`
CachePolicyID string `xml:"CachePolicyId,omitempty"`
TrustedSigners *TrustedSignersXML `xml:"TrustedSigners,omitempty"`
TrustedKeyGroups *TrustedKeyGroupsXML `xml:"TrustedKeyGroups,omitempty"`
}
DefaultCacheBehaviorXML represents default cache behavior in XML format.
type Distribution ¶
type Distribution struct {
ID string
ARN string
Status string
LastModifiedTime time.Time
DomainName string
ETag string
DistributionConfig *DistributionConfig
ActiveTrustedSigners *ActiveTrustedSigners
ActiveTrustedKeyGroups *ActiveTrustedKeyGroups
}
Distribution represents a CloudFront distribution.
type DistributionConfig ¶
type DistributionConfig struct {
CallerReference string
Origins *Origins
DefaultCacheBehavior *DefaultCacheBehavior
Comment string
Enabled bool
PriceClass string
Aliases *Aliases
DefaultRootObject string
CacheBehaviors *CacheBehaviors
ViewerCertificate *ViewerCertificate
HTTPVersion string
IsIPV6Enabled bool
}
DistributionConfig represents CloudFront distribution configuration.
type DistributionConfigXML ¶
type DistributionConfigXML struct {
CallerReference string `xml:"CallerReference"`
Aliases *AliasesXML `xml:"Aliases,omitempty"`
DefaultRootObject string `xml:"DefaultRootObject,omitempty"`
Origins *OriginsXML `xml:"Origins"`
DefaultCacheBehavior *DefaultCacheBehaviorXML `xml:"DefaultCacheBehavior"`
CacheBehaviors *CacheBehaviorsXML `xml:"CacheBehaviors,omitempty"`
Comment string `xml:"Comment"`
Enabled bool `xml:"Enabled"`
PriceClass string `xml:"PriceClass,omitempty"`
ViewerCertificate *ViewerCertificateXML `xml:"ViewerCertificate,omitempty"`
HTTPVersion string `xml:"HttpVersion,omitempty"`
IsIPV6Enabled bool `xml:"IsIPV6Enabled,omitempty"`
}
DistributionConfigXML represents distribution config in XML format.
type DistributionListXML ¶
type DistributionListXML struct {
XMLName xml.Name `xml:"DistributionList"`
Xmlns string `xml:"xmlns,attr"`
Marker string `xml:"Marker"`
MaxItems int `xml:"MaxItems"`
IsTruncated bool `xml:"IsTruncated"`
Quantity int `xml:"Quantity"`
Items *DistributionSummaryList `xml:"Items,omitempty"`
NextMarker string `xml:"NextMarker,omitempty"`
}
DistributionListXML represents a list of distributions in XML format.
type DistributionSummaryList ¶
type DistributionSummaryList struct {
DistributionSummary []DistributionSummaryXML `xml:"DistributionSummary"`
}
DistributionSummaryList is a list of distribution summaries.
type DistributionSummaryXML ¶
type DistributionSummaryXML struct {
ID string `xml:"Id"`
ARN string `xml:"ARN"`
Status string `xml:"Status"`
LastModifiedTime string `xml:"LastModifiedTime"`
DomainName string `xml:"DomainName"`
Aliases *AliasesXML `xml:"Aliases"`
Origins *OriginsXML `xml:"Origins"`
DefaultCacheBehavior *DefaultCacheBehaviorXML `xml:"DefaultCacheBehavior"`
CacheBehaviors *CacheBehaviorsXML `xml:"CacheBehaviors"`
CustomErrorResponses *CustomErrorResponsesXML `xml:"CustomErrorResponses"`
Comment string `xml:"Comment"`
PriceClass string `xml:"PriceClass"`
Enabled bool `xml:"Enabled"`
ViewerCertificate *ViewerCertificateXML `xml:"ViewerCertificate"`
Restrictions *RestrictionsXML `xml:"Restrictions"`
WebACLId string `xml:"WebACLId"`
HTTPVersion string `xml:"HttpVersion"`
IsIPV6Enabled bool `xml:"IsIPV6Enabled"`
Staging bool `xml:"Staging"`
}
DistributionSummaryXML represents a distribution summary in XML format.
type DistributionXML ¶
type DistributionXML struct {
XMLName xml.Name `xml:"Distribution"`
ID string `xml:"Id"`
ARN string `xml:"ARN"`
Status string `xml:"Status"`
LastModifiedTime string `xml:"LastModifiedTime"`
DomainName string `xml:"DomainName"`
ActiveTrustedSigners *ActiveTrustedSignersXML `xml:"ActiveTrustedSigners"`
ActiveTrustedKeyGroups *ActiveTrustedKeyGroupsXML `xml:"ActiveTrustedKeyGroups"`
DistributionConfig *DistributionConfigXML `xml:"DistributionConfig"`
}
DistributionXML represents a distribution in XML format.
type ErrorDetail ¶
type ErrorDetail struct {
Type string `xml:"Type"`
Code string `xml:"Code"`
Message string `xml:"Message"`
}
ErrorDetail represents the error detail.
type ErrorResponse ¶
type ErrorResponse struct {
XMLName xml.Name `xml:"ErrorResponse"`
Xmlns string `xml:"xmlns,attr"`
Error ErrorDetail `xml:"Error"`
RequestID string `xml:"RequestId"`
}
ErrorResponse represents a CloudFront error response.
type ForwardedValues ¶
type ForwardedValues struct {
QueryString bool
Cookies *CookiePreference
Headers *Headers
QueryStringCacheKeys *QueryStringCacheKeys
}
ForwardedValues represents forwarded values configuration.
type ForwardedValuesXML ¶
type ForwardedValuesXML struct {
QueryString bool `xml:"QueryString"`
Cookies *CookiesXML `xml:"Cookies"`
Headers *HeadersXML `xml:"Headers,omitempty"`
}
ForwardedValuesXML represents forwarded values in XML format.
type GeoRestrictionXML ¶
type GeoRestrictionXML struct {
RestrictionType string `xml:"RestrictionType"`
Quantity int `xml:"Quantity"`
Items []string `xml:"Items>Location,omitempty"`
}
GeoRestrictionXML represents geo restriction in XML format.
type GetDistributionResult ¶
type GetDistributionResult struct {
XMLName xml.Name `xml:"Distribution"`
Xmlns string `xml:"xmlns,attr"`
ID string `xml:"Id"`
ARN string `xml:"ARN"`
Status string `xml:"Status"`
LastModifiedTime string `xml:"LastModifiedTime"`
DomainName string `xml:"DomainName"`
ActiveTrustedSigners *ActiveTrustedSignersXML `xml:"ActiveTrustedSigners"`
ActiveTrustedKeyGroups *ActiveTrustedKeyGroupsXML `xml:"ActiveTrustedKeyGroups"`
DistributionConfig *DistributionConfigXML `xml:"DistributionConfig"`
}
GetDistributionResult is the response for GetDistribution.
type HeadersXML ¶
type HeadersXML struct {
Quantity int `xml:"Quantity"`
Items []string `xml:"Items>Name,omitempty"`
}
HeadersXML represents headers in XML format.
type Invalidation ¶
type Invalidation struct {
ID string
Status string
CreateTime time.Time
InvalidationBatch *InvalidationBatch
}
Invalidation represents a CloudFront invalidation.
type InvalidationBatch ¶
InvalidationBatch represents an invalidation batch.
type InvalidationBatchXML ¶
type InvalidationBatchXML struct {
Paths *PathsXML `xml:"Paths"`
CallerReference string `xml:"CallerReference"`
}
InvalidationBatchXML represents an invalidation batch in XML format.
type InvalidationListXML ¶
type InvalidationListXML struct {
XMLName xml.Name `xml:"InvalidationList"`
Xmlns string `xml:"xmlns,attr"`
Marker string `xml:"Marker"`
MaxItems int `xml:"MaxItems"`
IsTruncated bool `xml:"IsTruncated"`
Quantity int `xml:"Quantity"`
Items *InvalidationSummaryList `xml:"Items,omitempty"`
NextMarker string `xml:"NextMarker,omitempty"`
}
InvalidationListXML represents a list of invalidations in XML format.
type InvalidationSummaryList ¶
type InvalidationSummaryList struct {
InvalidationSummary []InvalidationSummaryXML `xml:"InvalidationSummary"`
}
InvalidationSummaryList is a list of invalidation summaries.
type InvalidationSummaryXML ¶
type InvalidationSummaryXML struct {
ID string `xml:"Id"`
CreateTime string `xml:"CreateTime"`
Status string `xml:"Status"`
}
InvalidationSummaryXML represents an invalidation summary in XML format.
type InvalidationXML ¶
type InvalidationXML struct {
XMLName xml.Name `xml:"Invalidation"`
ID string `xml:"Id"`
Status string `xml:"Status"`
CreateTime string `xml:"CreateTime"`
InvalidationBatch *InvalidationBatchXML `xml:"InvalidationBatch"`
}
InvalidationXML represents an invalidation in XML format.
type ItemsXML ¶
type ItemsXML struct {
Items []string `xml:"CNAME,omitempty"`
}
ItemsXML is a generic items container for XML.
type MemoryStorage ¶
type MemoryStorage struct {
Distributions map[string]*Distribution `json:"distributions"`
Invalidations map[string]map[string]*Invalidation `json:"invalidations"` // distributionID -> invalidationID -> Invalidation
// contains filtered or unexported fields
}
MemoryStorage implements Storage with in-memory data.
func NewMemoryStorage ¶
func NewMemoryStorage(opts ...Option) *MemoryStorage
NewMemoryStorage creates a new memory storage.
func (*MemoryStorage) Close ¶ added in v0.6.0
func (s *MemoryStorage) Close() error
Close saves the storage state to disk if persistence is enabled.
func (*MemoryStorage) CreateDistribution ¶
func (s *MemoryStorage) CreateDistribution(_ context.Context, config *CreateDistributionRequest) (*Distribution, error)
CreateDistribution creates a new distribution.
func (*MemoryStorage) CreateInvalidation ¶
func (s *MemoryStorage) CreateInvalidation(_ context.Context, distributionID string, batch *CreateInvalidationRequest) (*Invalidation, error)
CreateInvalidation creates a new invalidation.
func (*MemoryStorage) DeleteDistribution ¶
func (s *MemoryStorage) DeleteDistribution(_ context.Context, id, etag string) error
DeleteDistribution deletes a distribution.
func (*MemoryStorage) GetDistribution ¶
func (s *MemoryStorage) GetDistribution(_ context.Context, id string) (*Distribution, error)
GetDistribution retrieves a distribution by ID.
func (*MemoryStorage) GetInvalidation ¶
func (s *MemoryStorage) GetInvalidation(_ context.Context, distributionID, invalidationID string) (*Invalidation, error)
GetInvalidation retrieves an invalidation.
func (*MemoryStorage) ListDistributions ¶
func (s *MemoryStorage) ListDistributions(_ context.Context, marker string, maxItems int) ([]*Distribution, string, error)
ListDistributions lists all distributions.
func (*MemoryStorage) ListInvalidations ¶
func (s *MemoryStorage) ListInvalidations(_ context.Context, distributionID, marker string, maxItems int) ([]*Invalidation, string, error)
ListInvalidations lists invalidations for a distribution.
func (*MemoryStorage) MarshalJSON ¶ added in v0.6.0
func (s *MemoryStorage) MarshalJSON() ([]byte, error)
MarshalJSON serializes the storage state to JSON.
func (*MemoryStorage) UnmarshalJSON ¶ added in v0.6.0
func (s *MemoryStorage) UnmarshalJSON(data []byte) error
UnmarshalJSON restores the storage state from JSON.
func (*MemoryStorage) UpdateDistribution ¶
func (s *MemoryStorage) UpdateDistribution(_ context.Context, id string, config *CreateDistributionRequest, etag string) (*Distribution, error)
UpdateDistribution updates a distribution.
type Option ¶ added in v0.6.0
type Option func(*MemoryStorage)
Option is a configuration option for MemoryStorage.
func WithDataDir ¶ added in v0.6.0
WithDataDir enables persistent storage in the specified directory.
type Origin ¶
type Origin struct {
ID string
DomainName string
OriginPath string
S3OriginConfig *S3OriginConfig
CustomOriginConfig *CustomOriginConfig
ConnectionAttempts int
ConnectionTimeout int
OriginAccessControlID string
}
Origin represents a CloudFront origin.
type OriginList ¶
type OriginList struct {
Origin []OriginXML `xml:"Origin"`
}
OriginList is a list of origins.
type OriginSSLProtocols ¶
OriginSSLProtocols represents allowed SSL protocols for origin.
type OriginSSLProtocolsXML ¶
type OriginSSLProtocolsXML struct {
Quantity int `xml:"Quantity"`
Items []string `xml:"Items>SslProtocol,omitempty"`
}
OriginSSLProtocolsXML represents origin SSL protocols in XML format.
type OriginXML ¶
type OriginXML struct {
ID string `xml:"Id"`
DomainName string `xml:"DomainName"`
OriginPath string `xml:"OriginPath,omitempty"`
S3OriginConfig *S3OriginConfigXML `xml:"S3OriginConfig,omitempty"`
CustomOriginConfig *CustomOriginConfigXML `xml:"CustomOriginConfig,omitempty"`
ConnectionAttempts int `xml:"ConnectionAttempts,omitempty"`
ConnectionTimeout int `xml:"ConnectionTimeout,omitempty"`
OriginAccessControlID string `xml:"OriginAccessControlId,omitempty"`
}
OriginXML represents an origin in XML format.
type OriginsXML ¶
type OriginsXML struct {
Quantity int `xml:"Quantity"`
Items *OriginList `xml:"Items,omitempty"`
}
OriginsXML represents origins in XML format.
type QueryStringCacheKeys ¶
QueryStringCacheKeys represents query string cache keys.
type RestrictionsXML ¶
type RestrictionsXML struct {
GeoRestriction *GeoRestrictionXML `xml:"GeoRestriction"`
}
RestrictionsXML represents restrictions in XML format.
type S3OriginConfig ¶
type S3OriginConfig struct {
OriginAccessIdentity string
}
S3OriginConfig represents S3 origin configuration.
type S3OriginConfigXML ¶
type S3OriginConfigXML struct {
OriginAccessIdentity string `xml:"OriginAccessIdentity"`
}
S3OriginConfigXML represents S3 origin config in XML format.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service implements the CloudFront service.
func (*Service) CreateDistribution ¶
func (s *Service) CreateDistribution(w http.ResponseWriter, r *http.Request)
CreateDistribution handles the CreateDistribution operation.
func (*Service) CreateInvalidation ¶
func (s *Service) CreateInvalidation(w http.ResponseWriter, r *http.Request)
CreateInvalidation handles the CreateInvalidation operation.
func (*Service) DeleteDistribution ¶
func (s *Service) DeleteDistribution(w http.ResponseWriter, r *http.Request)
DeleteDistribution handles the DeleteDistribution operation.
func (*Service) GetDistribution ¶
func (s *Service) GetDistribution(w http.ResponseWriter, r *http.Request)
GetDistribution handles the GetDistribution operation.
func (*Service) GetDistributionConfig ¶
func (s *Service) GetDistributionConfig(w http.ResponseWriter, r *http.Request)
GetDistributionConfig handles the GetDistributionConfig operation.
func (*Service) GetInvalidation ¶
func (s *Service) GetInvalidation(w http.ResponseWriter, r *http.Request)
GetInvalidation handles the GetInvalidation operation.
func (*Service) ListDistributions ¶
func (s *Service) ListDistributions(w http.ResponseWriter, r *http.Request)
ListDistributions handles the ListDistributions operation.
func (*Service) RegisterRoutes ¶
RegisterRoutes registers the CloudFront routes.
func (*Service) UpdateDistribution ¶
func (s *Service) UpdateDistribution(w http.ResponseWriter, r *http.Request)
UpdateDistribution handles the UpdateDistribution operation.
type Storage ¶
type Storage interface {
CreateDistribution(ctx context.Context, config *CreateDistributionRequest) (*Distribution, error)
GetDistribution(ctx context.Context, id string) (*Distribution, error)
ListDistributions(ctx context.Context, marker string, maxItems int) ([]*Distribution, string, error)
UpdateDistribution(ctx context.Context, id string, config *CreateDistributionRequest, etag string) (*Distribution, error)
DeleteDistribution(ctx context.Context, id string, etag string) error
CreateInvalidation(ctx context.Context, distributionID string, batch *CreateInvalidationRequest) (*Invalidation, error)
GetInvalidation(ctx context.Context, distributionID, invalidationID string) (*Invalidation, error)
ListInvalidations(ctx context.Context, distributionID, marker string, maxItems int) ([]*Invalidation, string, error)
}
Storage defines the CloudFront storage interface.
type TrustedKeyGroups ¶
TrustedKeyGroups represents trusted key groups.
type TrustedKeyGroupsXML ¶
type TrustedKeyGroupsXML struct {
Enabled bool `xml:"Enabled"`
Quantity int `xml:"Quantity"`
Items []string `xml:"Items>KeyGroup,omitempty"`
}
TrustedKeyGroupsXML represents trusted key groups in XML format.
type TrustedSigners ¶
TrustedSigners represents trusted signers.
type TrustedSignersXML ¶
type TrustedSignersXML struct {
Enabled bool `xml:"Enabled"`
Quantity int `xml:"Quantity"`
Items []string `xml:"Items>AwsAccountNumber,omitempty"`
}
TrustedSignersXML represents trusted signers in XML format.
type ViewerCertificate ¶
type ViewerCertificate struct {
CloudFrontDefaultCertificate bool
IAMCertificateID string
ACMCertificateArn string
SSLSupportMethod string
MinimumProtocolVersion string
Certificate string
CertificateSource string
}
ViewerCertificate represents viewer certificate configuration.
type ViewerCertificateXML ¶
type ViewerCertificateXML struct {
CloudFrontDefaultCertificate bool `xml:"CloudFrontDefaultCertificate,omitempty"`
IAMCertificateID string `xml:"IAMCertificateId,omitempty"`
ACMCertificateArn string `xml:"ACMCertificateArn,omitempty"`
MinimumProtocolVersion string `xml:"MinimumProtocolVersion,omitempty"`
SSLSupportMethod string `xml:"SSLSupportMethod,omitempty"`
}
ViewerCertificateXML represents viewer certificate in XML format.