{"modulePath":"github.com/foolusion/kubernetes","version":"v1.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package node\n\nPackage node contains code for syncing cloud instances with node registry\n\n## Variables\n\n```go\nvar (\n\tErrCloudInstance = errors.New(\"cloud provider doesn't support instances.\")\n)\n```\n\n## Types\n\n```go\ntype ActionFunc func(TimedValue) (bool, time.Duration)\n```\nActionFunc takes a timed value and returns false if the item must be retried, with an optional time.Duration if some minimum wait interval should be used.\n\n```go\ntype NodeController struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewNodeController(\n\tcloud cloudprovider.Interface,\n\tkubeClient clientset.Interface,\n\tpodEvictionTimeout time.Duration,\n\tdeletionEvictionLimiter util.RateLimiter,\n\tterminationEvictionLimiter util.RateLimiter,\n\tnodeMonitorGracePeriod time.Duration,\n\tnodeStartupGracePeriod time.Duration,\n\tnodeMonitorPeriod time.Duration,\n\tclusterCIDR *net.IPNet,\n\tallocateNodeCIDRs bool) *NodeController\n```\nNewNodeController returns a new node controller to sync instances from cloudprovider.\n\n```go\nfunc (nc *NodeController) Run(period time.Duration)\n```\nRun starts an asynchronous loop that monitors the status of cluster nodes.\n\n```go\ntype RateLimitedTimedQueue struct {\n\t// contains filtered or unexported fields\n}\n```\nRateLimitedTimedQueue is a unique item priority queue ordered by the expected next time of execution. It is also rate limited.\n\n```go\nfunc NewRateLimitedTimedQueue(limiter util.RateLimiter) *RateLimitedTimedQueue\n```\nCreates new queue which will use given RateLimiter to oversee execution.\n\n```go\nfunc (q *RateLimitedTimedQueue) Add(value string) bool\n```\nAdds value to the queue to be processed. Won't add the same value a second time if it was already added and not removed.\n\n```go\nfunc (q *RateLimitedTimedQueue) Remove(value string) bool\n```\nRemoves Node from the Evictor. The Node won't be processed until added again.\n\n```go\nfunc (q *RateLimitedTimedQueue) Try(fn ActionFunc)\n```\nTry processes the queue. Ends prematurely if RateLimiter forbids an action and leak is true. Otherwise, requeues the item to be processed. Each value is processed once if fn returns true, otherwise it is added back to the queue. The returned remaining is used to identify the minimum time to execute the next item in the queue.\n\n```go\ntype TimedQueue []*TimedValue\n```\nTimedQueue is a priority heap where the lowest ProcessAt is at the front of the queue\n\n```go\nfunc (h TimedQueue) Len() int\n```\n\n```go\nfunc (h TimedQueue) Less(i, j int) bool\n```\n\n```go\nfunc (h *TimedQueue) Pop() interface{}\n```\n\n```go\nfunc (h *TimedQueue) Push(x interface{})\n```\n\n```go\nfunc (h TimedQueue) Swap(i, j int)\n```\n\n```go\ntype TimedValue struct {\n\tValue     string\n\tAddedAt   time.Time\n\tProcessAt time.Time\n}\n```\nTimedValue is a value that should be processed at a designated time.\n\n```go\ntype UniqueQueue struct {\n\t// contains filtered or unexported fields\n}\n```\nA FIFO queue which additionally guarantees that any element can be added only once until it is removed.\n\n```go\nfunc (q *UniqueQueue) Add(value TimedValue) bool\n```\nAdds a new value to the queue if it wasn't added before, or was explicitly removed by the Remove call. Returns true if new value was added.\n\n```go\nfunc (q *UniqueQueue) Get() (TimedValue, bool)\n```\nReturns the oldest added value that wasn't returned yet.\n\n```go\nfunc (q *UniqueQueue) Head() (TimedValue, bool)\n```\nHead returns the oldest added value that wasn't returned yet without removing it.\n\n```go\nfunc (q *UniqueQueue) Remove(value string) bool\n```\nRemoves the value from the queue, so Get() call won't return it, and allow subsequent addition of the given value. If the value is not present does nothing and returns false.\n\n```go\nfunc (q *UniqueQueue) Replace(value TimedValue) bool\n```\nReplace replaces an existing value in the queue if it already exists, otherwise it does nothing. Returns true if the item was found.\n\n","path":"github.com/foolusion/kubernetes/pkg/controller/node","name":"node","synopsis":"Package node contains code for syncing cloud instances with node registry","isRedistributable":true}
