utils

package
v0.0.0-...-9ea1053 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateClusterClient

func CreateClusterClient(host string, token string, caCert string) (*kubernetes.Clientset, error)

CreateClusterClient creates a new client for the cluster

Types

type TaskQueue

type TaskQueue struct {
	Name string
	// contains filtered or unexported fields
}

TaskQueue manages a work queue through an independent worker that invokes the given sync function for every work item inserted.

func NewTaskQueue

func NewTaskQueue(name string, keyFunc func(obj interface{}) (string, error), syncFn func(string) error) *TaskQueue

NewTaskQueue creates a new task queue with the given sync function. The sync function is called for every element inserted into the queue.

func (*TaskQueue) Enqueue

func (t *TaskQueue) Enqueue(obj interface{})

Enqueue enqueues ns/name of the given api object in the task queue.

func (*TaskQueue) Run

func (t *TaskQueue) Run()

func (*TaskQueue) Shutdown

func (t *TaskQueue) Shutdown()

Shutdown shuts down the work queue and waits for the worker to ACK

Jump to

Keyboard shortcuts

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