Documentation
¶
Index ¶
- func NewScriptModule(logger *zap.Logger) *localScriptModule
- type Event
- type EventSequence
- type EventState
- type EventType
- type Module
- type ModuleNames
- type Option
- func WithContext(ctx context.Context) Option
- func WithEvaluation(evaluation func(interface{})) Option
- func WithGlobal(key string, value interface{}) Option
- func WithLibAes128() Option
- func WithLibAes256() Option
- func WithLibBase64() Option
- func WithLibBit32() Option
- func WithLibBit64() Option
- func WithLibJson() Option
- func WithLibMD5() Option
- func WithLibUUID() Option
- func WithLogger(logger *zap.Logger) Option
- func WithModule(mod Module) Option
- func WithModuleEvent(logger *zap.Logger) Option
- func WithModuleHttp(logger *zap.Logger) Option
- func WithModuleLogger(logger *zap.Logger) Option
- func WithModuleRedis(logger *zap.Logger, opts *redis.Options) Option
- func WithRuntimeModule(mod RuntimeModule) Option
- func WithScriptEntry(path string) Option
- func WithWaitGroup(wg *sync.WaitGroup) Option
- type Runtime
- type RuntimeModule
- type ScriptModule
- type StateEvent
- type TimerEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewScriptModule ¶
Types ¶
type EventSequence ¶
type EventSequence []Event
func (EventSequence) Len ¶
func (s EventSequence) Len() int
func (EventSequence) Less ¶
func (s EventSequence) Less(i, j int) bool
func (EventSequence) Swap ¶
func (s EventSequence) Swap(i, j int)
type EventState ¶
type EventState uint32
const ( EVENT_STATE_INITIALIZE EventState = iota EVENT_STATE_PROGRESS EVENT_STATE_FINALIZE EVENT_STATE_COMPLETE )
type Module ¶
type Module interface { Name() string Open() lua.LGFunction }
type ModuleNames ¶
type ModuleNames []string
func (ModuleNames) Len ¶
func (a ModuleNames) Len() int
func (ModuleNames) Less ¶
func (a ModuleNames) Less(i, j int) bool
func (ModuleNames) Swap ¶
func (a ModuleNames) Swap(i, j int)
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
func WithContext ¶
func WithEvaluation ¶
func WithEvaluation(evaluation func(interface{})) Option
Evaluation handler which handle the return value of script entry.
func WithGlobal ¶
Global variable which can be access within Lua runtime.
func WithLibAes128 ¶
func WithLibAes128() Option
func WithLibAes256 ¶
func WithLibAes256() Option
func WithLibBase64 ¶
func WithLibBase64() Option
func WithLibBit32 ¶
func WithLibBit32() Option
func WithLibBit64 ¶
func WithLibBit64() Option
func WithLibJson ¶
func WithLibJson() Option
func WithLibMD5 ¶
func WithLibMD5() Option
func WithLibUUID ¶
func WithLibUUID() Option
func WithLogger ¶
func WithModule ¶
func WithModuleEvent ¶
func WithModuleHttp ¶
func WithModuleLogger ¶
func WithModuleRedis ¶
func WithRuntimeModule ¶
func WithRuntimeModule(mod RuntimeModule) Option
func WithScriptEntry ¶ added in v0.1.5
The script path for the runtime entrypoint. Default is main.
func WithWaitGroup ¶
type Runtime ¶
type Runtime struct { EventQueue chan Event // contains filtered or unexported fields }
func NewRuntime ¶
func NewRuntimeWithConfig ¶
func NewRuntimeWithConfig(scripts ScriptModule, opts lua.Options, options ...Option) *Runtime
type RuntimeModule ¶
type ScriptModule ¶
type ScriptModule interface { OpenPackage() lua.LGFunction List() []string }
type StateEvent ¶
type StateEvent struct { EventType // contains filtered or unexported fields }
func (*StateEvent) Continue ¶
func (e *StateEvent) Continue() bool
func (*StateEvent) Load ¶
func (e *StateEvent) Load() uint32
func (*StateEvent) Stop ¶
func (e *StateEvent) Stop()
func (*StateEvent) Store ¶
func (e *StateEvent) Store(value uint32)
func (*StateEvent) Valid ¶
func (e *StateEvent) Valid() bool
type TimerEvent ¶
type TimerEvent struct { EventType Delay, Period time.Duration // contains filtered or unexported fields }
func (*TimerEvent) Continue ¶
func (e *TimerEvent) Continue() bool
func (*TimerEvent) Load ¶
func (e *TimerEvent) Load() bool
func (*TimerEvent) Stop ¶
func (e *TimerEvent) Stop()
func (*TimerEvent) Store ¶
func (e *TimerEvent) Store(value bool)
func (*TimerEvent) Valid ¶
func (e *TimerEvent) Valid() bool
Source Files
¶
Click to show internal directories.
Click to hide internal directories.