Example #1
0
func (lua *LuaExt) RegisterRoute(r *mux.Router, middlewares *serverMiddleware.SharedMiddleware) {
	r.Handle("/", middlewares.Auth(http.HandlerFunc(lua.AppsHandler())))
	r.Handle("/stats", middlewares.Auth(http.HandlerFunc(lua.AppStatsHandler())))
	r.Handle("/logs", middlewares.Auth(http.HandlerFunc(lua.AppLogsHandler())))
	r.Handle("/register", middlewares.Auth(http.HandlerFunc(lua.RegisterHandler())))
	// TODO(tsileo) "/remove" endpoint
	// TODO(tsileo) "/logstream" endpoint to stream logs (SSE)
}
Example #2
0
func (docstore *DocStoreExt) RegisterRoute(r *mux.Router, middlewares *serverMiddleware.SharedMiddleware) {
	r.Handle("/", middlewares.Auth(http.HandlerFunc(docstore.collectionsHandler())))
	r.Handle("/{collection}", middlewares.Auth(http.HandlerFunc(docstore.docsHandler())))
	r.Handle("/{collection}/search", middlewares.Auth(http.HandlerFunc(docstore.searchHandler())))
	r.Handle("/{collection}/{_id}", middlewares.Auth(http.HandlerFunc(docstore.docHandler())))
}
Example #3
0
func (st *SyncTable) RegisterRoute(r *mux.Router, middlewares *serverMiddleware.SharedMiddleware) {
	r.Handle("/_state/{ns}", middlewares.Auth(http.HandlerFunc(st.stateHandler())))
	r.Handle("/_state/{ns}/leafs/{prefix}", middlewares.Auth(http.HandlerFunc(st.stateLeafsHandler())))
	r.Handle("/{ns}", middlewares.Auth(http.HandlerFunc(st.syncHandler())))
	r.Handle("/_trigger/{ns}", middlewares.Auth(http.HandlerFunc(st.triggerHandler())))
}
Example #4
0
func New(r *mux.Router, middlewares *serverMiddleware.SharedMiddleware, wg sync.WaitGroup, db *vkv.DB, ns *nsdb.DB,
	kvUpdate chan *vkv.KeyValue, blobrouter *router.Router, blobs chan<- *router.Blob, vkvHub *hub.Hub) {

	r.Handle("/blobstore/upload", middlewares.Auth(http.HandlerFunc(blobUploadHandler(blobs))))
	r.Handle("/blobstore/blobs", middlewares.Auth(http.HandlerFunc(blobsHandler(blobrouter))))
	r.Handle("/blobstore/blob/{hash}", middlewares.Auth(http.HandlerFunc(blobHandler(blobrouter))))
	r.Handle("/vkv/keys", middlewares.Auth(http.HandlerFunc(vkvKeysHandler(db))))
	r.Handle("/vkv/key/{key}", middlewares.Auth(http.HandlerFunc(vkvHandler(wg, db, kvUpdate, blobrouter))))
	r.Handle("/vkv/key/{key}/versions", middlewares.Auth(http.HandlerFunc(vkvVersionsHandler(db))))
	r.Handle("/vkv/key/{key}/watch", middlewares.Auth(http.HandlerFunc(vkvWatchKeyHandler(vkvHub))))
}