MCPcopy Create free account
hub / github.com/Pluralith/pluralith-cli / MapBackendConfig

Function MapBackendConfig

app/pkg/backends/LoadBackend.go:15–32  ·  view source on GitHub ↗
(tfState TerraformState, configObject interface{})

Source from the content-addressed store, hash-verified

13)
14
15func MapBackendConfig(tfState TerraformState, configObject interface{}) error {
16 functionName := "LoadBackendConfig"
17
18 config := &mapstructure.DecoderConfig{TagName: "json"}
19 config.Result = &configObject
20
21 decoder, decodeInitErr := mapstructure.NewDecoder(config)
22 if decodeInitErr != nil {
23 return fmt.Errorf("creating map decoder failed -> %v: %w", functionName, decodeInitErr)
24 }
25
26 decodeErr := decoder.Decode(tfState.Backend.Config)
27 if decodeInitErr != nil {
28 return fmt.Errorf("decoding backend config failed -> %v: %w", functionName, decodeErr)
29 }
30
31 return nil
32}
33
34func LoadBackendConfig() (TerraformState, error) {
35 functionName := "LoadBackendConfig"

Callers 3

PushToAzureBackendFunction · 0.85
PushToGCSBackendFunction · 0.85
PushToS3BackendFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected