mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-03-06 11:38:19 +00:00
Categories: Rename exported functions
This commit is contained in:
parent
0ab4bb5846
commit
f9857768b7
@ -12,8 +12,8 @@ import (
|
|||||||
var categoryToHyphae = map[string]*categoryNode{}
|
var categoryToHyphae = map[string]*categoryNode{}
|
||||||
var hyphaToCategories = map[string]*hyphaNode{}
|
var hyphaToCategories = map[string]*hyphaNode{}
|
||||||
|
|
||||||
// InitCategories initializes the category system. Call it after the Structure is initialized. This function might terminate the program in case of a bad mood or filesystem faults.
|
// Init initializes the category system. Call it after the Structure is initialized. This function might terminate the program in case of a bad mood or filesystem faults.
|
||||||
func InitCategories() {
|
func Init() {
|
||||||
var (
|
var (
|
||||||
record, err = readCategoriesFromDisk()
|
record, err = readCategoriesFromDisk()
|
||||||
)
|
)
|
||||||
|
@ -11,8 +11,8 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// InitCategoriesHandlers initializes HTTP handlers for the given router. Call somewhere in package web.
|
// InitHandlers initializes HTTP handlers for the given router. Call somewhere in package web.
|
||||||
func InitCategoriesHandlers(r *mux.Router) {
|
func InitHandlers(r *mux.Router) {
|
||||||
r.PathPrefix("/add-to-category").HandlerFunc(handlerAddToCategory).Methods("POST")
|
r.PathPrefix("/add-to-category").HandlerFunc(handlerAddToCategory).Methods("POST")
|
||||||
r.PathPrefix("/remove-from-category").HandlerFunc(handlerRemoveFromCategory).Methods("POST")
|
r.PathPrefix("/remove-from-category").HandlerFunc(handlerRemoveFromCategory).Methods("POST")
|
||||||
r.PathPrefix("/category/").HandlerFunc(handlerCategory).Methods("GET")
|
r.PathPrefix("/category/").HandlerFunc(handlerCategory).Methods("GET")
|
||||||
|
2
main.go
2
main.go
@ -51,7 +51,7 @@ func main() {
|
|||||||
history.InitGitRepo()
|
history.InitGitRepo()
|
||||||
migration.MigrateRocketsMaybe()
|
migration.MigrateRocketsMaybe()
|
||||||
shroom.SetHeaderLinks()
|
shroom.SetHeaderLinks()
|
||||||
categories.InitCategories()
|
categories.Init()
|
||||||
|
|
||||||
// Static files:
|
// Static files:
|
||||||
static.InitFS(files.StaticFiles())
|
static.InitFS(files.StaticFiles())
|
||||||
|
@ -110,7 +110,7 @@ func Handler() http.Handler {
|
|||||||
initStuff(wikiRouter)
|
initStuff(wikiRouter)
|
||||||
initSearch(wikiRouter)
|
initSearch(wikiRouter)
|
||||||
initBacklinks(wikiRouter)
|
initBacklinks(wikiRouter)
|
||||||
categories.InitCategoriesHandlers(wikiRouter)
|
categories.InitHandlers(wikiRouter)
|
||||||
|
|
||||||
// Admin routes.
|
// Admin routes.
|
||||||
if cfg.UseAuth {
|
if cfg.UseAuth {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user