Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterEvent ¶
func RegisterEvent(e Event, handler EventHandler)
Types ¶
type BaseEvent ¶
type BaseEvent struct { Handlers map[int]EventHandler // All event handler functions Mutex sync.Mutex // Thread safety // contains filtered or unexported fields }
Base structure for all events
func NewBaseEvent ¶
Initializes a new BaseEvent with default values
func (*BaseEvent) Cancel ¶
func (e *BaseEvent) Cancel()
Mark the event as cancelled if it is cancellable
func (*BaseEvent) GetBaseEvent ¶
func (*BaseEvent) IsCanceled ¶
Checks if the event has been cancelled
func (*BaseEvent) Register ¶
func (e *BaseEvent) Register(handler EventHandler) int
Register an EventHandler to the event
func (*BaseEvent) Unregister ¶
Remove an EventHandler from the event
type Event ¶
type Event interface { Fire() bool // Fire the event Register(EventHandler) int // Subscribe to the event Unregister(int) // Unsubscribe from the event IsCanceled() bool // If the event has been cancelled Cancel() // Cancels the event }
type EventHandler ¶
type Plugin ¶
type Plugin struct { Name string // Name of the plugin Author []string // Author(s) of the plugin Version PluginVersion // Plugin version info MainFunc func(p *Plugin) // Plugin entry point }
type PluginInterface ¶
type PluginInterface interface { Init() Plugin() *Plugin }
type PluginVersion ¶
type PluginVersion struct { Version string // The Version tag (e.g. v1.0.0-ALPHA) VersionSupport map[int]bool // What versions of aurora does this plugin support }
func (*PluginVersion) CheckVersionSupported ¶
func (pv *PluginVersion) CheckVersionSupported(version int) bool
Check if a given version of the plugin is supported
Click to show internal directories.
Click to hide internal directories.