Documentation
¶
Index ¶
- func AskForInput(prompt string, defaultVal string, isPassword bool) string
- func GetEpoch(t time.Time) float64
- func GetEpochNow() float64
- func In[T comparable](element T, set []T) bool
- func IsReachable(target url.URL) error
- func IsSubset[T comparable](subset, set []T) bool
- func ListOfVals[T any, PT any](source []T, accessor func(*T) PT) []PT
- func NewHTTPClient(timeout time.Duration, insecureSkipVerify bool, proxy string, ...) (*http.Client, error)
- func NewHTTPTransport(timeout time.Duration, retries int, backoff time.Duration, proxy string, ...) (http.RoundTripper, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskForInput ¶
askForInput promts the user to provide a value via StdIn if isPassword=true, no local echo to the console is provided if isPassword=false and the provided input is empty, the default value is returned instead
func GetEpochNow ¶
func GetEpochNow() float64
GetEpochNow returns an the current time as Epoch, expressed in seconds with a decimal part
func In ¶
func In[T comparable](element T, set []T) bool
In checks presence of 'elemet' within slice 'set'
func IsReachable ¶
IsReachable tries to connect to the target URL and returns an error if this is not possible
func IsSubset ¶
func IsSubset[T comparable](subset, set []T) bool
IsSubset returns true if the 'subset' array is completely contained in the 'set' array. There must be at least the same number of duplicate values in 'set' as there are in 'subset'.
func ListOfVals ¶
ListOfVals accesses a list of composite values 'source' of type T, applies the 'accessor' function to it to extract a value of type PT and retusn a list of the extracted values []PT. Elements of the resulting list are in the same order as found in the 'source' list Limitations: T must be an addressable type
func NewHTTPClient ¶
func NewHTTPClient(timeout time.Duration, insecureSkipVerify bool, proxy string, tlsCAcerts, tlsClientCert, tlsClientKey string) (*http.Client, error)
NewHTTPClient configures a new HTTP client which can be used to issue requests to external services
func NewHTTPTransport ¶
func NewHTTPTransport(timeout time.Duration, retries int, backoff time.Duration, proxy string, insecureSkipVerify bool, tlsCAcerts, tlsClientCert, tlsClientKey string) (http.RoundTripper, error)
NewHTTPCNewHTTPTransport configures a new HTTP transport with the provided settings. The transport can be used to instantiate a http client
Types ¶
This section is empty.