Documentation ¶
Index ¶
- func CIDRSubnet(prefix string, newSize int, netNum int64) (string, error)
- func ExpandPath(p string) string
- func HashString(s string) (string, error)
- func IsIPv4CIDR(s string) bool
- func IsIPv4IP(s string) bool
- func IsIPv6CIDR(s string) bool
- func IsIPv6IP(s string) bool
- func ParseCIDRNotation(subnet string) (int, int64, error)
- func SanitizeString(s string) string
- func StringSlicesEqual(l, r []string) bool
- func StringSlicesEqualIgnoreOrder(l, r []string) bool
- func UngzipFile(gzipPath string, destPath string) error
- func YAMLToJSON(yamlBytes []byte) ([]byte, error)
- func YamlMarshal(o interface{}) ([]byte, error)
- func YamlUnmarshal(yamlBytes []byte, dest interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CIDRSubnet ¶ added in v1.21.3
CIDRSubnet calculates a subnet address within given IP network address prefix. Inspired by the Terraform implementation of the "cidrsubnet" function https://www.terraform.io/docs/language/functions/cidrsubnet.html
func ExpandPath ¶
ExpandPath replaces common path aliases: ~ -> $HOME
func HashString ¶ added in v1.15.1
HashString Takes String and returns a sha256 hash represented as a string
func IsIPv4CIDR ¶ added in v1.21.3
IsIPv4CIDR checks if a string is a valid IPv4 CIDR.
func IsIPv6CIDR ¶ added in v1.21.3
IsIPv6CIDR checks if a string is a valid IPv6 CIDR.
func ParseCIDRNotation ¶ added in v1.21.3
ParseCIDRNotation parses a string in the format "/<newSize>#<netNum>" and returns the values of <newSize> and <netNum>.
func SanitizeString ¶
SanitizeString iterated a strings, removes any characters not in the allow list and returns at most 200 characters
func StringSlicesEqual ¶
func UngzipFile ¶ added in v1.18.0
UngzipFile extracts a .gzip file
func YAMLToJSON ¶ added in v1.10.0
YAMLToJSON converts yaml to json
func YamlMarshal ¶
YamlMarshal tries to marshal the input struct into yaml content
func YamlUnmarshal ¶
YamlUnmarshal unmarshals the yaml content to an interface Note: if you are loading a kops.k8s.io API object, normally you want something like kopscodecs.Decode, so that we can convert between apiVersions.
Types ¶
This section is empty.