util

package
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package util provides functions used across command line binaries for setup/exection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChoosePolicy

func ChoosePolicy(logger logr.Logger, defaultPolicy string, policyFlag string, policyFile string) string

ChoosePolicy selects an OPA policy based on the flags, or calls log.Fatal if an invalid combination is provided.

func StripTimeout added in v1.23.3

func StripTimeout(s string) string

func ValidateAndAddPort added in v1.7.0

func ValidateAndAddPort(s string, port int) string

ValidateAndAddPort will take a given target address and optionally add a default port onto it if a port is missing. This will also take in account optional dial timeout suffix and make sure the returned value has that if it exists.

func ValidateAndAddPortAndTimeout added in v1.23.3

func ValidateAndAddPortAndTimeout(s string, port int, dialTimeout time.Duration) string

ValidateAndAddPortAndTimeout will take a given target address and optionally add a default port and timeout onto it if a port or a timeout is missing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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