engine

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: BSD-3-Clause Imports: 23 Imported by: 0

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

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

func GetFlogoAppConfigPath() string

GetFlogoAppConfigPath returns the flogo config path

func GetFlogoEngineConfigPath

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

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

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