Documentation ¶
Index ¶
- func SetWinsize(fd uintptr, w, h int)
- type KeyValue
- type LuaExtender
- func (le *LuaExtender) ClearTriggers(l *lua.LState) int
- func (le *LuaExtender) Close() error
- func (le *LuaExtender) Compile(filePath string) (*lua.FunctionProto, error)
- func (le *LuaExtender) DoCompiledFile(L *lua.LState, proto *lua.FunctionProto) error
- func (le *LuaExtender) GetState() *lua.LState
- func (le *LuaExtender) InitState() error
- func (le *LuaExtender) Input(s string)
- func (le *LuaExtender) RunTrigger(name string) (bool, error)
- type Winsize
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetWinsize ¶
Types ¶
type LuaExtender ¶
type LuaExtender struct { Proto *lua.FunctionProto ExternalExec bool Users *map[string]*database.User User *database.User Term *term.Term ServerConn *ssh.ServerConn Conn ssh.Channel IsConnected bool Environment map[string]string // contains filtered or unexported fields }
LuaExtender holds an instance of the moon interpreter and the state variables of the extensions we made.
func New ¶
func New(cfg config.Config, users *map[string]*database.User, user *database.User, term *term.Term, serverConn *ssh.ServerConn, conn ssh.Channel, ) *LuaExtender
New creates a new instance of LuaExtender.
func (*LuaExtender) ClearTriggers ¶ added in v0.1.12
func (le *LuaExtender) ClearTriggers(l *lua.LState) int
func (*LuaExtender) Close ¶
func (le *LuaExtender) Close() error
func (*LuaExtender) Compile ¶
func (le *LuaExtender) Compile(filePath string) (*lua.FunctionProto, error)
CompileLua reads the passed lua file from disk and compiles it.
func (*LuaExtender) DoCompiledFile ¶
func (le *LuaExtender) DoCompiledFile(L *lua.LState, proto *lua.FunctionProto) error
DoCompiledFile takes a FunctionProto, as returned by CompileLua, and runs it in the LState. It is equivalent to calling DoFile on the LState with the original source file.
func (*LuaExtender) GetState ¶
func (le *LuaExtender) GetState() *lua.LState
GetState returns the state of the moon interpreter.
func (*LuaExtender) InitState ¶
func (le *LuaExtender) InitState() error
InitState starts the lua interpreter with a script.
func (*LuaExtender) Input ¶
func (le *LuaExtender) Input(s string)
func (*LuaExtender) RunTrigger ¶
func (le *LuaExtender) RunTrigger(name string) (bool, error)
RunTrigger executes a pre-configured trigger.
Click to show internal directories.
Click to hide internal directories.