Documentation ¶
Index ¶
- Constants
- func GetSMap(src interface{}) []map[string]interface{}
- func GetlistMap(src interface{}) []map[string]interface{}
- func IsEmpty(n interface{}) bool
- func JSONNumber(in interface{}) json.Number
- func ParseInt(str string) (int64, error)
- func ParsePowerState(state string) string
- func Retry(ctx context.Context, meta interface{}, fn RetryFunc) (interface{}, error)
- func SkipEmptyField() schema.SchemaDiffSuppressFunc
- func SkipField() schema.SchemaDiffSuppressFunc
- type CondFunc
- type CustomRetry
- type Data
- func (d *Data) Error() error
- func (d *Data) GetBool(key string) bool
- func (d *Data) GetChangedListMap(key string) ([]map[string]interface{}, []map[string]interface{})
- func (d *Data) GetChangedMap(key string) (map[string]interface{}, map[string]interface{})
- func (d *Data) GetID() int
- func (d *Data) GetIDString() string
- func (d *Data) GetInt(key string, ignore ...bool) int
- func (d *Data) GetJSONNumber(key string, ignore ...bool) json.Number
- func (d *Data) GetListMap(key string) []map[string]interface{}
- func (d *Data) GetMap(key string, ignore ...bool) map[string]interface{}
- func (d *Data) GetOk(key string) (interface{}, bool)
- func (d *Data) GetString(key string, ignore ...bool) string
- func (d *Data) GetStringList(key string, ignore ...bool) []string
- func (d *Data) HasChanged(key string) bool
- func (d *Data) Id() string
- func (d *Data) ListToIntSlice(key string, ignore ...bool) []int
- func (d *Data) Set(key string, val interface{}) error
- func (d *Data) SetID(v interface{})
- func (d *Data) SetId(v string)
- func (d *Data) SetString(key string, value string)
- type RetryFunc
Constants ¶
const ( // state constants StateUnknown = "unknown" StateRunning = "running" StateFailed = "failed" StateProvisioning = "provisioning" StateStopped = "stopped" StateStopping = "stopping" StateSuspended = "suspended" StateSuspending = "suspending" StateResizing = "resizing" StateRestarting = "restarting" // data constants ErrInvalidType = "invalid Type" ErrKeyNotDefined = "key is not defined" ErrSet = "failed to set" NAN = 0 // power constants PowerOn = "poweron" PowerOff = "poweroff" Restart = "restart" Suspend = "suspend" Deleting = "deleting" Deleted = "deleted" Failed = "failed" PortGroupPrefix = "dvportgroup-" )
Variables ¶
This section is empty.
Functions ¶
func GetlistMap ¶
func GetlistMap(src interface{}) []map[string]interface{}
func JSONNumber ¶
func ParsePowerState ¶
func SkipEmptyField ¶ added in v0.1.32
func SkipEmptyField() schema.SchemaDiffSuppressFunc
SkipEmptyField it to skip diff check when user didn't set any attribute in tf file but state file is updated
func SkipField ¶
func SkipField() schema.SchemaDiffSuppressFunc
Types ¶
type CondFunc ¶
CondFunc function accepts response and error of the RetryFunc. If any error returns retry will terminated and returns the error
type CustomRetry ¶
type CustomRetry struct { RetryCount int RetryDelay time.Duration InitialDelay time.Duration Cond CondFunc Timeout time.Duration // contains filtered or unexported fields }
CustomRetry allows developers to configure the timeout, retry count and delay
func (*CustomRetry) Retry ¶
func (c *CustomRetry) Retry( ctx context.Context, meta interface{}, fn RetryFunc, ) (interface{}, error)
Retry supports extra arguments. initialDelay will put a delay before invoking the function. RetryCount supports customized retry count. If Timeout specified then RetryCount will be skipped. RetryDelay will put a delay in between each retrys. If any of these values are not specified then default value will be assigned.
func (*CustomRetry) RetryParallel ¶
func (c *CustomRetry) RetryParallel(ctx context.Context, meta interface{}, fn RetryFunc)
RetryParallel runs retry as routine. Use Wait function to wait and get the response error. To run more than one API or functions as a routine you may need to specify different CustomRetry struct.
func (*CustomRetry) Wait ¶
func (c *CustomRetry) Wait() (interface{}, error)
type Data ¶
type Data struct {
// contains filtered or unexported fields
}
func (*Data) GetChangedListMap ¶
func (*Data) GetChangedMap ¶
func (*Data) GetListMap ¶
GetListMap take key as parameter and returns []map[string]interfac{}. This function can be used for retrieving list of map or list of set
func (*Data) GetStringList ¶
GetStringList returns list of string