Documentation ¶
Index ¶
- Constants
- Variables
- func Base64ToString(config string) (string, error)
- func BuildStateChangeConf(pending, target []string, timeout, delay time.Duration, ...) *resource.StateChangeConf
- func BuildTagResourceName(serviceType, resourceType, region, id string) string
- func CheckNil(object interface{}, fields map[string]string) (nilFields []string)
- func FindIntListIndex(list []int, elem int) int
- func GetListDiffs(o []int, n []int) (adds []int, lacks []int)
- func GetListIncrement(o []int, n []int) (result []int, err error)
- func GetLogId(ctx context.Context) string
- func InconsistentCheck(d *schema.ResourceData, meta interface{}) func()
- func IsContains(array interface{}, value interface{}) bool
- func IsExpectError(err error, expectError []string) bool
- func IsNil(v interface{}) bool
- func IsString(data interface{}) bool
- func LogElapsed(mark ...string) func()
- func MatchAny(value interface{}, matches ...interface{}) bool
- func MonthBetweenTwoDates(start, end string) int
- func ParseTimeFromCommonLayout(t *string) time.Time
- func ReadFromFile(file string) ([]byte, error)
- func RetryError(err error, additionRetryableError ...string) *resource.RetryError
- func RetryWithContext(ctx context.Context, timeout time.Duration, ...) (interface{}, error)
- func ShortRegionNameParse(shortRegion string) string
- func StringToBase64(config string) string
- func StringToTime(t string) time.Time
- func ValidateAllowedIntValue(ints []int) schema.SchemaValidateFunc
- func ValidateAllowedStringValue(ss []string) schema.SchemaValidateFunc
- func ValidateAllowedStringValueIgnoreCase(ss []string) schema.SchemaValidateFunc
- func ValidateAsConfigPassword(v interface{}, k string) (ws []string, errors []error)
- func ValidateAsScheduleTimestamp(v interface{}, k string) (ws []string, errors []error)
- func ValidateCIDRNetworkAddress(v interface{}, k string) (ws []string, errors []error)
- func ValidateCidrIp(v interface{}, k string) (ws []string, errs []error)
- func ValidateCosBucketLifecycleTimestamp(v interface{}, k string) (ws []string, errors []error)
- func ValidateCosBucketName(v interface{}, k string) (ws []string, errors []error)
- func ValidateImageID(v interface{}, k string) (ws []string, errors []error)
- func ValidateInstanceType(v interface{}, k string) (ws []string, errors []error)
- func ValidateIntegerInRange(min, max int64) schema.SchemaValidateFunc
- func ValidateIntegerMin(min int) schema.SchemaValidateFunc
- func ValidateIp(v interface{}, k string) (ws []string, errors []error)
- func ValidateKeyPairName(v interface{}, k string) (ws []string, errors []error)
- func ValidateLowCase(v interface{}, k string) (ws []string, errors []error)
- func ValidateMysqlPassword(v interface{}, k string) (ws []string, errors []error)
- func ValidateNameRegex(v interface{}, k string) (ws []string, errors []error)
- func ValidateNotEmpty(v interface{}, k string) (ws []string, errors []error)
- func ValidatePort(v interface{}, k string) (ws []string, errors []error)
- func ValidatePortRange(v interface{}, k string) (ws []string, errors []error)
- func ValidateStringLengthInRange(min, max int) schema.SchemaValidateFunc
- func ValidateStringNumber(v interface{}, k string) (ws []string, errors []error)
- func ValidateStringPrefix(prefix ...string) schema.SchemaValidateFunc
- func ValidateStringSuffix(suffix ...string) schema.SchemaValidateFunc
- func ValidateTime(layout string) schema.SchemaValidateFunc
- func ValidateTkeGpuDriverVersion(v interface{}, k string) (ws []string, errors []error)
- func ValidateYaml(v interface{}, k string) (ws []string, errors []error)
- func WriteToFile(filePath string, data interface{}) error
- func YamlParser(config string) (map[interface{}]interface{}, error)
- type GoRoutineLimit
- type ProviderMeta
Constants ¶
const ( PROVIDER_READ_RETRY_TIMEOUT = "TENCENTCLOUD_READ_RETRY_TIMEOUT" PROVIDER_WRITE_RETRY_TIMEOUT = "TENCENTCLOUD_WRITE_RETRY_TIMEOUT" PROVIDER_WAIT_READ_TIMEOUT = "TENCENTCLOUD_WAIT_READ_TIMEOUT" SWEEPER_NEED_PROTECT = "SWEEPER_NEED_PROTECT" TENCENTCLOUD_COMMON_TIME_LAYOUT = "2006-01-02 15:04:05" )
const COMMA_SP = ","
const FILED_SP = "#"
const InternalError = "InternalError"
InternalError common internalError, do not add in retryableErrorCode, because when some product return this error, retry won't fix anything.
const LogIdKey = contextLogId("logId")
Variables ¶
var ContextNil context.Context = nil
var NeedProtect = getEnvDefault(SWEEPER_NEED_PROTECT, 0)
NeedProtect ... const writeRetryTimeout = 5 * time.Minute
var ReadRetryTimeout = time.Duration(readRetry) * time.Minute
var WaitReadTimeout = time.Duration(waitRead) * time.Second
var WriteRetryTimeout = time.Duration(writeRetry) * time.Minute
Functions ¶
func Base64ToString ¶
func BuildStateChangeConf ¶
func BuildStateChangeConf(pending, target []string, timeout, delay time.Duration, refresh resource.StateRefreshFunc) *resource.StateChangeConf
func BuildTagResourceName ¶
BuildTagResourceName builds the Tencent Cloud specific name of a resource description. The format is `qcs:project_id:service_type:region:account:resource`. For more information, go to https://cloud.tencent.com/document/product/598/10606.
func FindIntListIndex ¶
func InconsistentCheck ¶
func InconsistentCheck(d *schema.ResourceData, meta interface{}) func()
InconsistentCheck for Provider produced inconsistent result after apply
func IsContains ¶
func IsContains(array interface{}, value interface{}) bool
IsContains returns whether value is within array
func IsExpectError ¶
IsExpectError returns whether error is expected error
func LogElapsed ¶
func LogElapsed(mark ...string) func()
LogElapsed log func elapsed time, using in defer
func MonthBetweenTwoDates ¶
func RetryError ¶
func RetryError(err error, additionRetryableError ...string) *resource.RetryError
RetryError returns retry error
func RetryWithContext ¶
func RetryWithContext( ctx context.Context, timeout time.Duration, f func(context.Context) (interface{}, error), additionRetryableError ...string) (interface{}, error)
RetryWithContext retries the function `f` when the error it returns satisfies `predicate`. `f` is retried until `timeout` expires.
func ShortRegionNameParse ¶ added in v1.81.60
func StringToBase64 ¶
func ValidateAllowedIntValue ¶
func ValidateAllowedIntValue(ints []int) schema.SchemaValidateFunc
func ValidateAllowedStringValue ¶
func ValidateAllowedStringValue(ss []string) schema.SchemaValidateFunc
func ValidateAllowedStringValueIgnoreCase ¶
func ValidateAllowedStringValueIgnoreCase(ss []string) schema.SchemaValidateFunc
func ValidateCIDRNetworkAddress ¶
validateCIDRNetworkAddress ensures that the string value is a valid CIDR that represents a network address - it adds an error otherwise
func ValidateCidrIp ¶
func ValidateCosBucketName ¶
Only support lowercase letters, numbers and "-". It cannot be longer than 60 characters. specification: https://cloud.tencent.com/document/product/436/13312
func ValidateImageID ¶
func ValidateInstanceType ¶
func ValidateIntegerInRange ¶
func ValidateIntegerInRange(min, max int64) schema.SchemaValidateFunc
NOTE not exactly strict, but ok for now
func ValidateIntegerMin ¶
func ValidateIntegerMin(min int) schema.SchemaValidateFunc
func ValidateIp ¶
func ValidateKeyPairName ¶
func ValidateLowCase ¶
func ValidateMysqlPassword ¶
func ValidateNameRegex ¶
func ValidateNotEmpty ¶
func ValidatePort ¶
func ValidatePortRange ¶
func ValidateStringLengthInRange ¶
func ValidateStringLengthInRange(min, max int) schema.SchemaValidateFunc
func ValidateStringNumber ¶
func ValidateStringPrefix ¶
func ValidateStringPrefix(prefix ...string) schema.SchemaValidateFunc
check if string has given prefix, if no one prefix matches, errors will have error
func ValidateStringSuffix ¶
func ValidateStringSuffix(suffix ...string) schema.SchemaValidateFunc
check if string has given suffix, if no one suffix matches, errors will have error
func ValidateTime ¶
func ValidateTime(layout string) schema.SchemaValidateFunc
func ValidateYaml ¶
func WriteToFile ¶
WriteToFile write data to file
func YamlParser ¶
YamlParser yaml syntax Parser
Types ¶
type GoRoutineLimit ¶
type GoRoutineLimit struct { Count int Chan chan struct{} }
GoRoutineLimit ...
func NewGoRoutine ¶
func NewGoRoutine(num int) *GoRoutineLimit
func (*GoRoutineLimit) Run ¶
func (g *GoRoutineLimit) Run(f func())
type ProviderMeta ¶
type ProviderMeta interface { // GetAPIV3Conn 返回访问云 API 的客户端连接对象 GetAPIV3Conn() *connectivity.TencentCloudClient }
ProviderMeta Provider 元信息