juju: github.com/juju/juju/worker/diskmanager Index | Files

package diskmanager

import "github.com/juju/juju/worker/diskmanager"

Package diskmanager defines a worker that periodically lists block devices on the machine it runs on. This worker will be run on all Juju-managed machines (one per machine agent).

Index

Package Files

diskmanager.go doc.go lsblk.go manifold.go

Variables

var NewWorker = func(l ListBlockDevicesFunc, b BlockDeviceSetter) worker.Worker {
    var old []storage.BlockDevice
    f := func(stop <-chan struct{}) error {
        return doWork(l, b, &old)
    }
    return jworker.NewPeriodicWorker(f, listBlockDevicesPeriod, jworker.NewTimer)
}

NewWorker returns a worker that lists block devices attached to the machine, and records them in state.

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs a diskmanager worker, using the resource names defined in the supplied config.

type BlockDeviceSetter Uses

type BlockDeviceSetter interface {
    SetMachineBlockDevices([]storage.BlockDevice) error
}

BlockDeviceSetter is an interface that is supplied to NewWorker for setting block devices for the local host.

type ListBlockDevicesFunc Uses

type ListBlockDevicesFunc func() ([]storage.BlockDevice, error)

ListBlockDevicesFunc is the type of a function that is supplied to NewWorker for listing block devices available on the local host.

var DefaultListBlockDevices ListBlockDevicesFunc

DefaultListBlockDevices is the default function for listing block devices for the operating system of the local host.

type ManifoldConfig Uses

type ManifoldConfig engine.AgentAPIManifoldConfig

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.

Package diskmanager imports 23 packages (graph) and is imported by 35 packages. Updated 2019-10-19. Refresh now. Tools for package owners.