library

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2014 License: MIT Imports: 4 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NotFound = errors.New("Component not found")
)

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Name        string      `json:"name"`
	Description string      `json:"description"`
	Executable  string      `json:"exec"`
	Elementary  bool        `json:"elementary"`
	Inports     []EntryPort `json:"inports"`
	Outports    []EntryPort `json:"outports"`
}

Registry's entry

func (*Entry) FindInport

func (entry *Entry) FindInport(name string) (EntryPort, bool)

func (*Entry) FindOutport

func (entry *Entry) FindOutport(name string) (EntryPort, bool)

func (Entry) JSON

func (self Entry) JSON() ([]byte, error)

A shortcut for JSON serialization

type EntryPort

type EntryPort struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`
	Required    bool   `json:"required"`
	Addressable bool   `json:"addressable"`
}

Entry's port data

type JSONLibrary

type JSONLibrary struct {
	Name    string           `json:"name"`
	Entries map[string]Entry `json:"entries"`
	Created time.Time        `json:"created"`
	Updated time.Time        `json:"updated"`
}

JSON library implements Registrar interface

func (JSONLibrary) Add

func (self JSONLibrary) Add(entry Entry)

func (JSONLibrary) Exists

func (self JSONLibrary) Exists(name string) bool

func (JSONLibrary) Find

func (self JSONLibrary) Find(term string) map[string]Entry

func (JSONLibrary) Get

func (self JSONLibrary) Get(name string) (Entry, error)

func (JSONLibrary) JSON

func (self JSONLibrary) JSON() ([]byte, error)

A shortcut to JSON serialization

func (JSONLibrary) List

func (self JSONLibrary) List() map[string]Entry

type Registrar

type Registrar interface {
	Add(entry Entry)
	Exists(name string) bool
	Get(name string) (Entry, error)
	Find(term string) map[string]Entry
	List() map[string]Entry
}

Defines the interface of components library

Jump to

Keyboard shortcuts

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