driftctl/test/resource/resource.go

53 lines
935 B
Go
Raw Normal View History

package resource
import "fmt"
type FakeResource struct {
Id string
FooBar string
2020-12-16 12:02:02 +00:00
BarFoo string `computed:"true"`
Json string `jsonstring:"true"`
Type string
Tags map[string]string
CustomMap map[string]struct {
Tag string
}
2020-12-18 14:28:46 +00:00
Slice []string
Struct struct {
Baz string `computed:"true"`
Bar string
}
2020-12-16 12:02:02 +00:00
StructSlice []struct {
String string `computed:"true"`
Array []string `computed:"true"`
}
}
func (d FakeResource) TerraformId() string {
return d.Id
}
func (d FakeResource) TerraformType() string {
if d.Type != "" {
return d.Type
}
return "FakeResource"
}
type FakeResourceStringer struct {
Id string
Name string
}
func (d *FakeResourceStringer) TerraformId() string {
return d.Id
}
func (d *FakeResourceStringer) TerraformType() string {
return "FakeResourceStringer"
}
func (d *FakeResourceStringer) String() string {
return fmt.Sprintf("Name: '%s'", d.Name)
}