client

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 13 Imported by: 1

Documentation

Overview

Package client implements a client to the apiserver to acquire locks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

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

Driver is the main force behind the lock module, it controls all methods and several variables.

func NewDriver

func NewDriver(master string) *Driver

NewDriver constructs a new driver.

func (*Driver) AddStopChan

func (d *Driver) AddStopChan(name string) chan struct{}

AddStopChan adds a stop channel to a map for heartbeat tracking purposes.

func (*Driver) HeartbeatMount

func (d *Driver) HeartbeatMount(ttl time.Duration, payload *config.UseMount, stop chan struct{})

HeartbeatMount reports a mount to a apiserver periodically. It loops endlessly, and is intended to run as a goroutine. Note the stop channel, AddStopChan and RemoveStopChan are used to manage these entities.

func (*Driver) RemoveStopChan

func (d *Driver) RemoveStopChan(name string)

RemoveStopChan removes a stop channel and mapping from the hearbeat tracker.

func (*Driver) ReportMount

func (d *Driver) ReportMount(ut *config.UseMount) error

ReportMount reports a new mount to the apiserver.

func (*Driver) ReportMountStatus

func (d *Driver) ReportMountStatus(ut *config.UseMount) error

ReportMountStatus refreshes the mount status (and lock, by axiom).

func (*Driver) ReportUnmount

func (d *Driver) ReportUnmount(ut *config.UseMount) error

ReportUnmount reports an unmount event to the apiserver, which frees locks.

Jump to

Keyboard shortcuts

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