Skip to content

Commit bf3755b

Browse files
🧹 [code health] Remove deprecated New function from bedrock backend
Co-authored-by: matdev83 <211248003+matdev83@users.noreply.github.com>
1 parent 96d7ab5 commit bf3755b

1 file changed

Lines changed: 2 additions & 12 deletions

File tree

‎internal/plugins/backends/bedrock/plugin.go‎

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,10 @@ func defaultBackendCaps() lipapi.BackendCaps {
2121
}
2222

2323
// DefaultLoadConfigTimeout bounds AWS SDK default configuration loading during backend construction.
24-
// New applies it automatically; composition roots calling NewWithContext should wrap their
24+
// Composition roots calling NewWithContext should wrap their
2525
// context with context.WithTimeout using this duration (or shorter) unless it already carries a deadline.
2626
const DefaultLoadConfigTimeout = 30 * time.Second
2727

28-
// New returns a runtime backend that invokes Bedrock ConverseStream via the AWS SDK v2.
29-
//
30-
// Deprecated: prefer [NewWithContext] with a context whose deadline reflects your bootstrap
31-
// budget. New applies [DefaultLoadConfigTimeout] around AWS config load only.
32-
func New(cfg Config) execbackend.Backend {
33-
ctx, cancel := context.WithTimeout(context.Background(), DefaultLoadConfigTimeout)
34-
defer cancel()
35-
return NewWithContext(ctx, cfg)
36-
}
37-
3828
// ensureLoadConfigDeadline returns a context for awsconfig.LoadDefaultConfig. If ctx is nil, or
3929
// has no deadline, it wraps with [DefaultLoadConfigTimeout] so config load cannot hang
4030
// indefinitely. The caller must invoke the returned CancelFunc.
@@ -48,7 +38,7 @@ func ensureLoadConfigDeadline(ctx context.Context) (context.Context, context.Can
4838
return context.WithTimeout(ctx, DefaultLoadConfigTimeout)
4939
}
5040

51-
// NewWithContext returns a runtime backend like [New], using ctx for awsconfig.LoadDefaultConfig.
41+
// NewWithContext returns a runtime backend, using ctx for awsconfig.LoadDefaultConfig.
5242
// A deadline is always applied for the load step: either ctx's own deadline, or
5343
// [DefaultLoadConfigTimeout] when ctx is nil or uncancelled without a deadline.
5444
func NewWithContext(ctx context.Context, cfg Config) execbackend.Backend {

0 commit comments

Comments
 (0)