common

package
v1.4.0-prerelease.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EmailRegexp = regexp.MustCompile("^[a-zA-Z0-9+_.-]+@[a-zA-Z0-9.-]+$")

Functions

func BoolWithFalseDefault added in v1.4.0

func BoolWithFalseDefault(tfVal types.Bool) bool

func ConvertStringMapToMapType added in v1.4.0

func ConvertStringMapToMapType(stringMap map[string]string) (types.Map, error)

func GetThumbprint added in v1.4.0

func GetThumbprint(oidcEndpointURL string, httpClient HttpClient) (thumbprint string, err error)

func HandleErr

func HandleErr(res *ocmerrors.Error, err error) error

func HasValue added in v1.4.0

func HasValue(val attr.Value) bool

HasValue checks if the given terraform value is set.

func IsGreaterThanOrEqual

func IsGreaterThanOrEqual(version1, version2 string) (bool, error)

func IsStringAttributeEmpty

func IsStringAttributeEmpty(param types.String) bool

func IsValidDomain

func IsValidDomain(candidate string) bool

func IsValidEmail

func IsValidEmail(candidate string) bool

func OptionalInt64 added in v1.3.0

func OptionalInt64(tfVal types.Int64) *int64

func OptionalMap added in v1.3.0

func OptionalMap(ctx context.Context, tfVal types.Map) (map[string]string, error)

func OptionalString added in v1.3.0

func OptionalString(tfVal types.String) *string

func Sha1Hash added in v1.4.0

func Sha1Hash(data []byte) (string, error)

sha1Hash computes the SHA1 of the byte array and returns the hex encoding as a string.

func ShouldPatchBool

func ShouldPatchBool(state, plan types.Bool) (value bool, ok bool)

ShouldPatchBool changed checks if the change between the given state and plan requires sending a patch request to the server. If it does it return the value to add to the patch.

func ShouldPatchInt

func ShouldPatchInt(state, plan types.Int64) (value int64, ok bool)

shouldPatchInt changed checks if the change between the given state and plan requires sending a patch request to the server. If it does it returns the value to add to the patch.

func ShouldPatchMap

func ShouldPatchMap(state, plan types.Map) (types.Map, bool)

ShouldPatchMap changed checks if the change between the given state and plan requires sending a patch request to the server. If it does it return the value to add to the patch.

func ShouldPatchString

func ShouldPatchString(state, plan types.String) (value string, ok bool)

shouldPatchString changed checks if the change between the given state and plan requires sending a patch request to the server. If it does it returns the value to add to the patch.

func StringArrayToList

func StringArrayToList(stringList []string) (types.List, error)

func StringListToArray

func StringListToArray(ctx context.Context, tfVal types.List) ([]string, error)

func ValidateHTPasswdPassword added in v1.4.0

func ValidateHTPasswdPassword(password string) error

func ValidateHTPasswdUsername added in v1.4.0

func ValidateHTPasswdUsername(username string) error

func WaitTillClusterReady added in v1.4.0

func WaitTillClusterReady(ctx context.Context, collection *cmv1.ClustersClient, clusterId string) error

Types

type DefaultHttpClient added in v1.4.0

type DefaultHttpClient struct {
}

func (DefaultHttpClient) Get added in v1.4.0

func (c DefaultHttpClient) Get(url string) (resp *http.Response, err error)

type HttpClient added in v1.4.0

type HttpClient interface {
	Get(url string) (resp *http.Response, err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL