Documentation
¶
Index ¶
- Variables
- func GenStateFunc(keys ...string) schema.StateContextFunc
- func HandleGetResourceError(d *schema.ResourceData, resp *http.Response, err error, codes ...int) error
- func RenameKey(data map[string]interface{}, oldKey, newKey string) (interface{}, bool)
- func SchemaDiffSuppressJSONString(k, oldV, newV string, d *schema.ResourceData) bool
- func SetDefaultValue(data map[string]interface{}, key string, value interface{})
- func WrapValidateFunc(f func(v interface{}, k string) error) schema.SchemaValidateFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidateIsJSON = WrapValidateFunc(func(value interface{}, key string) error { var a interface{} if err := json.Unmarshal([]byte(value.(string)), &a); err != nil { return fmt.Errorf("the value of the field '%s' must be JSON string: %w", key, err) } return nil })
View Source
var ValidateIsMapJSON = WrapValidateFunc(func(value interface{}, key string) error { var a interface{} if err := json.Unmarshal([]byte(value.(string)), &a); err != nil { return fmt.Errorf("the value of the field '%s' must be JSON string: %w", key, err) } if _, ok := a.(map[string]interface{}); !ok { return errors.New("the value of the field '" + key + "' must be JSON string of map") } return nil })
Functions ¶
func GenStateFunc ¶
func GenStateFunc(keys ...string) schema.StateContextFunc
func HandleGetResourceError ¶
func SchemaDiffSuppressJSONString ¶
func SchemaDiffSuppressJSONString(k, oldV, newV string, d *schema.ResourceData) bool
func SetDefaultValue ¶
func WrapValidateFunc ¶
func WrapValidateFunc(f func(v interface{}, k string) error) schema.SchemaValidateFunc
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.