charmdir

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package charmdir provides the manifold that coordinates the availability of a charm directory among workers. It provides two roles, a Locker who decides whether the charm directory is available, and a Consumer, which operates on an available charm directory.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotAvailable = errors.New("charmdir not available")

ErrNotAvailable indicates that the requested operation cannot be performed on the charm directory because it is not available.

Functions

func Manifold

func Manifold() dependency.Manifold

Manifold returns a dependency.Manifold that coordinates availability of a charm directory.

Types

type Consumer

type Consumer interface {
	// Run performs the given function if the charm directory is available. It
	// returns whether the charm directory was available to execute the function,
	// and any error returned by that function.
	Run(func() error) error
}

Consumer is used by workers that want to perform tasks on the condition that the charm directory is available.

type Locker

type Locker interface {
	// SetAvailable sets the availability of the charm directory for clients to
	// access.
	SetAvailable(bool)
}

Locker controls whether the charmdir is available or not.

Jump to

Keyboard shortcuts

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