depends

package
v0.4.2-0...-ae8ecb7 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2017 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(key string, interfaceSpec types.InterfaceSpec, f ParseDependsFunc)

Register registers a helper for parsing for dependencies based on a key (e.g. 'group') and interface spec (Group/1.0)

Types

type ParseDependsFunc

type ParseDependsFunc func(types.Spec) (Runnables, error)

ParseDependsFunc returns a list of dependencies of this spec.

type Runnable

type Runnable interface {
	core.Addressable
	// Options returns the options needed to start the plugin
	Options() *types.Any
	// Dependents return all the plugins this runnable depends on
	Dependents() (Runnables, error)
}

Runnable models an addressable object that can also be started.

func AsRunnable

func AsRunnable(spec types.Spec) Runnable

AsRunnable returns the Runnable from a spec.

func RunnableFrom

func RunnableFrom(name plugin.Name) Runnable

RunnableFrom creates a runnable from input name. This is a simplification for cases where only a plugin name is used to reference another plugin.

type Runnables

type Runnables []Runnable

Runnables represent a collection of Runnables

func Resolve

func Resolve(spec types.Spec, key string, interfaceSpec *types.InterfaceSpec) (Runnables, error)

Resolve returns the dependencies listed in the spec as well as inside the properties. InterfaceSpec is optional. If nil, the first match by key (kind) is used. If nothing is registered, returns nil and no error. Error is returned for exceptions (eg. parsing, etc.)

func RunnablesFrom

func RunnablesFrom(specs []types.Spec) (Runnables, error)

RunnablesFrom returns the Runnables from given slice of specs

Jump to

Keyboard shortcuts

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