feat: go.mod on 2

License: MIT
Signed-off-by: Henrique Dias <hacdias@gmail.com>
This commit is contained in:
Henrique Dias 2019-01-05 16:10:55 +00:00
parent 093e7d9c71
commit c903619caf
51 changed files with 101 additions and 100 deletions

View File

@ -3,7 +3,7 @@ package auth
import ( import (
"net/http" "net/http"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// Auther is the authentication interface. // Auther is the authentication interface.

View File

@ -7,8 +7,8 @@ import (
"os" "os"
"strings" "strings"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// MethodJSONAuth is used to identify json auth. // MethodJSONAuth is used to identify json auth.

View File

@ -3,8 +3,8 @@ package auth
import ( import (
"net/http" "net/http"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// MethodNoAuth is used to identify no auth. // MethodNoAuth is used to identify no auth.

View File

@ -4,9 +4,9 @@ import (
"net/http" "net/http"
"os" "os"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
) )
// MethodProxyAuth is used to identify no auth. // MethodProxyAuth is used to identify no auth.

View File

@ -1,8 +1,8 @@
package auth package auth
import ( import (
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// StorageBackend is a storage backend for auth storage. // StorageBackend is a storage backend for auth storage.

View File

@ -8,9 +8,9 @@ import (
"strings" "strings"
"text/tabwriter" "text/tabwriter"
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -7,7 +7,7 @@ import (
"strings" "strings"
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,7 +3,7 @@ package cmd
import ( import (
"strings" "strings"
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )

View File

@ -1,7 +1,7 @@
package cmd package cmd
import ( import (
"github.com/filebrowser/filebrowser/storage/bolt/importer" "github.com/filebrowser/filebrowser/v2/storage/bolt/importer"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -12,12 +12,12 @@ import (
"strconv" "strconv"
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
fbhttp "github.com/filebrowser/filebrowser/http" fbhttp "github.com/filebrowser/filebrowser/v2/http"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
lumberjack "gopkg.in/natefinch/lumberjack.v2" lumberjack "gopkg.in/natefinch/lumberjack.v2"

View File

@ -6,8 +6,8 @@ import (
"os" "os"
"text/tabwriter" "text/tabwriter"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"github.com/spf13/pflag" "github.com/spf13/pflag"
) )

View File

@ -1,7 +1,7 @@
package cmd package cmd
import ( import (
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -1,7 +1,7 @@
package cmd package cmd
import ( import (
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -1,8 +1,8 @@
package cmd package cmd
import ( import (
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -5,8 +5,8 @@ import (
"os" "os"
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/filebrowser/filebrowser/storage/bolt" "github.com/filebrowser/filebrowser/v2/storage/bolt"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -3,7 +3,7 @@ package cmd
import ( import (
"fmt" "fmt"
"github.com/filebrowser/filebrowser/version" "github.com/filebrowser/filebrowser/v2/version"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )

View File

@ -16,8 +16,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/rules" "github.com/filebrowser/filebrowser/v2/rules"
"github.com/spf13/afero" "github.com/spf13/afero"
) )

2
go.mod
View File

@ -1,4 +1,4 @@
module github.com/filebrowser/filebrowser module github.com/filebrowser/filebrowser/v2
require ( require (
github.com/BurntSushi/toml v0.3.1 // indirect github.com/BurntSushi/toml v0.3.1 // indirect

View File

@ -9,8 +9,8 @@ import (
"github.com/dgrijalva/jwt-go" "github.com/dgrijalva/jwt-go"
"github.com/dgrijalva/jwt-go/request" "github.com/dgrijalva/jwt-go/request"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
type userInfo struct { type userInfo struct {

View File

@ -9,7 +9,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/filebrowser/filebrowser/runner" "github.com/filebrowser/filebrowser/v2/runner"
"github.com/gorilla/websocket" "github.com/gorilla/websocket"
) )

View File

@ -5,10 +5,10 @@ import (
"net/http" "net/http"
"strconv" "strconv"
"github.com/filebrowser/filebrowser/runner" "github.com/filebrowser/filebrowser/v2/runner"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
type handleFunc func(w http.ResponseWriter, r *http.Request, d *data) (int, error) type handleFunc func(w http.ResponseWriter, r *http.Request, d *data) (int, error)

View File

@ -3,7 +3,7 @@ package http
import ( import (
"net/http" "net/http"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )

View File

@ -3,7 +3,7 @@ package http
import ( import (
"net/http" "net/http"
"github.com/filebrowser/filebrowser/files" "github.com/filebrowser/filebrowser/v2/files"
) )
var withHashFile = func(fn handleFunc) handleFunc { var withHashFile = func(fn handleFunc) handleFunc {

View File

@ -8,8 +8,8 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/filebrowser/filebrowser/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/hacdias/fileutils" "github.com/hacdias/fileutils"
"github.com/mholt/archiver" "github.com/mholt/archiver"
) )

View File

@ -9,10 +9,10 @@ import (
"os" "os"
"strings" "strings"
"github.com/filebrowser/filebrowser/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/fileutils" "github.com/filebrowser/filebrowser/v2/fileutils"
) )
var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { var resourceGetHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {

View File

@ -4,7 +4,7 @@ import (
"net/http" "net/http"
"os" "os"
"github.com/filebrowser/filebrowser/search" "github.com/filebrowser/filebrowser/v2/search"
) )
var searchHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) { var searchHandler = withUser(func(w http.ResponseWriter, r *http.Request, d *data) (int, error) {

View File

@ -4,8 +4,8 @@ import (
"encoding/json" "encoding/json"
"net/http" "net/http"
"github.com/filebrowser/filebrowser/rules" "github.com/filebrowser/filebrowser/v2/rules"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
) )
type settingsData struct { type settingsData struct {

View File

@ -8,8 +8,8 @@ import (
"strings" "strings"
"time" "time"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/share" "github.com/filebrowser/filebrowser/v2/share"
) )
func withPermShare(fn handleFunc) handleFunc { func withPermShare(fn handleFunc) handleFunc {

View File

@ -10,9 +10,9 @@ import (
"strings" "strings"
"github.com/GeertJohan/go.rice" "github.com/GeertJohan/go.rice"
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/filebrowser/filebrowser/version" "github.com/filebrowser/filebrowser/v2/version"
) )
func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *data, box *rice.Box, file, contentType string) (int, error) { func handleWithStaticData(w http.ResponseWriter, r *http.Request, d *data, box *rice.Box, file, contentType string) (int, error) {

View File

@ -7,8 +7,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/gorilla/mux" "github.com/gorilla/mux"
) )

View File

@ -5,7 +5,7 @@ import (
"net/http" "net/http"
"os" "os"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
) )
func renderJSON(w http.ResponseWriter, r *http.Request, data interface{}) (int, error) { func renderJSON(w http.ResponseWriter, r *http.Request, data interface{}) (int, error) {

View File

@ -1,9 +1,10 @@
//go:generate cd http && rice embed-go
package main package main
import ( import (
"runtime" "runtime"
"github.com/filebrowser/filebrowser/cmd" "github.com/filebrowser/filebrowser/v2/cmd"
) )
func main() { func main() {

View File

@ -4,7 +4,7 @@ import (
"os/exec" "os/exec"
"github.com/mholt/caddy" "github.com/mholt/caddy"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
) )
// ParseCommand parses the command taking in account if the current // ParseCommand parses the command taking in account if the current

View File

@ -7,8 +7,8 @@ import (
"os/exec" "os/exec"
"strings" "strings"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// Runner is a commands runner. // Runner is a commands runner.

View File

@ -4,7 +4,7 @@ import (
"os" "os"
"strings" "strings"
"github.com/filebrowser/filebrowser/rules" "github.com/filebrowser/filebrowser/v2/rules"
"github.com/spf13/afero" "github.com/spf13/afero"
) )

View File

@ -1,8 +1,8 @@
package settings package settings
import ( import (
"github.com/filebrowser/filebrowser/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// UserDefaults is a type that holds the default values // UserDefaults is a type that holds the default values

View File

@ -1,6 +1,6 @@
package settings package settings
import "github.com/filebrowser/filebrowser/rules" import "github.com/filebrowser/filebrowser/v2/rules"
// AuthMethod describes an authentication method. // AuthMethod describes an authentication method.
type AuthMethod string type AuthMethod string

View File

@ -3,9 +3,9 @@ package settings
import ( import (
"strings" "strings"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/rules" "github.com/filebrowser/filebrowser/v2/rules"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// StorageBackend is a settings storage backend. // StorageBackend is a settings storage backend.

View File

@ -3,7 +3,7 @@ package share
import ( import (
"time" "time"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
) )
// StorageBackend is the interface to implement for a share storage. // StorageBackend is the interface to implement for a share storage.

View File

@ -2,9 +2,9 @@ package bolt
import ( import (
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
) )
type authBackend struct { type authBackend struct {

View File

@ -1,12 +1,12 @@
package bolt package bolt
import ( import (
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/share" "github.com/filebrowser/filebrowser/v2/share"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// NewStorage creates a storage.Storage based on Bolt DB. // NewStorage creates a storage.Storage based on Bolt DB.

View File

@ -2,7 +2,7 @@ package bolt
import ( import (
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
) )
type settingsBackend struct { type settingsBackend struct {

View File

@ -7,12 +7,12 @@ import (
"os" "os"
"path/filepath" "path/filepath"
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/pelletier/go-toml" "github.com/pelletier/go-toml"
"gopkg.in/yaml.v2" "gopkg.in/yaml.v2"
) )

View File

@ -2,7 +2,7 @@ package importer
import ( import (
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/storage/bolt" "github.com/filebrowser/filebrowser/v2/storage/bolt"
) )
// Import imports an old configuration to a newer database. // Import imports an old configuration to a newer database.

View File

@ -6,9 +6,9 @@ import (
"path/filepath" "path/filepath"
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/rules" "github.com/filebrowser/filebrowser/v2/rules"
"github.com/filebrowser/filebrowser/storage" "github.com/filebrowser/filebrowser/v2/storage"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
"go.etcd.io/bbolt" "go.etcd.io/bbolt"
) )

View File

@ -3,8 +3,8 @@ package bolt
import ( import (
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/asdine/storm/q" "github.com/asdine/storm/q"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/share" "github.com/filebrowser/filebrowser/v2/share"
) )
type shareBackend struct { type shareBackend struct {

View File

@ -4,8 +4,8 @@ import (
"reflect" "reflect"
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
type usersBackend struct { type usersBackend struct {

View File

@ -2,7 +2,7 @@ package bolt
import ( import (
"github.com/asdine/storm" "github.com/asdine/storm"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
) )
func get(db *storm.DB, name string, to interface{}) error { func get(db *storm.DB, name string, to interface{}) error {

View File

@ -1,10 +1,10 @@
package storage package storage
import ( import (
"github.com/filebrowser/filebrowser/auth" "github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/settings" "github.com/filebrowser/filebrowser/v2/settings"
"github.com/filebrowser/filebrowser/share" "github.com/filebrowser/filebrowser/v2/share"
"github.com/filebrowser/filebrowser/users" "github.com/filebrowser/filebrowser/v2/users"
) )
// Storage is a storage powered by a Backend whih makes the neccessary // Storage is a storage powered by a Backend whih makes the neccessary

View File

@ -4,7 +4,7 @@ import (
"sync" "sync"
"time" "time"
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
) )
// StorageBackend is the interface to implement for a users storage. // StorageBackend is the interface to implement for a users storage.

View File

@ -1,12 +1,12 @@
package users package users
import ( import (
"github.com/filebrowser/filebrowser/errors" "github.com/filebrowser/filebrowser/v2/errors"
"path/filepath" "path/filepath"
"regexp" "regexp"
"github.com/filebrowser/filebrowser/files" "github.com/filebrowser/filebrowser/v2/files"
"github.com/filebrowser/filebrowser/rules" "github.com/filebrowser/filebrowser/v2/rules"
"github.com/spf13/afero" "github.com/spf13/afero"
) )