Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultFSPathRegister(fs assetfsapi.PathRegistrator, pth string) error
- func InitPluginFS(pls PluginFSInterface)
- func InitPluginI18nFS(pls I18nPluginsInterface)
- func IsInitializador(v interface{}) bool
- func IsOptionsProvider(v interface{}) bool
- func OnFS(p EventDispatcherInterface, cb func(e *FSEvent))
- func OnInit(dis EventDispatcherInterface, callbacks ...interface{}) error
- func OnLocaleFS(p EventDispatcherInterface, cb func(e *LocaleFSEvent))
- func OnPostInit(dis EventDispatcherInterface, callbacks ...interface{}) error
- func UID(v interface{}) string
- func UIDs(vs ...interface{}) []string
- type Accessible
- type CallbackFunc
- type CallbackFuncE
- type Event
- type EventDispatcher
- type EventDispatcherInterface
- type EventInterface
- type Extension
- type FSEvent
- type FSSetter
- type GlobalOptions
- type GlobalOptionsInterface
- type I18nPlugins
- type I18nPluginsInterface
- type LocaleFSEvent
- type LogSetter
- type Logged
- type LoggedInterface
- type LoggerSetter
- type NamedPlugin
- type OptionProvider
- type OptionProviderE
- type Options
- type Parent
- type Plugin
- type PluginAccess
- type PluginAfterI
- type PluginAfterUID
- type PluginAssetFSSetter
- type PluginAssetsRootPath
- type PluginBeforeI
- type PluginBeforeUID
- type PluginCallbackFunc
- type PluginCallbackFuncE
- type PluginEvent
- func (pe *PluginEvent) Options() *Options
- func (pe *PluginEvent) Plugin() *Plugin
- func (pe *PluginEvent) PluginDispatcher() PluginEventDispatcherInterface
- func (pe *PluginEvent) SetOptions(o *Options)
- func (pe *PluginEvent) SetPlugin(p *Plugin)
- func (pe *PluginEvent) WithPluginDispatcher(dis PluginEventDispatcherInterface) func()
- type PluginEventCallback
- type PluginEventCallbackE
- type PluginEventCallbackInterface
- type PluginEventDispatcher
- func (ped *PluginEventDispatcher) EachPlugins(items []*Plugin, cb func(plugin *Plugin) (err error)) (err error)
- func (ped *PluginEventDispatcher) EachPluginsCallback(items []*Plugin, callbacks ...func(plugin *Plugin) error) (err error)
- func (ped *PluginEventDispatcher) GetPlugins() []*Plugin
- func (ped *PluginEventDispatcher) OnPlugin(eventName string, callbacks ...interface{})
- func (ped *PluginEventDispatcher) OnPluginE(eventName string, callbacks ...interface{}) (err error)
- func (ped *PluginEventDispatcher) Options() *Options
- func (ped *PluginEventDispatcher) PluginDispatcher() PluginEventDispatcherInterface
- func (ped *PluginEventDispatcher) SetDispatcher(dis EventDispatcherInterface)
- func (ped *PluginEventDispatcher) SetOptions(options *Options)
- func (ped *PluginEventDispatcher) TriggerPlugins(e EventInterface, plugins ...*Plugin) (err error)
- type PluginEventDispatcherInterface
- type PluginEventInterface
- type PluginFSInterface
- type PluginFSNameSpace
- type PluginInit
- type PluginInitE
- type PluginInitOptions
- type PluginInitOptionsE
- type PluginPrivateFSSetter
- type PluginProvideOptions
- type PluginRegister
- type PluginRegisterArg
- type PluginRegisterOptionsArg
- type PluginRequireOptions
- type PluginSetter
- type Plugins
- func (pls *Plugins) Add(plugin ...interface{}) (err error)
- func (pls *Plugins) AddTo(to *[]*Plugin, plugin ...interface{}) (err error)
- func (pls *Plugins) After(self, other interface{})
- func (pls *Plugins) Before(self, other interface{})
- func (pls *Plugins) Each(cb func(plugin *Plugin) (err error)) (err error)
- func (pls *Plugins) Extension(extensions ...Extension) (err error)
- func (pls *Plugins) Init() (err error)
- func (pls *Plugins) ProvideOptions() (err error)
- func (pls *Plugins) TriggerPlugins(e edis.EventInterface, plugins ...*Plugin) (err error)
- type PluginsFS
- func (p *PluginsFS) AssetFSPathRegister() func(fs assetfsapi.PathRegistrator, pth string) error
- func (p *PluginsFS) FS() assetfsapi.Interface
- func (p *PluginsFS) PluginPrivateFS(pluginUID string) assetfsapi.Interface
- func (p *PluginsFS) PrivateFS() assetfsapi.Interface
- func (p *PluginsFS) SetAssetFSPathRegister(register func(fs assetfsapi.PathRegistrator, pth string) error)
- type PluginsMap
- type Sorter
- type SorterState
Constants ¶
View Source
const ( E_REGISTER = "register" E_INIT = "init" E_INIT_PLUGINS = "initPlugins" E_INIT_DONE = "initDone" E_POST_INIT = "postInit" )
Variables ¶
View Source
var ( EAll = edis.EAll NewEvent = edis.NewEvent )
View Source
var ( SortedError = errors.New("Sorted") Initialized = errors.New("Initialized") )
View Source
var Dis = Dispatcher
View Source
var E_FS = PKG + ".FS"
View Source
var E_LOCALE_FS = PKG + ".localeFS"
View Source
var (
PKG = path_helpers.GetCalledDir()
)
Functions ¶
func DefaultFSPathRegister ¶
func DefaultFSPathRegister(fs assetfsapi.PathRegistrator, pth string) error
func InitPluginFS ¶
func InitPluginFS(pls PluginFSInterface)
func InitPluginI18nFS ¶
func InitPluginI18nFS(pls I18nPluginsInterface)
func IsInitializador ¶
func IsInitializador(v interface{}) bool
func IsOptionsProvider ¶
func IsOptionsProvider(v interface{}) bool
func OnFS ¶
func OnFS(p EventDispatcherInterface, cb func(e *FSEvent))
func OnInit ¶
func OnInit(dis EventDispatcherInterface, callbacks ...interface{}) error
func OnLocaleFS ¶
func OnLocaleFS(p EventDispatcherInterface, cb func(e *LocaleFSEvent))
func OnPostInit ¶
func OnPostInit(dis EventDispatcherInterface, callbacks ...interface{}) error
Types ¶
type Accessible ¶
type Accessible struct {
// contains filtered or unexported fields
}
func (*Accessible) Plugin ¶
func (a *Accessible) Plugin() *Plugin
func (*Accessible) SetPlugin ¶
func (a *Accessible) SetPlugin(plugin *Plugin)
type CallbackFunc ¶
type CallbackFunc = edis.CallbackFunc
type CallbackFuncE ¶
type CallbackFuncE = edis.CallbackFuncE
type EventDispatcher ¶
type EventDispatcher struct {
edis.EventDispatcher
}
func (*EventDispatcher) On ¶
func (ed *EventDispatcher) On(eventName string, callbacks ...interface{})
func (*EventDispatcher) OnE ¶
func (ed *EventDispatcher) OnE(eventName string, callbacks ...interface{}) error
type EventDispatcherInterface ¶
type EventDispatcherInterface = edis.EventDispatcherInterface
type EventInterface ¶
type EventInterface = edis.EventInterface
type FSEvent ¶
type FSEvent struct { PluginEventInterface AssetFS assetfsapi.Interface AssetRegister func(fs assetfsapi.PathRegistrator, pth string) error PrivateFS assetfsapi.Interface }
func (*FSEvent) RegisterAssetPath ¶
type FSSetter ¶
type FSSetter interface {
SetFS(fs assetfsapi.Interface)
}
type GlobalOptions ¶
type GlobalOptions struct {
GlobalOptions *Options
}
func (GlobalOptions) GetGlobalOptions ¶
func (b GlobalOptions) GetGlobalOptions() *Options
func (*GlobalOptions) SetGlobalOptions ¶
func (b *GlobalOptions) SetGlobalOptions(options *Options)
type GlobalOptionsInterface ¶
type I18nPlugins ¶
type I18nPlugins struct { PluginsFS // contains filtered or unexported fields }
func NewI18nPlugins ¶
func NewI18nPlugins(fs assetfsapi.Interface, nameSpace string) *I18nPlugins
func (*I18nPlugins) LocaleFS ¶
func (pls *I18nPlugins) LocaleFS() assetfsapi.Interface
type I18nPluginsInterface ¶
type I18nPluginsInterface interface { PluginFSInterface LocaleFS() assetfsapi.Interface }
type LocaleFSEvent ¶
type LocaleFSEvent struct { PluginEventInterface LocaleFS assetfsapi.Interface }
func (*LocaleFSEvent) RegisterWithNameSpace ¶
func (e *LocaleFSEvent) RegisterWithNameSpace(nameSpace, basePath string) error
type LoggedInterface ¶
type LoggedInterface interface { LoggerSetter Log() logging.Logger }
type LoggerSetter ¶
type NamedPlugin ¶
type NamedPlugin interface {
Name() string
}
type OptionProvider ¶
type OptionProvider interface {
ProvidesOptions(options *Options)
}
type OptionProviderE ¶
type Options ¶
func NewOptions ¶
type Parent ¶
type Parent struct {
Value EventInterface
}
type Plugin ¶
type Plugin struct { Index int Path string AbsPath string Value interface{} ReflectedValue reflect.Value AssetsRoot, NameSpace string // contains filtered or unexported fields }
func (*Plugin) SetLoggerLevel ¶
type PluginAccess ¶
type PluginAccess interface { PluginSetter Plugin() *Plugin }
type PluginAfterI ¶
type PluginAfterI interface {
After() []interface{}
}
type PluginAfterUID ¶
type PluginAfterUID interface {
After() []string
}
type PluginAssetFSSetter ¶
type PluginAssetFSSetter interface {
SetPrivateFS(fs assetfsapi.Interface)
}
type PluginAssetsRootPath ¶
type PluginAssetsRootPath interface {
AssetsRootPath() string
}
type PluginBeforeI ¶
type PluginBeforeI interface {
Before() []interface{}
}
type PluginBeforeUID ¶
type PluginBeforeUID interface {
Before() []string
}
type PluginCallbackFunc ¶
type PluginCallbackFunc func(pe PluginEventInterface)
func (PluginCallbackFunc) Call ¶
func (p PluginCallbackFunc) Call(pe PluginEventInterface) error
type PluginCallbackFuncE ¶
type PluginCallbackFuncE func(pe PluginEventInterface) error
func (PluginCallbackFuncE) Call ¶
func (p PluginCallbackFuncE) Call(pe PluginEventInterface) error
type PluginEvent ¶
type PluginEvent struct { EventInterface // contains filtered or unexported fields }
func NewPluginEvent ¶
func NewPluginEvent(e interface{}, data ...interface{}) (pe *PluginEvent)
func (*PluginEvent) Options ¶
func (pe *PluginEvent) Options() *Options
func (*PluginEvent) Plugin ¶
func (pe *PluginEvent) Plugin() *Plugin
func (*PluginEvent) PluginDispatcher ¶
func (pe *PluginEvent) PluginDispatcher() PluginEventDispatcherInterface
func (*PluginEvent) SetOptions ¶
func (pe *PluginEvent) SetOptions(o *Options)
func (*PluginEvent) SetPlugin ¶
func (pe *PluginEvent) SetPlugin(p *Plugin)
func (*PluginEvent) WithPluginDispatcher ¶
func (pe *PluginEvent) WithPluginDispatcher(dis PluginEventDispatcherInterface) func()
type PluginEventCallback ¶
type PluginEventCallback func(e PluginEventInterface)
func (PluginEventCallback) Call ¶
func (c PluginEventCallback) Call(e EventInterface) error
type PluginEventCallbackE ¶
type PluginEventCallbackE func(e PluginEventInterface) error
func (PluginEventCallbackE) Call ¶
func (c PluginEventCallbackE) Call(e EventInterface) error
type PluginEventCallbackInterface ¶
type PluginEventCallbackInterface interface {
Call(pe PluginEventInterface) error
}
type PluginEventDispatcher ¶
type PluginEventDispatcher struct { EventDispatcher PluginsGetter func() []*Plugin // contains filtered or unexported fields }
func (*PluginEventDispatcher) EachPlugins ¶
func (ped *PluginEventDispatcher) EachPlugins(items []*Plugin, cb func(plugin *Plugin) (err error)) (err error)
func (*PluginEventDispatcher) EachPluginsCallback ¶
func (ped *PluginEventDispatcher) EachPluginsCallback(items []*Plugin, callbacks ...func(plugin *Plugin) error) (err error)
func (*PluginEventDispatcher) GetPlugins ¶
func (ped *PluginEventDispatcher) GetPlugins() []*Plugin
func (*PluginEventDispatcher) OnPlugin ¶
func (ped *PluginEventDispatcher) OnPlugin(eventName string, callbacks ...interface{})
func (*PluginEventDispatcher) OnPluginE ¶
func (ped *PluginEventDispatcher) OnPluginE(eventName string, callbacks ...interface{}) (err error)
func (*PluginEventDispatcher) Options ¶
func (ped *PluginEventDispatcher) Options() *Options
func (*PluginEventDispatcher) PluginDispatcher ¶
func (ped *PluginEventDispatcher) PluginDispatcher() PluginEventDispatcherInterface
func (*PluginEventDispatcher) SetDispatcher ¶
func (ped *PluginEventDispatcher) SetDispatcher(dis EventDispatcherInterface)
func (*PluginEventDispatcher) SetOptions ¶
func (ped *PluginEventDispatcher) SetOptions(options *Options)
func (*PluginEventDispatcher) TriggerPlugins ¶
func (ped *PluginEventDispatcher) TriggerPlugins(e EventInterface, plugins ...*Plugin) (err error)
type PluginEventDispatcherInterface ¶
type PluginEventDispatcherInterface interface { EventDispatcherInterface OnPluginE(eventName string, callbacks ...interface{}) error OnPlugin(eventName string, callbacks ...interface{}) TriggerPlugins(e EventInterface, plugins ...*Plugin) (err error) EachPlugins(items []*Plugin, cb func(plugin *Plugin) (err error)) (err error) EachPluginsCallback(items []*Plugin, callbacks ...func(plugin *Plugin) error) (err error) Options() *Options GetPlugins() []*Plugin }
func Dispatcher ¶
func Dispatcher(options *Options) PluginEventDispatcherInterface
type PluginEventInterface ¶
type PluginEventInterface interface { EventInterface PluginDispatcher() PluginEventDispatcherInterface Plugin() *Plugin SetPlugin(*Plugin) Options() *Options SetOptions(*Options) WithPluginDispatcher(dis PluginEventDispatcherInterface) func() }
type PluginFSInterface ¶
type PluginFSInterface interface { PluginEventDispatcherInterface SetAssetFSPathRegister(regiser func(fs assetfsapi.PathRegistrator, pth string) error) AssetFSPathRegister() func(fs assetfsapi.PathRegistrator, pth string) error FS() assetfsapi.Interface PrivateFS() assetfsapi.Interface PluginPrivateFS(pluginID string) assetfsapi.Interface }
type PluginFSNameSpace ¶
type PluginFSNameSpace interface {
NameSpace() string
}
type PluginInit ¶
type PluginInit interface {
Init()
}
type PluginInitE ¶
type PluginInitE interface {
Init() error
}
type PluginInitOptions ¶
type PluginInitOptions interface {
Init(options *Options)
}
type PluginInitOptionsE ¶
type PluginPrivateFSSetter ¶
type PluginPrivateFSSetter interface {
SetPrivateFS(fs assetfsapi.Interface)
}
type PluginProvideOptions ¶
type PluginProvideOptions interface {
ProvideOptions() []string
}
type PluginRegister ¶
type PluginRegister interface {
OnRegister()
}
type PluginRegisterArg ¶
type PluginRegisterArg interface {
OnRegister(p *Plugin)
}
type PluginRegisterOptionsArg ¶
type PluginRegisterOptionsArg interface {
OnRegister(options *Options)
}
type PluginRequireOptions ¶
type PluginRequireOptions interface {
RequireOptions() []string
}
type PluginSetter ¶
type PluginSetter interface {
SetPlugin(p *Plugin)
}
type Plugins ¶
type Plugins struct { Logged PluginEventDispatcher ByUID PluginsMap Extensions []Extension // contains filtered or unexported fields }
func NewPlugins ¶
func NewPlugins() *Plugins
func (*Plugins) ProvideOptions ¶
func (*Plugins) TriggerPlugins ¶
func (pls *Plugins) TriggerPlugins(e edis.EventInterface, plugins ...*Plugin) (err error)
type PluginsFS ¶
type PluginsFS struct { *Plugins // contains filtered or unexported fields }
func NewPluginsFS ¶
func NewPluginsFS(fs assetfsapi.Interface) *PluginsFS
func (*PluginsFS) AssetFSPathRegister ¶
func (p *PluginsFS) AssetFSPathRegister() func(fs assetfsapi.PathRegistrator, pth string) error
func (*PluginsFS) FS ¶
func (p *PluginsFS) FS() assetfsapi.Interface
func (*PluginsFS) PluginPrivateFS ¶
func (p *PluginsFS) PluginPrivateFS(pluginUID string) assetfsapi.Interface
func (*PluginsFS) PrivateFS ¶
func (p *PluginsFS) PrivateFS() assetfsapi.Interface
func (*PluginsFS) SetAssetFSPathRegister ¶
func (p *PluginsFS) SetAssetFSPathRegister(register func(fs assetfsapi.PathRegistrator, pth string) error)
type PluginsMap ¶
func (*PluginsMap) Add ¶
func (this *PluginsMap) Add(plugin ...*Plugin)
func (*PluginsMap) Get ¶
func (this *PluginsMap) Get(uid string) *Plugin
func (*PluginsMap) Has ¶
func (this *PluginsMap) Has(uid string) bool
type Sorter ¶
type Sorter struct { PluginsMap Plugins []*Plugin Befores, Afters map[string][]string Pre, Post func(state *SorterState) error }
type SorterState ¶
type SorterState struct { Plugins []*Plugin Graph *topsort.Graph Befors, Afters map[string][]string // contains filtered or unexported fields }
func (SorterState) UidOrPanic ¶
func (this SorterState) UidOrPanic(v interface{}) string
Click to show internal directories.
Click to hide internal directories.