From dc795166c39710071f8ab0995d6b0be745f4fb68 Mon Sep 17 00:00:00 2001 From: Chakib Ben Ziane Date: Wed, 12 Aug 2020 19:13:01 +0100 Subject: [PATCH] wip migrate to module --- api.go | 5 +++-- browsers/base.go | 13 +++++++------ chrome.go | 15 ++++++++------- cmd/config_commands.go | 8 ++++---- cmd/firefox_commands.go | 2 +- cmd/firefox_flags.go | 9 +++++---- commands.go | 2 +- config.go | 4 ++-- database/utils.go | 3 ++- db.go | 5 +++-- firefox.go | 15 ++++++++------- log.go | 2 +- main.go | 14 ++++++++------ mozilla/config.go | 4 ++-- mozilla/firefox_config.go | 5 +++-- mozilla/firefox_profiles.go | 7 ++++--- mozilla/firefox_vfs.go | 3 ++- tree/tree.go | 7 ++++--- utils/events.go | 5 +++-- 19 files changed, 71 insertions(+), 57 deletions(-) diff --git a/api.go b/api.go index 6562915..66552ac 100644 --- a/api.go +++ b/api.go @@ -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" ) diff --git a/browsers/base.go b/browsers/base.go index 2a24c73..aa4c99e 100644 --- a/browsers/base.go +++ b/browsers/base.go @@ -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" ) diff --git a/chrome.go b/chrome.go index e7445eb..42da8d8 100644 --- a/chrome.go +++ b/chrome.go @@ -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" diff --git a/cmd/config_commands.go b/cmd/config_commands.go index 78b2a8d..28e6478 100644 --- a/cmd/config_commands.go +++ b/cmd/config_commands.go @@ -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") diff --git a/cmd/firefox_commands.go b/cmd/firefox_commands.go index 6393926..e35d3cd 100644 --- a/cmd/firefox_commands.go +++ b/cmd/firefox_commands.go @@ -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") diff --git a/cmd/firefox_flags.go b/cmd/firefox_flags.go index b5b4ee9..d0e7c9a 100644 --- a/cmd/firefox_flags.go +++ b/cmd/firefox_flags.go @@ -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", }, diff --git a/commands.go b/commands.go index 8018959..0f68bea 100644 --- a/commands.go +++ b/commands.go @@ -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{ diff --git a/config.go b/config.go index 6f2c155..a5960af 100644 --- a/config.go +++ b/config.go @@ -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() { diff --git a/database/utils.go b/database/utils.go index b56e58c..c6777c2 100644 --- a/database/utils.go +++ b/database/utils.go @@ -1,8 +1,9 @@ package database import ( - "gomark/utils" "path/filepath" + + "git.sp4ke.com/sp4ke/gomark/utils" ) func GetDBFullPath() string { diff --git a/db.go b/db.go index 38331f4..42f5852 100644 --- a/db.go +++ b/db.go @@ -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 diff --git a/firefox.go b/firefox.go index cd574ae..4d8cc5e 100644 --- a/firefox.go +++ b/firefox.go @@ -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" diff --git a/log.go b/log.go index 80f7061..bc85dc0 100644 --- a/log.go +++ b/log.go @@ -1,7 +1,7 @@ package main import ( - "gomark/logging" + "git.sp4ke.com/sp4ke/gomark/logging" ) var ( diff --git a/main.go b/main.go index 30b1f4c..c8f2ac5 100644 --- a/main.go +++ b/main.go @@ -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", diff --git a/mozilla/config.go b/mozilla/config.go index d507c2a..c50e525 100644 --- a/mozilla/config.go +++ b/mozilla/config.go @@ -1,8 +1,8 @@ package mozilla import ( - "gomark/database" - "gomark/logging" + "git.sp4ke.com/sp4ke/gomark/database" + "git.sp4ke.com/sp4ke/gomark/logging" ) const ( diff --git a/mozilla/firefox_config.go b/mozilla/firefox_config.go index 45800e6..4aca36c 100644 --- a/mozilla/firefox_config.go +++ b/mozilla/firefox_config.go @@ -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" diff --git a/mozilla/firefox_profiles.go b/mozilla/firefox_profiles.go index 5d4f914..0303da5 100644 --- a/mozilla/firefox_profiles.go +++ b/mozilla/firefox_profiles.go @@ -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" ) diff --git a/mozilla/firefox_vfs.go b/mozilla/firefox_vfs.go index 68d32d7..f1123d0 100644 --- a/mozilla/firefox_vfs.go +++ b/mozilla/firefox_vfs.go @@ -3,8 +3,9 @@ package mozilla import ( "errors" "fmt" - "gomark/utils" "path" + + "git.sp4ke.com/sp4ke/gomark/utils" ) const ( diff --git a/tree/tree.go b/tree/tree.go index c4368e7..2d3f272 100644 --- a/tree/tree.go +++ b/tree/tree.go @@ -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" ) diff --git a/utils/events.go b/utils/events.go index 9e86b38..f478db3 100644 --- a/utils/events.go +++ b/utils/events.go @@ -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" )