ifacestate

package
v0.0.0-...-41dd8df Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2016 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package ifacestate implements the manager and state aspects responsible for the maintenance of interfaces the system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(s *state.State, plugSnap, plugName, slotSnap, slotName string) (*state.TaskSet, error)

Connect returns a set of tasks for connecting an interface.

func Disconnect

func Disconnect(s *state.State, plugSnap, plugName, slotSnap, slotName string) (*state.TaskSet, error)

Disconnect returns a set of tasks for disconnecting an interface.

func MockSecurityBackends

func MockSecurityBackends(backends []interfaces.SecurityBackend) func()

MockSecurityBackends mocks the list of security backends that are used for setting up security.

This function is public because it is referenced in the daemon

Types

type InterfaceManager

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

InterfaceManager is responsible for the maintenance of interfaces in the system state. It maintains interface connections, and also observes installed snaps to track the current set of available plugs and slots.

func Manager

func Manager(s *state.State, extra []interfaces.Interface) (*InterfaceManager, error)

Manager returns a new InterfaceManager. Extra interfaces can be provided for testing.

func (*InterfaceManager) Ensure

func (m *InterfaceManager) Ensure() error

Ensure implements StateManager.Ensure.

func (*InterfaceManager) Repository

func (m *InterfaceManager) Repository() *interfaces.Repository

Repository returns the interface repository used internally by the manager.

This method has two use-cases: - it is needed for setting up state in daemon tests - it is needed to return the set of known interfaces in the daemon api

In the second case it is only informational and repository has internal locks to ensure consistency.

func (*InterfaceManager) Stop

func (m *InterfaceManager) Stop()

Stop implements StateManager.Stop.

func (*InterfaceManager) Wait

func (m *InterfaceManager) Wait()

Wait implements StateManager.Wait.

Jump to

Keyboard shortcuts

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