controller

package
v0.0.0-...-5e3b14e Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func New

func New(drainer Drainer, requests chan Request, cooldown time.Duration) *Controller

func (*Controller) Drain

func (c *Controller) Drain(request Request)

func (*Controller) Reconcile

func (c *Controller) Reconcile(ctx context.Context) error

func (*Controller) RegisterMetrics

func (c *Controller) RegisterMetrics(r *prometheus.Registry)

type Drainer

type Drainer interface {
	Drain(string) (int, error)
}

type Queue

type Queue struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue(gauge prometheus.Gauge) *Queue

func (*Queue) Add

func (q *Queue) Add(r Request)

Add inserts the specified element into this queue.

func (*Queue) Poll

func (q *Queue) Poll() *Request

Poll retrieves, but does not remove, the head of this queue, or returns null if this queue is empty.

type Request

type Request struct {
	NodeName string
	Fastpath bool
	OnDone   func()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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