mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/aws/aws-sdk-go-v2/config v1.26.6
vendor github.com/aws/aws-sdk-go-v2/config v1.26.6 and related dependencies. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
109
vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go
generated
vendored
109
vendor/github.com/aws/aws-sdk-go-v2/config/load_options.go
generated
vendored
@ -172,6 +172,10 @@ type LoadOptions struct {
|
||||
// the region, the client's requests are sent to.
|
||||
S3UseARNRegion *bool
|
||||
|
||||
// S3DisableMultiRegionAccessPoints specifies if the S3 service should disable
|
||||
// the S3 Multi-Region access points feature.
|
||||
S3DisableMultiRegionAccessPoints *bool
|
||||
|
||||
// EnableEndpointDiscovery specifies if endpoint discovery is enable for
|
||||
// the client.
|
||||
EnableEndpointDiscovery aws.EndpointDiscoveryEnableState
|
||||
@ -199,6 +203,18 @@ type LoadOptions struct {
|
||||
|
||||
// Specifies the SDK configuration mode for defaults.
|
||||
DefaultsModeOptions DefaultsModeOptions
|
||||
|
||||
// The sdk app ID retrieved from env var or shared config to be added to request user agent header
|
||||
AppID string
|
||||
|
||||
// Specifies whether an operation request could be compressed
|
||||
DisableRequestCompression *bool
|
||||
|
||||
// The inclusive min bytes of a request body that could be compressed
|
||||
RequestMinCompressSizeBytes *int64
|
||||
|
||||
// Whether S3 Express auth is disabled.
|
||||
S3DisableExpressAuth *bool
|
||||
}
|
||||
|
||||
func (o LoadOptions) getDefaultsMode(ctx context.Context) (aws.DefaultsMode, bool, error) {
|
||||
@ -241,6 +257,27 @@ func (o LoadOptions) getRegion(ctx context.Context) (string, bool, error) {
|
||||
return o.Region, true, nil
|
||||
}
|
||||
|
||||
// getAppID returns AppID from config's LoadOptions
|
||||
func (o LoadOptions) getAppID(ctx context.Context) (string, bool, error) {
|
||||
return o.AppID, len(o.AppID) > 0, nil
|
||||
}
|
||||
|
||||
// getDisableRequestCompression returns DisableRequestCompression from config's LoadOptions
|
||||
func (o LoadOptions) getDisableRequestCompression(ctx context.Context) (bool, bool, error) {
|
||||
if o.DisableRequestCompression == nil {
|
||||
return false, false, nil
|
||||
}
|
||||
return *o.DisableRequestCompression, true, nil
|
||||
}
|
||||
|
||||
// getRequestMinCompressSizeBytes returns RequestMinCompressSizeBytes from config's LoadOptions
|
||||
func (o LoadOptions) getRequestMinCompressSizeBytes(ctx context.Context) (int64, bool, error) {
|
||||
if o.RequestMinCompressSizeBytes == nil {
|
||||
return 0, false, nil
|
||||
}
|
||||
return *o.RequestMinCompressSizeBytes, true, nil
|
||||
}
|
||||
|
||||
// WithRegion is a helper function to construct functional options
|
||||
// that sets Region on config's LoadOptions. Setting the region to
|
||||
// an empty string, will result in the region value being ignored.
|
||||
@ -253,6 +290,39 @@ func WithRegion(v string) LoadOptionsFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// WithAppID is a helper function to construct functional options
|
||||
// that sets AppID on config's LoadOptions.
|
||||
func WithAppID(ID string) LoadOptionsFunc {
|
||||
return func(o *LoadOptions) error {
|
||||
o.AppID = ID
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithDisableRequestCompression is a helper function to construct functional options
|
||||
// that sets DisableRequestCompression on config's LoadOptions.
|
||||
func WithDisableRequestCompression(DisableRequestCompression *bool) LoadOptionsFunc {
|
||||
return func(o *LoadOptions) error {
|
||||
if DisableRequestCompression == nil {
|
||||
return nil
|
||||
}
|
||||
o.DisableRequestCompression = DisableRequestCompression
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithRequestMinCompressSizeBytes is a helper function to construct functional options
|
||||
// that sets RequestMinCompressSizeBytes on config's LoadOptions.
|
||||
func WithRequestMinCompressSizeBytes(RequestMinCompressSizeBytes *int64) LoadOptionsFunc {
|
||||
return func(o *LoadOptions) error {
|
||||
if RequestMinCompressSizeBytes == nil {
|
||||
return nil
|
||||
}
|
||||
o.RequestMinCompressSizeBytes = RequestMinCompressSizeBytes
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// getDefaultRegion returns DefaultRegion from config's LoadOptions
|
||||
func (o LoadOptions) getDefaultRegion(ctx context.Context) (string, bool, error) {
|
||||
if len(o.DefaultRegion) == 0 {
|
||||
@ -859,6 +929,26 @@ func WithS3UseARNRegion(v bool) LoadOptionsFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// GetS3DisableMultiRegionAccessPoints returns whether to disable
|
||||
// the S3 multi-region access points feature.
|
||||
func (o LoadOptions) GetS3DisableMultiRegionAccessPoints(ctx context.Context) (v bool, found bool, err error) {
|
||||
if o.S3DisableMultiRegionAccessPoints == nil {
|
||||
return false, false, nil
|
||||
}
|
||||
return *o.S3DisableMultiRegionAccessPoints, true, nil
|
||||
}
|
||||
|
||||
// WithS3DisableMultiRegionAccessPoints is a helper function to construct functional options
|
||||
// that can be used to set S3DisableMultiRegionAccessPoints on LoadOptions.
|
||||
// If multiple WithS3DisableMultiRegionAccessPoints calls are made, the last call overrides
|
||||
// the previous call values.
|
||||
func WithS3DisableMultiRegionAccessPoints(v bool) LoadOptionsFunc {
|
||||
return func(o *LoadOptions) error {
|
||||
o.S3DisableMultiRegionAccessPoints = &v
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// GetEnableEndpointDiscovery returns if the EnableEndpointDiscovery flag is set.
|
||||
func (o LoadOptions) GetEnableEndpointDiscovery(ctx context.Context) (value aws.EndpointDiscoveryEnableState, ok bool, err error) {
|
||||
if o.EnableEndpointDiscovery == aws.EndpointDiscoveryUnset {
|
||||
@ -1003,3 +1093,22 @@ func WithDefaultsMode(mode aws.DefaultsMode, optFns ...func(options *DefaultsMod
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// GetS3DisableExpressAuth returns the configured value for
|
||||
// [EnvConfig.S3DisableExpressAuth].
|
||||
func (o LoadOptions) GetS3DisableExpressAuth() (value, ok bool) {
|
||||
if o.S3DisableExpressAuth == nil {
|
||||
return false, false
|
||||
}
|
||||
|
||||
return *o.S3DisableExpressAuth, true
|
||||
}
|
||||
|
||||
// WithS3DisableExpressAuth sets [LoadOptions.S3DisableExpressAuth]
|
||||
// to the value provided.
|
||||
func WithS3DisableExpressAuth(v bool) LoadOptionsFunc {
|
||||
return func(o *LoadOptions) error {
|
||||
o.S3DisableExpressAuth = &v
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user