refactor: moving repository
* refactor * updates * add circle * update circle * fix circle
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
|
||||
"github.com/dgrijalva/jwt-go"
|
||||
"github.com/dgrijalva/jwt-go/request"
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
)
|
||||
|
||||
const reCaptchaAPI = "https://www.google.com/recaptcha/api/siteverify"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
package http
|
||||
|
||||
import (
|
||||
@@ -7,7 +8,7 @@ import (
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
"github.com/hacdias/fileutils"
|
||||
"github.com/mholt/archiver"
|
||||
)
|
||||
|
||||
@@ -10,14 +10,14 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
)
|
||||
|
||||
// Handler returns a function compatible with http.HandleFunc.
|
||||
func Handler(m *fm.FileManager) http.Handler {
|
||||
func Handler(m *fm.FileBrowser) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
code, err := serve(&fm.Context{
|
||||
FileManager: m,
|
||||
FileBrowser: m,
|
||||
User: nil,
|
||||
File: nil,
|
||||
}, w, r)
|
||||
@@ -139,7 +139,7 @@ func apiHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, err
|
||||
|
||||
if c.Router == "checksum" || c.Router == "download" {
|
||||
var err error
|
||||
c.File, err = fm.GetInfo(r.URL, c.FileManager, c.User)
|
||||
c.File, err = fm.GetInfo(r.URL, c.FileBrowser, c.User)
|
||||
if err != nil {
|
||||
return ErrorToHTTP(err, false), err
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
"github.com/hacdias/fileutils"
|
||||
)
|
||||
|
||||
@@ -64,7 +64,7 @@ func resourceHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int
|
||||
|
||||
func resourceGetHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, error) {
|
||||
// Gets the information of the directory/file.
|
||||
f, err := fm.GetInfo(r.URL, c.FileManager, c.User)
|
||||
f, err := fm.GetInfo(r.URL, c.FileBrowser, c.User)
|
||||
if err != nil {
|
||||
return ErrorToHTTP(err, false), err
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"net/http"
|
||||
"reflect"
|
||||
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
)
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
)
|
||||
|
||||
func shareHandler(c *fm.Context, w http.ResponseWriter, r *http.Request) (int, error) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
)
|
||||
|
||||
type modifyRequest struct {
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gorilla/websocket"
|
||||
fm "github.com/hacdias/filemanager"
|
||||
fm "github.com/filebrowser/filebrowser"
|
||||
)
|
||||
|
||||
var upgrader = websocket.Upgrader{
|
||||
|
||||
Reference in New Issue
Block a user