Capture accumulated application, UI, CLI, regression tests and design documentation changes, including task project mapping and default CalDAV list naming. Keep deployment data, backups, local credentials and build artifacts out of Git. Move the Compose enrollment token to an ignored local environment file.
123 lines
2.6 KiB
Go
123 lines
2.6 KiB
Go
package routes
|
|
|
|
import "net/http"
|
|
|
|
type APIHandlers struct {
|
|
CreateObject http.HandlerFunc
|
|
ListObjects http.HandlerFunc
|
|
DeleteObject 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
|
|
CopyPath http.HandlerFunc
|
|
ZombieList http.HandlerFunc
|
|
ZombiePurge http.HandlerFunc
|
|
FederationEnroll http.HandlerFunc
|
|
Event http.HandlerFunc
|
|
Queue http.HandlerFunc
|
|
Adapter http.HandlerFunc
|
|
AdapterSession http.HandlerFunc
|
|
Notifications http.HandlerFunc
|
|
Publication http.HandlerFunc
|
|
SearchSuggest 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/object/delete",
|
|
h.DeleteObject,
|
|
)
|
|
|
|
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,
|
|
)
|
|
mux.HandleFunc("/_/api/v1/path/copy", h.CopyPath)
|
|
|
|
mux.HandleFunc(
|
|
"/_/api/v1/gc/zombies/list",
|
|
h.ZombieList,
|
|
)
|
|
|
|
mux.HandleFunc(
|
|
"/_/api/v1/gc/zombies/purge",
|
|
h.ZombiePurge,
|
|
)
|
|
mux.HandleFunc(
|
|
"/_/api/v1/federation/enroll",
|
|
h.FederationEnroll,
|
|
)
|
|
mux.HandleFunc("/_/api/v1/event", h.Event)
|
|
mux.HandleFunc("/_/api/v1/event/", h.Event)
|
|
mux.HandleFunc("/_/api/v1/queue", h.Queue)
|
|
mux.HandleFunc("/_/api/v1/queue/", h.Queue)
|
|
mux.HandleFunc("/_/api/v1/adapter", h.Adapter)
|
|
mux.HandleFunc("/_/api/v1/adapter/", h.Adapter)
|
|
mux.HandleFunc("/_/api/v1/adapter/session/", h.AdapterSession)
|
|
mux.HandleFunc("/_/api/v1/notifications", h.Notifications)
|
|
mux.HandleFunc("/_/api/v1/notifications/", h.Notifications)
|
|
mux.HandleFunc("/_/api/v1/publication/requests", h.Publication)
|
|
mux.HandleFunc("/_/api/v1/publication/requests/", h.Publication)
|
|
mux.HandleFunc("/_/api/v1/search/suggest", h.SearchSuggest)
|
|
}
|