wip migrate to module

This commit is contained in:
Chakib Ben Ziane 2020-08-12 19:13:01 +01:00
parent 5898acc8f0
commit dc795166c3
19 changed files with 71 additions and 57 deletions

5
api.go
View File

@ -1,13 +1,14 @@
package main
import (
"gomark/bookmarks"
"gomark/database"
"io"
"net/http"
"os"
"strings"
"git.sp4ke.com/sp4ke/gomark/bookmarks"
"git.sp4ke.com/sp4ke/gomark/database"
"git.sp4ke.com/sp4ke/gum"
"github.com/gin-gonic/gin"
)

View File

@ -10,17 +10,18 @@ package browsers
import (
"fmt"
"gomark/database"
"gomark/index"
"gomark/logging"
"gomark/parsing"
"gomark/tree"
"gomark/watch"
"io"
"path"
"path/filepath"
"reflect"
"git.sp4ke.com/sp4ke/gomark/database"
"git.sp4ke.com/sp4ke/gomark/index"
"git.sp4ke.com/sp4ke/gomark/logging"
"git.sp4ke.com/sp4ke/gomark/parsing"
"git.sp4ke.com/sp4ke/gomark/tree"
"git.sp4ke.com/sp4ke/gomark/watch"
"github.com/fsnotify/fsnotify"
"github.com/sp4ke/hashmap"
)

View File

