Documentation
¶
Index ¶
- func AskForInput(prompt string, defaultVal string, isPassword bool) string
- func GetEpoch(t time.Time) float64
- func GetEpochNow() float64
- func IsReachable(target url.URL) error
- func NewErrInvalidParam(context string, err error, msg string, a ...interface{}) error
- 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)
- type ErrInvalidParam
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 IsReachable ¶
IsReachable tries to connect to the target URL and returns an error if this is not possible
func NewErrInvalidParam ¶ added in v1.7.0
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 ¶ added in v1.6.0
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 ¶
type ErrInvalidParam ¶ added in v1.7.0
type ErrInvalidParam struct { Context string // function where error happened Msg string // details message Err error // wrapped error }
func (*ErrInvalidParam) Error ¶ added in v1.7.0
func (e *ErrInvalidParam) Error() string
func (*ErrInvalidParam) Unwrap ¶ added in v1.7.0
func (e *ErrInvalidParam) Unwrap() error
Unwrap https://github.com/golang/go/blob/release-branch.go1.17/src/errors/wrap.go
Click to show internal directories.
Click to hide internal directories.