Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = gocaveman.ErrNotFound
Functions ¶
func NewAdminMenusViewFS ¶
func NewAdminMenusViewFS(prefix string) http.FileSystem
func NewDefaultAdminMenusViewFS ¶
func NewDefaultAdminMenusViewFS() http.FileSystem
Types ¶
type FileMenus ¶
func (*FileMenus) DeleteMenu ¶
type MenuAPIHandler ¶
type MenuAPIHandler struct { Menus MenusReaderWriter Prefix string }
func NewMenuAPIHandler ¶
func NewMenuAPIHandler(menus MenusReaderWriter) *MenuAPIHandler
func (*MenuAPIHandler) ServeHTTP ¶
func (h *MenuAPIHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type MenuItem ¶
type MenuItem struct { Text string `json:"text"` Link string `json:"link"` Children []*MenuItem `json:"children"` Parent *MenuItem `json:"-"` // TODO: should we also have Prev and Next??? // Data interface{} // FIXME: this probably should be map[string]interface{} to encourage best practices; i was thinking this could be a struct before but i think that's unlikely because it won't survive being marshalled both ways in JSON so we just pick something simple and workable, even if less flexible Data map[string]interface{} `json:"data"` }
func NewMenuItem ¶
type MenusReader ¶
type MenusReaderWriter ¶
type MenusReaderWriter interface { MenusReader MenusWriter }
Click to show internal directories.
Click to hide internal directories.