node

package
v0.0.0-...-d5b0b58 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2014 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Node

type Node struct {
	Name string // Unique identifier and node fqdn
	Role string // Role this node is assigned to
}

func NewNode

func NewNode(name string, role string) (*Node, error)

NewNode creates a new node given a name and role, neither can be empty.

type NodeManager

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

NodeManager manages a list of nodes in memory.

func NewNodeManager

func NewNodeManager(p string) *NodeManager

NewNodeManager returns an empty NodeManager.

func (*NodeManager) All

func (m *NodeManager) All() []*Node

All returns the list of all the Nodes in the NodeManager.

func (*NodeManager) Find

func (m *NodeManager) Find(Name string) (*Node, bool)

Find returns the Node with the given name in the NodeManager and a boolean indicating if the id was found.

func (*NodeManager) Save

func (m *NodeManager) Save(node *Node) error

Save saves the given Node in the NodeManager.

Jump to

Keyboard shortcuts

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