engine

package
v1.3.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: BSD-3-Clause Imports: 23 Imported by: 67

Documentation

Index

Constants

View Source
const (
	EnvKeyAppConfigLocation     = "FLOGO_CONFIG_PATH"
	DefaultAppConfigLocation    = "flogo.json"
	EnvKeyEngineConfigLocation  = "FLOGO_ENG_CONFIG_PATH"
	DefaultEngineConfigLocation = "engine.json"

	EnvKeyStopEngineOnError  = "FLOGO_ENGINE_STOP_ON_ERROR"
	DefaultStopEngineOnError = true
	EnvKeyRunnerType         = "FLOGO_RUNNER_TYPE"
	DefaultRunnerType        = ValueRunnerTypePooled
	EnvKeyRunnerWorkers      = "FLOGO_RUNNER_WORKERS"
	DefaultRunnerWorkers     = 5

	//Deprecated
	EnvKeyRunnerQueueSizeLegacy = "FLOGO_RUNNER_QUEUE"

	EnvKeyRunnerQueueSize  = "FLOGO_RUNNER_QUEUE_SIZE"
	DefaultRunnerQueueSize = 50

	EnvAppPropertyResolvers   = "FLOGO_APP_PROP_RESOLVERS"
	EnvEnableSchemaSupport    = "FLOGO_SCHEMA_SUPPORT"
	EnvEnableSchemaValidation = "FLOGO_SCHEMA_VALIDATION"

	ValueRunnerTypePooled = "POOLED"
	ValueRunnerTypeDirect = "DIRECT"
)

Variables

This section is empty.

Functions

func ConfigOption added in v0.9.4

func ConfigOption(engineJson string, compressed bool) func(*engineImpl) error

func ConfigViaEnv

func ConfigViaEnv(e *engineImpl)

func DirectRunner

func DirectRunner(e *engineImpl) error

func EnvPropertyProcessor

func EnvPropertyProcessor(properties map[string]interface{}) error

func GetAppName

func GetAppName() string

Returns name of the application

func GetAppPropertyValueResolvers

func GetAppPropertyValueResolvers(logger log.Logger) string

func GetAppVersion

func GetAppVersion() string

Returns version of the application

func GetFlogoAppConfigPath added in v0.9.4

func GetFlogoAppConfigPath() string

GetFlogoAppConfigPath returns the flogo config path

func GetFlogoEngineConfigPath added in v0.9.4

func GetFlogoEngineConfigPath() string

GetFlogoEngineConfigPath returns the flogo engine config path

func GetRunnerQueueSize

func GetRunnerQueueSize() int

GetRunnerQueueSize returns the runner queue size

func GetRunnerType

func GetRunnerType() string

GetRunnerType returns the runner type

func GetRunnerWorkers

func GetRunnerWorkers() int

GetRunnerWorkers returns the number of workers to use

func IsSchemaSupportEnabled

func IsSchemaSupportEnabled() bool

func IsSchemaValidationEnabled

func IsSchemaValidationEnabled() bool

func LifeCycle

func LifeCycle(managedEntity managed.Managed)

func LoadAppConfig

func LoadAppConfig(flogoJson string, compressed bool) (*app.Config, error)

func NewPooledRunnerConfig

func NewPooledRunnerConfig() *runner.PooledConfig

NewPooledRunnerConfig creates a new Pooled config, looks for environment variables to override default values

func RunEngine

func RunEngine(e Engine) int

func StopEngineOnError

func StopEngineOnError() bool

Types

type Config

type Config struct {
	Name        string `json:"name"`
	Type        string `json:"type"`
	Description string `json:"description"`

	StopEngineOnError bool   `json:"stopEngineOnError,omitempty"`
	RunnerType        string `json:"runnerType,omitempty"`

	Imports        []string                          `json:"imports,omitempty"`
	ActionSettings map[string]map[string]interface{} `json:"actionSettings,omitempty"`
	Services       []*ServiceConfig                  `json:"services,omitempty"`
}

Config is the configuration for the Engine, assumes all necessary imports have been add to go code

func LoadEngineConfig added in v0.9.4

func LoadEngineConfig(engineJson string, compressed bool) (*Config, error)

type Engine

type Engine interface {
	//App get the application associated with this engine
	App() *app.App

	// Start starts the engine
	Start() error

	// Stop stop the engine
	Stop() error
}

Interface for the engine behaviour

func New

func New(appConfig *app.Config, options ...Option) (Engine, error)

New creates a new Engine

type Option

type Option func(*engineImpl) error

type ServiceConfig added in v0.9.4

type ServiceConfig struct {
	Ref      string
	Enabled  bool
	Settings map[string]interface{}
}

ServiceConfig is the configuration for Engine Services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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