// Copyright 2024 Matthew Rich . All rights reserved. package folio import ( "errors" _ "gitea.rosskeen.house/pylon/luaruntime" _ "fmt" ) type EventHandler string type Events map[EventType]EventHandler var ( ErrInvalidHandler error = errors.New("Invalid event handler") ) func NewEvents() *Events { e := make(Events) return &e } func (e *Events) Set(t EventType, h EventHandler) (err error) { if err = t.Validate(); err == nil { (*e)[t] = h } return }