init
This commit is contained in:
commit
fa6a4c650f
93 files changed
+6555
No files matched your search
@@ -0,0 +1,78 @@
|
||||
package routes
|
||||
|
||||
import "net/http"
|
||||
|
||||
type APIHandlers struct {
|
||||
CreateObject http.HandlerFunc
|
||||
ListObjects http.HandlerFunc
|
||||
SaveRevision http.HandlerFunc
|
||||
ListRevisions http.HandlerFunc
|
||||
RestoreRevision http.HandlerFunc
|
||||
RenderMarkdown http.HandlerFunc
|
||||
AddTag http.HandlerFunc
|
||||
BindPath http.HandlerFunc
|
||||
RenamePath http.HandlerFunc
|
||||
RenamePreview http.HandlerFunc
|
||||
RemovePath http.HandlerFunc
|
||||
}
|
||||
|
||||
func RegisterAPIRoutes(
|
||||
mux *http.ServeMux,
|
||||
h APIHandlers,
|
||||
) {
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/object/create",
|
||||
h.CreateObject,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/object/list",
|
||||
h.ListObjects,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/revisions/save",
|
||||
h.SaveRevision,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/revisions/list",
|
||||
h.ListRevisions,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/revisions/restore",
|
||||
h.RestoreRevision,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/render/markdown",
|
||||
h.RenderMarkdown,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/tag/add",
|
||||
h.AddTag,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/path/bind",
|
||||
h.BindPath,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/path/rename",
|
||||
h.RenamePath,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/path/rename-preview",
|
||||
h.RenamePreview,
|
||||
)
|
||||
|
||||
mux.HandleFunc(
|
||||
"/_/api/v1/path/remove",
|
||||
h.RemovePath,
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user