Initial import

This commit is contained in:
2025-10-10 10:05:13 +02:00
parent 3effc1597b
commit b96b6e7f8f
164 changed files with 5473 additions and 0 deletions

29
provider/provider.go Normal file
View File

@@ -0,0 +1,29 @@
package provider
import (
"fmt"
"github.com/hashicorp/hcl/v2"
)
type Config struct {
// Name is a unique identifier for the provider.
Name string
// Init is called once to initialize the provider from the matching configuration block.
Init func(hcl.Body) error
}
var providerConfigs = make(map[string]*Config)
func Init(name string, body hcl.Body) error {
p, ok := providerConfigs[name]
if ok {
return p.Init(body)
}
return fmt.Errorf("provider: no %q provider available", name)
}
func Register(provider *Config) {
providerConfigs[provider.Name] = provider
}