@ -1,17 +1,18 @@
package main
import (
"gomark/browsers"
"gomark/chrome"
"gomark/database"
"gomark/parsing"
"gomark/tree"
"gomark/utils"
"gomark/watch"
"io/ioutil"
"path"
"time"
"git.sp4ke.com/sp4ke/gomark/browsers"
"git.sp4ke.com/sp4ke/gomark/chrome"
"git.sp4ke.com/sp4ke/gomark/database"
"git.sp4ke.com/sp4ke/gomark/parsing"
"git.sp4ke.com/sp4ke/gomark/tree"
"git.sp4ke.com/sp4ke/gomark/utils"
"git.sp4ke.com/sp4ke/gomark/watch"
"github.com/OneOfOne/xxhash"
"github.com/buger/jsonparser"
"github.com/fsnotify/fsnotify"

View File

@ -1,11 +1,11 @@
package cmd
import (
"gomark/config"
"gomark/logging"
"gomark/utils"
"git.sp4ke.com/sp4ke/gomark/config"
"git.sp4ke.com/sp4ke/gomark/logging"
"git.sp4ke.com/sp4ke/gomark/utils"
cli "gopkg.in/urfave/cli.v1"
"github.com/urfave/cli/v2"
)
var log = logging.GetLogger("CMD")

View File

@ -7,7 +7,7 @@ import (
"gomark/mozilla"
"path/filepath"
cli "gopkg.in/urfave/cli.v1"
"github.com/urfave/cli/v2"
)
var fflog = logging.GetLogger("FF")

View File

@ -1,12 +1,13 @@
package cmd
import (
"gomark/config"
"gomark/mozilla"
"strings"
"git.sp4ke.com/sp4ke/gomark/config"
"git.sp4ke.com/sp4ke/gomark/mozilla"
"github.com/gobuffalo/flect"
cli "gopkg.in/urfave/cli.v1"
"github.com/urfave/cli/v2"
)
const (
@ -14,7 +15,7 @@ const (
)
var FirefoxGlobalFlags = []cli.Flag{
cli.StringFlag{
&cli.StringFlag{
Name: FirefoxDefaultProfileFlag,
Usage: "Set the default firefox `PROFILE` to use",
},

View File

@ -6,7 +6,7 @@ import (
"git.sp4ke.com/sp4ke/gum"
cli "gopkg.in/urfave/cli.v1"
"github.com/urfave/cli/v2"
)
var startServerCmd = cli.Command{

View File

@ -1,8 +1,8 @@
package main
import (
"gomark/config"
"gomark/utils"
"git.sp4ke.com/sp4ke/gomark/config"
"git.sp4ke.com/sp4ke/gomark/utils"
)
func InitDefaultConfig() {

View File

@ -1,8 +1,9 @@
package database
import (
"gomark/utils"
"path/filepath"
"git.sp4ke.com/sp4ke/gomark/utils"
)
func GetDBFullPath() string {

5
db.go
View File

@ -1,9 +1,10 @@
package main
import (
"gomark/database"
"gomark/utils"
"path/filepath"
"git.sp4ke.com/sp4ke/gomark/database"
"git.sp4ke.com/sp4ke/gomark/utils"
)
type DB = database.DB

View File

@ -6,17 +6,18 @@ import (
"database/sql"
"errors"
"fmt"
"gomark/browsers"
"gomark/database"
"gomark/mozilla"
"gomark/parsing"
"gomark/tree"
"gomark/utils"
"gomark/watch"
"path"
"path/filepath"
"time"
"git.sp4ke.com/sp4ke/gomark/browsers"
"git.sp4ke.com/sp4ke/gomark/database"
"git.sp4ke.com/sp4ke/gomark/mozilla"
"git.sp4ke.com/sp4ke/gomark/parsing"
"git.sp4ke.com/sp4ke/gomark/tree"
"git.sp4ke.com/sp4ke/gomark/utils"
"git.sp4ke.com/sp4ke/gomark/watch"
"github.com/fsnotify/fsnotify"
"github.com/jmoiron/sqlx"
sqlite3 "github.com/mattn/go-sqlite3"

2
log.go
View File

@ -1,7 +1,7 @@
package main
import (
"gomark/logging"
"git.sp4ke.com/sp4ke/gomark/logging"
)
var (

14
main.go
View File

@ -6,12 +6,14 @@
package main
import (
"gomark/cmd"
"gomark/config"
"os"
"git.sp4ke.com/sp4ke/gomark/config"
"git.sp4ke.com/sp4ke/gomark/cmd"
"github.com/urfave/cli/altsrc"
cli "gopkg.in/urfave/cli.v1"
"github.com/urfave/cli/v2"
)
func main() {
@ -19,12 +21,12 @@ func main() {
app.Name = "gomark"
app.Version = "1.0"
flags := []cli.Flag{
altsrc.NewStringFlag(cli.StringFlag{
flags := []*cli.Flag{
&altsrc.NewStringFlag(cli.StringFlag{
Name: "firefox.DefaultProfile",
}),
cli.StringFlag{
&cli.StringFlag{
Name: "config-file",
Value: config.ConfigFile,
Usage: "TOML config `FILE` path",

View File

@ -1,8 +1,8 @@
package mozilla
import (
"gomark/database"
"gomark/logging"
"git.sp4ke.com/sp4ke/gomark/database"
"git.sp4ke.com/sp4ke/gomark/logging"
)
const (

View File

@ -2,8 +2,9 @@ package mozilla
import (
"fmt"
"gomark/config"
"gomark/database"
"git.sp4ke.com/sp4ke/gomark/config"
"git.sp4ke.com/sp4ke/gomark/database"
"github.com/fatih/structs"
"github.com/mitchellh/mapstructure"

View File

@ -3,13 +3,14 @@ package mozilla
import (
"errors"
"fmt"
"gomark/config"
"gomark/profiles"
"gomark/utils"
"os"
"path/filepath"
"regexp"
"git.sp4ke.com/sp4ke/gomark/config"
"git.sp4ke.com/sp4ke/gomark/profiles"
"git.sp4ke.com/sp4ke/gomark/utils"
ini "gopkg.in/ini.v1"
)

View File

@ -3,8 +3,9 @@ package mozilla
import (
"errors"
"fmt"
"gomark/utils"
"path"
"git.sp4ke.com/sp4ke/gomark/utils"
)
const (

View File

@ -2,9 +2,10 @@ package tree
import (
"fmt"
"gomark/bookmarks"
"gomark/index"
"gomark/logging"
"git.sp4ke.com/sp4ke/gomark/bookmarks"
"git.sp4ke.com/sp4ke/gomark/index"
"git.sp4ke.com/sp4ke/gomark/logging"
"github.com/xlab/treeprint"
)

View File

@ -1,10 +1,11 @@
package utils
import (
"gomark/logging"
"gomark/watch"
"time"
"git.sp4ke.com/sp4ke/gomark/logging"
"git.sp4ke.com/sp4ke/gomark/watch"
"github.com/fsnotify/fsnotify"
)