Documentation ¶
Index ¶
- Variables
- func UpdateCustomHeaderFn(headerName, headerValue string) func(*DistributionConfig)
- type ClientAPI
- type DefaultUpdater
- type DistributionConfig
- type MockClient
- func (m *MockClient) GetDistributionConfig(ctx context.Context, params *cloudfront.GetDistributionConfigInput, ...) (*cloudfront.GetDistributionConfigOutput, error)
- func (m *MockClient) UpdateDistribution(ctx context.Context, params *cloudfront.UpdateDistributionInput, ...) (*cloudfront.UpdateDistributionOutput, error)
- type MockUpdater
- type Updater
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrUpdateFunctionIsmissing = errors.New("update function is missing")
)
Functions ¶
func UpdateCustomHeaderFn ¶
func UpdateCustomHeaderFn(headerName, headerValue string) func(*DistributionConfig)
UpdateCustomHeaderFn returns a function that iterates over the distribution origins and updates the given custom header value if the header is found at the origin config level.
Types ¶
type ClientAPI ¶
type ClientAPI interface { GetDistributionConfig( ctx context.Context, params *cloudfront.GetDistributionConfigInput, optFns ...func(*cloudfront.Options), ) (*cloudfront.GetDistributionConfigOutput, error) UpdateDistribution( ctx context.Context, params *cloudfront.UpdateDistributionInput, optFns ...func(*cloudfront.Options), ) (*cloudfront.UpdateDistributionOutput, error) }
type DefaultUpdater ¶
type DefaultUpdater struct {
// contains filtered or unexported fields
}
func NewDefaultUpdater ¶
func NewDefaultUpdater(cli ClientAPI) *DefaultUpdater
func (*DefaultUpdater) Update ¶
func (u *DefaultUpdater) Update(ctx context.Context, distID string, fns ...func(*DistributionConfig)) error
Update implements the Updater interface
type DistributionConfig ¶
type DistributionConfig = types.DistributionConfig
DistributionConfig is an alias for "github.com/aws/aws-sdk-go-v2/service/cloudfront/types.DistributionConfig"
type MockClient ¶
type MockClient struct { GetDistributionConfigFunc func( ctx context.Context, params *cloudfront.GetDistributionConfigInput, optFns ...func(*cloudfront.Options), ) (*cloudfront.GetDistributionConfigOutput, error) UpdateDistributionFunc func( ctx context.Context, params *cloudfront.UpdateDistributionInput, optFns ...func(*cloudfront.Options), ) (*cloudfront.UpdateDistributionOutput, error) }
func (*MockClient) GetDistributionConfig ¶
func (m *MockClient) GetDistributionConfig( ctx context.Context, params *cloudfront.GetDistributionConfigInput, optFns ...func(*cloudfront.Options), ) (*cloudfront.GetDistributionConfigOutput, error)
DescribeSecret implements ClientAPI.
func (*MockClient) UpdateDistribution ¶
func (m *MockClient) UpdateDistribution( ctx context.Context, params *cloudfront.UpdateDistributionInput, optFns ...func(*cloudfront.Options), ) (*cloudfront.UpdateDistributionOutput, error)
GetSecretValue implements ClientAPI.
type MockUpdater ¶
type MockUpdater struct {
UpdateFn func(ctx context.Context, distID string, fns ...func(*DistributionConfig)) error
}
MockUpdater is a mock implementation of the Updater interface.
func (*MockUpdater) Update ¶
func (m *MockUpdater) Update(ctx context.Context, distID string, fns ...func(*DistributionConfig)) error
Update mocks the Update method.
type Updater ¶
type Updater interface { // Update fetches the distribution config and updates it using a set of functions. // An empty set of functions behavior is implementation-specific. Update(ctx context.Context, distID string, fns ...func(*DistributionConfig)) error }
Updater interface presents a service that updates a cloudfront distribution config.
Click to show internal directories.
Click to hide internal directories.