util

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2025 License: Apache-2.0 Imports: 13 Imported by: 12

Documentation

Overview

Copyright 2024 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAcceptedCiphers added in v0.0.26

func GetAcceptedCiphers() map[string]uint16

GetAcceptedCiphers returns all the ciphers supported by the crypto/tls package

func GetClientTLSConfig

func GetClientTLSConfig(caFile, certFile, keyFile, serverName string, protos []string) (*tls.Config, error)

GetClientTLSConfig returns tlsConfig based on x509 certs

func IsLeaseValid added in v0.31.0

func IsLeaseValid(pc clock.PassiveClock, lease coordinationv1api.Lease) bool

func Normalize

func Normalize(s string) string

Normalize replaces underscores with hyphens we should always use hyphens instead of underscores when registering component flags

func ParseLabels added in v0.31.1

func ParseLabels(labelStr string) (map[string]string, error)

ParseLabels takes a comma-separated string of key-value pairs and returns a map of labels.

func PrettyPrintURL added in v0.0.15

func PrettyPrintURL(urlEncode string) string

PrettyPrintURL decodes the URL encoded input string and print each key=val pair separated by comma

func RedirectTo added in v0.0.17

func RedirectTo(to string) func(http.ResponseWriter, *http.Request)

RedirectTo redirects request to a certain destination.

func RemovePortFromHost added in v0.0.15

func RemovePortFromHost(host string) string

RemovePortFromHost removes port number from the host address that may be of the form "<host>:<port>" where the <host> can be an either an IPv4/6 address or a domain name

Types

This section is empty.

Jump to

Keyboard shortcuts

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