Documentation ¶
Index ¶
- Variables
- type InitVMFunc
- type Script
- type ScriptManager
- func (m *ScriptManager) AddOnInit(fn InitVMFunc)
- func (m *ScriptManager) Export() error
- func (m *ScriptManager) GetVM(t ScriptType) (*jsVm, error)
- func (m *ScriptManager) Import() error
- func (m *ScriptManager) ReInit()
- func (m *ScriptManager) Repl()
- func (m *ScriptManager) RunUnsafe(t ScriptType, code string) (result interface{}, err error)
- type ScriptRepository
- type ScriptType
Constants ¶
This section is empty.
Variables ¶
View Source
var Halt = errors.New("Execution limit exceeded")
View Source
var UnknownScriptType = errors.New("Unknown script type")
Functions ¶
This section is empty.
Types ¶
type InitVMFunc ¶
type InitVMFunc = func(m *ScriptManager)
type ScriptManager ¶
type ScriptManager struct {
// contains filtered or unexported fields
}
func NewScriptManager ¶
func NewScriptManager(repo ScriptRepository, l log.FieldLogger, e event.EventManager, ircmanager *irc.ConnectionManager, config *config.Configuration, database *data.DB) *ScriptManager
func (*ScriptManager) AddOnInit ¶
func (m *ScriptManager) AddOnInit(fn InitVMFunc)
func (*ScriptManager) Export ¶
func (m *ScriptManager) Export() error
Export copies all scripts stored in the internal database to the filesystem.
func (*ScriptManager) GetVM ¶
func (m *ScriptManager) GetVM(t ScriptType) (*jsVm, error)
func (*ScriptManager) Import ¶
func (m *ScriptManager) Import() error
Import copies all scripts stored on the filesystem to the internal database.
func (*ScriptManager) ReInit ¶
func (m *ScriptManager) ReInit()
func (*ScriptManager) Repl ¶
func (m *ScriptManager) Repl()
func (*ScriptManager) RunUnsafe ¶
func (m *ScriptManager) RunUnsafe(t ScriptType, code string) (result interface{}, err error)
type ScriptRepository ¶
type ScriptRepository interface { FetchAll() []*Script Fetch(id int) *Script Save(script *Script) Delete(id int) }
func NewScriptRepository ¶
func NewScriptRepository(database *data.DB, conf *config.Configuration, logger log.FieldLogger) ScriptRepository
Click to show internal directories.
Click to hide internal directories.