Documentation ¶
Overview ¶
Package utils contains common shared code.
Package utils contains common shared code.
Package utils contains common shared code.
Index ¶
- func EnvFl64(envVar string, defaultVal float64) (val float64)
- func GetJSON(url string) (body []byte, err error)
- func InitWebSocket(apiAddress string) (ws *websocket.Conn, err error)
- func NewKubeClientset(kubeConfig string, namespace string) (*kubernetes.Clientset, error)
- func PutJSON(url string, payload *bytes.Buffer) (status int, err error)
- type Backoff
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitWebSocket ¶
InitWebSocket opens a websocket connection to the provided address.
func NewKubeClientset ¶
func NewKubeClientset(kubeConfig string, namespace string) (*kubernetes.Clientset, error)
NewKubeClientset creates a Kubernetes clientset for accessing the Kubernetes APIs. Uses the provided kube config file or when running as a pod uses the built in config.
Types ¶
type Backoff ¶
type Backoff struct { sync.RWMutex Factor int Min, Max time.Duration Timer *time.Timer // contains filtered or unexported fields }
Backoff holds the number of attempts as well as the min and max backoff delays.
func (*Backoff) Backoff ¶
Backoff calculates the duration and sets an appropriate timer. When it pops it will send on the channel.
func (*Backoff) Reset ¶
func (b *Backoff) Reset()
Reset clears the number of attempts once the API call has succeeded.
Click to show internal directories.
Click to hide internal directories.