Documentation ¶
Overview ¶
package crawlspace provides a means to dynamically interact with registered Go objects in a live process, using small scripting language based around the reflect package.
Inspiration is mainly from Twisted's manhole library: https://twistedmatrix.com/documents/current/api/twisted.conch.manhole.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Crawlspace ¶
type Crawlspace struct {
// contains filtered or unexported fields
}
Crawlspace is a registry of Go values to expose via a remote shell.
func New ¶
func New(env func(out io.Writer) reflectlang.Environment) *Crawlspace
New makes a new crawlspace using the environment constructor env. If env is nil, reflectlang.Environment{} is used. github.com/jtolio/crawlspace/tools.Env is perhaps a more useful choice.
func (*Crawlspace) Interact ¶
Interact takes input from `in` and returns output to `out`. It runs until there is an error, or the user runs `quit()`. In the case of the input returning io.EOF or the user entering `quit()`, no error will be returned.
func (*Crawlspace) ListenAndServe ¶
func (m *Crawlspace) ListenAndServe(addr string) error
ListenAndServe listens on the given address. It calls Serve with an appropriate listener.