mirror of
https://github.com/hashicorp/terraform.git
synced 2026-03-21 18:10:30 -04:00
32 lines
842 B
Go
32 lines
842 B
Go
// Copyright IBM Corp. 2014, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package getproviders
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/hashicorp/terraform/internal/addrs"
|
|
)
|
|
|
|
// HangingSource is an implementation of Source which hangs until the given
|
|
// context is cancelled. This is useful only for unit tests of user-controlled
|
|
// cancels.
|
|
type HangingSource struct {
|
|
}
|
|
|
|
var _ Source = (*HangingSource)(nil)
|
|
|
|
func (s *HangingSource) AvailableVersions(ctx context.Context, provider addrs.Provider) (VersionList, Warnings, error) {
|
|
<-ctx.Done()
|
|
return nil, nil, nil
|
|
}
|
|
|
|
func (s *HangingSource) PackageMeta(ctx context.Context, provider addrs.Provider, version Version, target Platform) (PackageMeta, error) {
|
|
<-ctx.Done()
|
|
return PackageMeta{}, nil
|
|
}
|
|
|
|
func (s *HangingSource) ForDisplay(provider addrs.Provider) string {
|
|
return "hanging source"
|
|
}
|