env

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2019 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//
	OpenPluginError = xrr.Xrror("Unable to open plugin at %s:\n\t for %s").Out
	//
	DoesntExistError = xrr.Xrror("Plugin at %s has no %s.").Out
)

Functions

func NewPlugins

func NewPlugins(dirs ...string) (*loaders, error)

Provides a new, multiple directory handling Loader.

Types

type Applicator

type Applicator interface {
	Apply([]string, *data.Vector, ...feature.MapFn) error
	ApplyFor(int, []string, *data.Vector, ...feature.MapFn) error
}

type Config

type Config interface {
	Order() int
	Configure(*env) error
}

An interface providing Order & Configure functions.

func DefaultConfig

func DefaultConfig(fn ConfigFn) Config

Returns a default Config with order of 50 and the provided ConfigFn.

func NewConfig

func NewConfig(order int, fn ConfigFn) Config

Returns a Config with the provided order and ConfigFn.

func SetConstructorPlugin

func SetConstructorPlugin(dirs ...string) Config

func SetConstructors

func SetConstructors(cs ...feature.Constructor) Config

func SetFeaturePlugin

func SetFeaturePlugin(groups []string, dirs ...string) Config

func SetPopulateFeature

func SetPopulateFeature(groups []string, p []byte) Config

type ConfigFn

type ConfigFn func(*env) error

A function taking *env and returning an error.

type Configuration

type Configuration interface {
	Add(...Config)
	AddFn(...ConfigFn)
	Configure() error
	Configured() bool
}

An interface providing facility for multiple configuration options.

type Env

func Empty

func Empty() Env

func New

func New(cnf ...Config) (Env, error)

type Loader

type Loader interface {
	AddDirs(...string) error
	ListPlugin() (map[string][]string, error)
	LoadConstructor() ([]feature.Constructor, error)
	LoadFeature() ([]feature.Feature, error)
}

An interface for plugin loading.

type Populator

type Populator interface {
	Populate([]byte) error
	PopulateConstructorPlugin(...string) error
	PopulateFeaturePlugin([]string, ...string) error
	PopulateFeatureYaml([]string, ...string) error
	PopulateFeatureGroupString([]string, ...string) error
	PopulateComponentYaml([]string, ...string) error
	PopulateEntityYaml([]string, ...string) error
}

Jump to

Keyboard shortcuts

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