Documentation
¶
Index ¶
- type MapData
- func (md MapData) Get(key string) interface{}
- func (md MapData) GetChange(key string) (interface{}, interface{})
- func (md MapData) GetOk(key string) (interface{}, bool)
- func (md MapData) GetOkExists(key string) (interface{}, bool)
- func (md MapData) HasChange(key string) bool
- func (md MapData) IsNewResource() bool
- func (md MapData) Set(key string, value interface{}) error
- type ResourceData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MapData ¶
type MapData map[string]interface{}
MapData wraps a map satisfying the Data interface, so it can be used in the accessor methods defined below.
It is not possible to fully mirror the functionality of Data as some information available to schema.ResourceData is lost when dealing with maps.
func (MapData) Get ¶
Get returns the data for the given key, or nil if the key doesn't exist in the map.
func (MapData) GetChange ¶
GetChange returns the old and new value for a given key. The old and new values will always be the same.
func (MapData) GetOk ¶
GetOk returns the data for the given key and whether or not the key has been set to a non-zero value at some point.
func (MapData) GetOkExists ¶
GetOkExists returns the data for a given key and whether or not the key has been set to a non-nil and non-zero value.
func (MapData) IsNewResource ¶
IsNewResource always reports false.
type ResourceData ¶
type ResourceData interface { // IsNewResource reports whether or not the resource is seen for the first // time. IsNewResource() bool // HasChange reports whether or not the given key has been changed. HasChange(key string) bool // GetChange returns the old and new value for a given key. GetChange(key string) (interface{}, interface{}) // Get returns the data for the given key, or nil if the key doesn't exist // in the schema. Get(key string) interface{} // GetOk returns the data for the given key and whether or not the key // has been set to a non-zero value at some point. GetOk(key string) (interface{}, bool) // GetOkExists returns the data for a given key and whether or not the key // has been set to a non-zero value. This is only useful for determining // if boolean attributes have been set, if they are Optional but do not // have a Default value. GetOkExists(key string) (interface{}, bool) // Set sets the value for the given key. // // If the key is invalid or the value is not a correct type, an error // will be returned. Set(key string, value interface{}) error }
The ResourceData interface represents a schema.ResourceData and defines some of its methods that are commonly used by the helper packages.
Directories
¶
Path | Synopsis |
---|---|
Package expand contains helper functions used to map terraform configuration to an API object.
|
Package expand contains helper functions used to map terraform configuration to an API object. |
Package flatten contains helper functions to deal with arbitrary data structures with terraform providers.
|
Package flatten contains helper functions to deal with arbitrary data structures with terraform providers. |