1
0
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:
Timur Ismagilov 2022-04-02 01:01:54 +03:00
parent 0ab4bb5846
commit f9857768b7
4 changed files with 6 additions and 6 deletions

View File

@ -12,8 +12,8 @@ import (
var categoryToHyphae = map[string]*categoryNode{}
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.
func InitCategories() {
// 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 Init() {
var (
record, err = readCategoriesFromDisk()
)

View File

@ -11,8 +11,8 @@ import (
"strings"
)
// InitCategoriesHandlers initializes HTTP handlers for the given router. Call somewhere in package web.
func InitCategoriesHandlers(r *mux.Router) {
// InitHandlers initializes HTTP handlers for the given router. Call somewhere in package web.
func InitHandlers(r *mux.Router) {
r.PathPrefix("/add-to-category").HandlerFunc(handlerAddToCategory).Methods("POST")
r.PathPrefix("/remove-from-category").HandlerFunc(handlerRemoveFromCategory).Methods("POST")
r.PathPrefix("/category/").HandlerFunc(handlerCategory).Methods("GET")

View File

@ -51,7 +51,7 @@ func main() {
history.InitGitRepo()
migration.MigrateRocketsMaybe()
shroom.SetHeaderLinks()
categories.InitCategories()
categories.Init()
// Static files:
static.InitFS(files.StaticFiles())

View File

@ -110,7 +110,7 @@ func Handler() http.Handler {
initStuff(wikiRouter)
initSearch(wikiRouter)
initBacklinks(wikiRouter)
categories.InitCategoriesHandlers(wikiRouter)
categories.InitHandlers(wikiRouter)
// Admin routes.
if cfg.UseAuth {