Skip to content

Commit

Permalink
add needed type
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahvita committed Oct 24, 2023
1 parent d46cebf commit 25aa111
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions config/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,26 @@ func getRegion(ctx context.Context, configs configs) (value string, found bool,
return
}

// IgnoreConfiguredEndpointsProvider is needed to search for all providers
// that provide a flag to disable configured endpoints.
type IgnoreConfiguredEndpointsProvider interface {
GetIgnoreConfiguredEndpoints(ctx context.Context) (bool, bool, error)
}

// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured
// endpoints feature.
func GetIgnoreConfiguredEndpoints(ctx context.Context, configs []Config) (value bool, found bool, err error) {
for _, cfg := range configs {
if p, ok := cfg.(IgnoreConfiguredEndpointsProvider); ok {
value, found, err = p.GetIgnoreConfiguredEndpoints(ctx)
if err != nil || found {
break
}
}
}
return
}

// appIDProvider provides access to the sdk app ID value
type appIDProvider interface {
getAppID(ctx context.Context) (string, bool, error)
Expand Down

0 comments on commit 25aa111

Please sign in to comment.