Documentation ¶
Index ¶
- Constants
- func NilCommandCallback(App, IOContext) (err error)
- type App
- type AppFilespaces
- type AppHealthCheckers
- type AppScopes
- type Bootstrap
- type Broadcast
- type BufferedBroadcast
- type Callback
- type CommandCallback
- type ContextScope
- type DataScope
- type DataScopeLocker
- type DependencyProvider
- type ErrorScope
- type EventCallback
- type EventScope
- type Factory
- type Form
- type HealthCheckerCallback
- type IO
- type IOContext
- type Injector
- type Input
- type Module
- type Output
- type Scope
- type Terminal
- type TerminalArgument
- type TerminalArguments
- type TerminalCommand
- type TerminalCommands
- type TerminalManager
- type TypeConverter
- type Version
Constants ¶
const ( // KillEvent is an kill event (for scope etc) KillEvent = iota // StopEvent is a stop event (for scope etc) StopEvent = iota // ErrorEvent is an error event (for scope etc) ErrorEvent = iota // BeforeCommitEvent is an event trigger befor commit action (for scope etc) BeforeCommitEvent = iota // CommitEvent is an event trigger commit action (for scope etc) CommitEvent = iota // AfterCommitEvent is an event trigger after commit action (for scope etc) AfterCommitEvent = iota // BeforeCommitEvent is an event trigger befor rollback action (for scope etc) BeforeRollbackEvent = iota // RollbackEvent is an event trigger rollback action (for scope etc) RollbackEvent = iota // BeforeCommitEvent is an event trigger befor rollback action (for scope etc) AfterRollbackEvent = iota // BeforeCommitEvent is an event trigger befor close action (for aplication/scope etc) BeforeCloseEvent = iota // BeforeCommitEvent is an event trigger after close action (for aplication/scope etc) AfterCloseEvent = iota // Error is key for error value Error = "error" // CLI is cli dependency name for engine scope CLI = "cli" // AppName is key to get application name (from app scope) AppName = "AppName" // AppVersion is key to get application version (from app scope) AppVersion = "AppVersion" // AppWelcome is key to get welcome message (from app scope) AppWelcome = "AppWelcome" // AppCompany is key to get owner company name (from app scope) AppCompany = "AppCompany" // GoatVersionValue represent goat app engine version GoatVersionValue = "0.0.0dx" // GoatVersion is key to get goat version GoatVersion = "GoatVersion" // EngineTagName is a name for app vars / const injection EngineTagName = "engine" // ArgsTagName is a name for argument injection ArgsTagName = "argument" // FilespaceTagName is a name for filepsace injection FilespaceTagName = "filespace" // ConfigTagName is a name for config injection ConfigTagName = "config" // DependencyTagName is a name for dependency injection DependencyTagName = "dependency" // AppTagName is a name for application data injection AppTagName = "app" // CommandTagName is a name for command injection CommandTagName = "command" // EngineScope is an engine scope EngineScope = "EngineScope" // ArgsScope is an arguments scope ArgsScope = "ArgScope" // FilespaceScope is a filespace scope FilespaceScope = "FilespaceScope" // ConfigScope is a config scope ConfigScope = "ConfigScope" // DependencyScope is a config scope DependencyScope = "DependencyScope" // AppScope is a application scope AppScope = "AppScope" // CommandScope is a command scope CommandScope = "CommandScope" // GlobalScope is a scope for global events and data GlobalScope = "GlobalScope" // AppService is a default application service AppService = "App" // InputService is a default input service InputService = "InputService" // OutputService is a default output service OutputService = "OutputService" // ErrorService is a default error service ErrorService = "ErrorService" //RootFilespace is key for root filesystem.Filespace RootFilespace = "root" //TmpFilespace is key for tmp filespace TmpFilespace = "tmp" //HomeFilespace is key for home filespace HomeFilespace = "home" //CurrentFilespace is key for CWD (Current Working Directory) filespace CurrentFilespace = "current" // DefaultDurationValue is a default value for undefined env, configs etc DefaultDurationValue = 0 // DefaultBoolValue is a default value for undefined env, configs etc DefaultBoolValue = false // DefaultStringValue is a default value for undefined env, configs etc DefaultStringValue = "" // DefaultFloat64Value is a default value for undefined env, configs etc DefaultFloat64Value = 0 // DefaultIntValue is a default value for undefined env, configs etc DefaultIntValue = 0 // DefaultInt64Value is a default value for undefined env, configs etc DefaultInt64Value = 0 // DefaultUIntValue is a default value for undefined env, configs etc DefaultUIntValue = 0 // DefaultUInt64Value is a default value for undefined env, configs etc DefaultUInt64Value = 0 // ENVArg is name default environment application argument ENVArg = "env" // DefaultEnv is name of default system environment DefaultEnv = "prod" )
const ( TerminalUndefinedArgument = 0 TerminalBoolArgument = 1 TerminalEmailArgument = iota TerminalFloatArgument = iota TerminalIntArgument = iota TerminalOtherArgument = iota TerminalPathArgument = iota TerminalPIPArgument = iota TerminalTextArgument = iota TerminalURLArgument = iota )
const ( // DefaultDeadline is default dedline for application, scopes and lifecycles (it is 3 years) // It is maximum time we declared the application can work correctly DefaultDeadline = time.Hour * 24 * 365 * 3 )
Variables ¶
This section is empty.
Functions ¶
func NilCommandCallback ¶
Types ¶
type App ¶
type App interface { Injector AppHealthCheckers Arguments() []string DependencyProvider() DependencyProvider Filespaces() AppFilespaces IOContext() IOContext Name() string Scopes() AppScopes Terminal() TerminalManager Version() Version }
App represent a app
type AppFilespaces ¶
type AppFilespaces interface { CWD() filesystem.Filespace Home() filesystem.Filespace Root() filesystem.Filespace Tmp() filesystem.Filespace }
type AppHealthCheckers ¶
type AppHealthCheckers interface { // HealthCheckerNames return HealthChecker's names HealthCheckerNames() []string // HealthChecker return an HealthChecker by name HealthChecker(name string) HealthCheckerCallback // SetHealthChecker set new health hecker. Panic if healthecker name is duplicated SetHealthChecker(name string, cb HealthCheckerCallback) (err error) }
AppHealthCheckers check application helth
type BufferedBroadcast ¶
BufferedBroadcast buffer and write data to each added writer data
type CommandCallback ¶
CommandCallback is function call to run user command
type ContextScope ¶
type ContextScope interface { ErrorScope // Deadline returns the time when work done on behalf of this context // should be canceled. Deadline returns ok==false when no deadline is // set. Successive calls to Deadline return the same results. Deadline() (deadline time.Time, ok bool) // Done is close when the scope context is done (kill or stop) Done() <-chan struct{} // IsDone check if the scope context is done (kill or stop) IsDone() bool // Kill stop the scope context with error Kill() // Stop stop the scope context without error Stop() }
ContextScope provide sync interface
type DataScope ¶
type DataScope interface { // SetValue set the value associated with this context for key SetValue(key interface{}, value interface{}) // Value returns the value associated with this context for key, or nil Value(key interface{}) interface{} // Keys return a keys to all scope values Keys() []interface{} // LockData lock the data scope and return new DataScopeLocker LockData() (transaction DataScopeLocker) }
DataScope provide data provider
type DataScopeLocker ¶
type DataScopeLocker interface { DataScope // Commit save a data and unlock the data scope Commit() (err error) }
DataScopeLocker provide data scope commitable interface
type DependencyProvider ¶
type DependencyProvider interface { Injector AddInjectors([]Injector) error Get(string) (interface{}, error) Set(string, interface{}) error Keys() ([]string, error) SetDefault(string, interface{}) error AddFactory(string, Factory) error AddDefaultFactory(string, Factory) error }
Provider distribute dependencies
type ErrorScope ¶
type ErrorScope interface { // Errors return the scope errors as an array Errors() []error // Err return cumulative error if the scope context contains any error Err() error // AppendError add an error to the scope AppendError(err ...error) }
ErrorScope provide error interface
type EventCallback ¶
type EventCallback func(interface{}) error
EventCallback is a callback function with data
type EventScope ¶
type EventScope interface { // Trigger an event Trigger(id interface{}, data interface{}) error // On add an event listener On(id interface{}, callback EventCallback) }
EventScope provide event interface
type Factory ¶
type Factory func(DependencyProvider) (interface{}, error)
Factory represent a builder of a dependency instance
type Form ¶
type Form interface { Valid() (messages.MessageMap, error) Data() interface{} }
Form represent a form data
type HealthCheckerCallback ¶
HealthCheckerCallback is function to check application health
type IO ¶
type IO interface { In() Input Out() Output Err() Output CWD() filesystem.Filespace }
IO represent a standard input/output
type Injector ¶
type Injector interface {
InjectTo(obj interface{}) error
}
Injector inject data/dependencies to object
type Module ¶
type Module interface { InitDependencies(App) error RegisterDependencies(App) error Run(App) error }
Module represent a app module
type Scope ¶
type Scope interface { DataScope EventScope ContextScope Injector // CID return correlation id CID() string // SID return scope id SID() string // AddTasks add a tasks and return an error if too many gorutines AddTasks(delta int) (err error) // Close the scope. Wait to finish and mark scope as done. Close() (err error) // DoneTask mark single task as done DoneTask() // Wait until the scope context is done and return error Wait() error // BaseContextScope return unwrap ContextScope object (help better utilize/recycle objects) BaseContextScope() ContextScope // BaseDataScope return unwrap DataScope object (help better utilize/recycle objects) BaseDataScope() DataScope // BaseEventScope return unwrap EventScope object (help better utilize/recycle objects) BaseEventScope() EventScope // BaseInjector return unwrap dependency injector object (help better utilize/recycle objects) BaseInjector() Injector // GoContext convert scope to a golang context (context.Context) GoContext() context.Context }
Scope is global scope interface
type Terminal ¶
type Terminal interface { TerminalArguments TerminalCommands }
Terminal is interface represent terminal definition
type TerminalArgument ¶
type TerminalArgument interface { TerminalCommands Name() string Help() string Required() bool Type() byte }
TerminalArgument is an argument read-only interface
type TerminalArguments ¶
type TerminalArguments interface { ArgumentNames() []string Argument(name string) TerminalArgument }
ArgumentReader is interface provided arguments set
type TerminalCommand ¶
type TerminalCommand interface { TerminalArguments Callback() CommandCallback Help() string MainArguments() []string Name() string }
TerminalCommand is a command read-only interface
type TerminalCommands ¶
type TerminalCommands interface { CommandNames() []string Command(name string) TerminalCommand }
TerminalCommands is interface provided commands reader
type TerminalManager ¶
type TerminalManager interface { Terminal SetArgument(arg ...TerminalArgument) SetCommand(command ...TerminalCommand) }
TerminalManager is interface represent terminal definition
type TypeConverter ¶
type TypeConverter func(interface{}) (interface{}, error)
TypeConverter convert from type to other (string->int etc)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
modules
|
|
ocm
Package ocm provide Open Container middleware Open Container Initiative The Open Container Initiative is an open governance structure for the express purpose of creating open industry standards around container formats and runtimes.
|
Package ocm provide Open Container middleware Open Container Initiative The Open Container Initiative is an open governance structure for the express purpose of creating open industry standards around container formats and runtimes. |