func (m *Manhole) RegisterType(name string, example interface{}) error {
	return m.register(name, example, luar.PushType)
}
RegisterType registers the type with example value `example` using the
global name `name`.
Example:
m.RegisterType("MyType", MyType{})
Applies to all future manhole sessions, but not already started ones.
package manhole
import (
	"bufio"
	"fmt"
	"io"
	"net"
	"sort"
	"strings"
	"sync"
	"time"
	"github.com/Shopify/go-lua"
	"github.com/jtolds/go-luar"
)
var (
	reserved = map[string]bool{"quit": true, "print": true, "repr": true}
)
type Manhole struct {
	mtx           sync.Mutex
	registrations map[string]func(*lua.State) error
}
func (m *Manhole) register(name string, val interface{},
	pusher func(l *lua.State, val interface{}) error) error {
	m.mtx.Lock()
	defer m.mtx.Unlock()
	if m.registrations == nil {
		m.registrations = map[string]func(*lua.State) error{}
	}
	_, exists := m.registrations[name]
	if exists || reserved[name] {
		return fmt.Errorf("Registration %#v already exists", name)
	}
	m.registrations[name] = func(l *lua.State) error {
		err := pusher(l, val)
		if err != nil {
			return err
		}
		l.SetGlobal(name)
		return nil
	}
	return nil
}