Documentation ¶
Index ¶
- Constants
- func CreateHTTPClient(timeout time.Duration, unsafeSsl bool) *http.Client
- func GetClusterObjectNamespace() (string, error)
- func GetRestrictSecretAccess() string
- func MaskPartOfURL(s string, part urlPart) (string, error)
- func NewTLSConfig(clientCert, clientKey, caCert string) (*tls.Config, error)
- func NewTLSConfigWithPassword(clientCert, clientKey, clientKeyPassword, caCert string) (*tls.Config, error)
- func NormalizeString(s string) string
- func ParseGVKR(restMapper meta.RESTMapper, apiVersion string, kind string) (kedav1alpha1.GroupVersionKindResource, error)
- func ParseInt32List(pattern string) ([]int32, error)
- func ParseRange(from, to string) ([]int32, error)
- func ResolveOsEnvBool(envName string, defaultValue bool) (bool, error)
- func ResolveOsEnvDuration(envName string) (*time.Duration, error)
- func ResolveOsEnvInt(envName string, defaultValue int) (int, error)
- type HTTPDoer
- type K8sVersion
Constants ¶
const ( // Hostname is a constant refers to the hostname part of the url Hostname urlPart = "Hostname" // Password is a constant that refers to a password portion of the url if there is one Password urlPart = "Password" )
const RestrictSecretAccessEnvVar = "KEDA_RESTRICT_SECRET_ACCESS"
Variables ¶
This section is empty.
Functions ¶
func CreateHTTPClient ¶
CreateHTTPClient returns a new HTTP client with the timeout set to timeoutMS milliseconds, or 300 milliseconds if timeoutMS <= 0. unsafeSsl parameter allows to avoid tls cert validation if it's required
func GetClusterObjectNamespace ¶ added in v2.9.0
GetClusterObjectNamespace retrieves the cluster object namespace of KEDA, default is the namespace of KEDA Operator & Metrics Server
func GetRestrictSecretAccess ¶ added in v2.9.0
func GetRestrictSecretAccess() string
GetRestrictSecretAccess retrieves the value of the environment variable of KEDA_RESTRICT_SECRET_ACCESS
func MaskPartOfURL ¶
MaskPartOfURL will parse a url and returned a masked version or an error
func NewTLSConfig ¶
NewTLSConfig returns a *tls.Config using the given ceClient cert, ceClient key, and CA certificate. If none are appropriate, a nil *tls.Config is returned.
func NewTLSConfigWithPassword ¶ added in v2.8.0
func NewTLSConfigWithPassword(clientCert, clientKey, clientKeyPassword, caCert string) (*tls.Config, error)
NewTLSConfigWithPassword returns a *tls.Config using the given ceClient cert, ceClient key, and CA certificate. If clientKeyPassword is not empty the provided password will be used to decrypt the given key. If none are appropriate, a nil *tls.Config is returned.
func NormalizeString ¶
NormalizeString will replace all slashes, dots, colons and percent signs with dashes
func ParseGVKR ¶
func ParseGVKR(restMapper meta.RESTMapper, apiVersion string, kind string) (kedav1alpha1.GroupVersionKindResource, error)
ParseGVKR returns GroupVersionKindResource for specified apiVersion (groupVersion) and Kind
func ParseInt32List ¶ added in v2.9.0
func ParseRange ¶ added in v2.9.0
func ResolveOsEnvBool ¶ added in v2.9.0
func ResolveOsEnvDuration ¶ added in v2.8.0
Types ¶
type HTTPDoer ¶
HTTPDoer is an interface that matches the Do method on (net/http).Client. It should be used in function signatures instead of raw *http.Clients wherever possible
type K8sVersion ¶
K8sVersion holds parsed data from a K8s version
func NewK8sVersion ¶
func NewK8sVersion(version *version.Info) K8sVersion
NewK8sVersion will parse a version info and return a struct