Documentation ¶
Index ¶
- Constants
- func GenerateHclConfiguration[K any](bucketName, labId string, k *K) error
- func GetFile(bucketName, key string) ([]byte, error)
- func GetHclConfig(bucketName, fileName string) ([]byte, error)
- func ResourceIter[T any](service string, hclConfig HclConfig, f func(resource *ResourceBody) T) []T
- func ResourceValidator[T any](service string, hclConfig HclConfig, f func(t T) error) error
- func SimpleDecode[T any](f hcl.Body, t *T) T
- func SubstituteKV(s []string, m map[string]string)
- func ValidateStruct(nameValue string, t interface{}) error
- type HclConfig
- type IValidateInterface
- type ResourceBody
- type Validate
Constants ¶
View Source
const LAB_PATH = "labs/%s/hcl/config.hcl"
View Source
const (
SERVICES_EC2 = "ec2"
)
View Source
const TEST_BUCKET = "test"
///
Variables ¶
This section is empty.
Functions ¶
func GenerateHclConfiguration ¶
/////////////////////////////////////
func GetHclConfig ¶
/////////////////////////////////////
func ResourceIter ¶
func ResourceIter[T any](service string, hclConfig HclConfig, f func(resource *ResourceBody) T) []T
//////////////////
func ResourceValidator ¶
//////////////////
func SubstituteKV ¶
///////////////////// Substitutes the IDs for the names when the IDs are the keys. This was created to handle same named resources.
func ValidateStruct ¶
/////////////////////
Types ¶
type HclConfig ¶
type HclConfig struct {
ResourceBodies []*ResourceBody `hcl:"resource,block"`
}
type IValidateInterface ¶
type IValidateInterface interface {
GetName() string
}
type ResourceBody ¶
type ResourceBody struct { Type string `hcl:"protocol,label"` Name string `hcl:"name,label"` HCL hcl.Body `hcl:",remain"` }
///
Click to show internal directories.
Click to hide internal directories.