From a49546bd6db43c4b48afbdef35bc5292ded367a8 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Wed, 10 Jun 2020 21:13:05 +0200 Subject: [PATCH] fix: migrate to gitea --- cli/daemon/daemon.go | 8 ++++---- cli/root.go | 8 ++++---- cli/sensor/sensor.go | 22 +++++++++++----------- go.mod | 5 +++-- go.sum | 4 ++++ main.go | 2 +- pkg/cli/cli.go | 2 +- pkg/config/config.go | 4 ++-- pkg/daemon/daemon.go | 10 +++++----- pkg/repository/db/db.go | 4 ++-- pkg/repository/db/postgres.go | 4 ++-- pkg/repository/db/sqlite.go | 4 ++-- pkg/repository/repository.go | 6 +++--- pkg/repository/repository_test.go | 12 ++++++------ pkg/sensor/bme280.go | 4 ++-- pkg/sensor/dht11.go | 4 ++-- pkg/sensor/dht22.go | 4 ++-- pkg/sensor/ds18b20.go | 4 ++-- pkg/sensor/interfaces.go | 3 ++- pkg/sensor/sensor.go | 2 +- 20 files changed, 61 insertions(+), 55 deletions(-) diff --git a/cli/daemon/daemon.go b/cli/daemon/daemon.go index a0f22de..e5880d6 100644 --- a/cli/daemon/daemon.go +++ b/cli/daemon/daemon.go @@ -3,10 +3,10 @@ package daemon import ( "fmt" + "git.cryptic.systems/volker.raschek/flucky/pkg/config" + "git.cryptic.systems/volker.raschek/flucky/pkg/daemon" + "git.cryptic.systems/volker.raschek/go-logger" "github.com/spf13/cobra" - "github.com/volker-raschek/flucky/pkg/config" - "github.com/volker-raschek/flucky/pkg/daemon" - "github.com/volker-raschek/go-logger/pkg/logger" ) // InitCmd initialize all daemon subcommands @@ -37,7 +37,7 @@ func run(cmd *cobra.Command, args []string) error { // return fmt.Errorf("No loglevel defined: %v", err) // } - flogger := logger.NewDefaultLogger(logger.LogLevelDebug) + flogger := logger.NewLogger(logger.LogLevelDebug) cnf, err := config.Read(configFile) if err != nil { diff --git a/cli/root.go b/cli/root.go index 44a7341..ec235c0 100644 --- a/cli/root.go +++ b/cli/root.go @@ -8,11 +8,11 @@ import ( "path/filepath" "time" + "git.cryptic.systems/volker.raschek/flucky/cli/daemon" + "git.cryptic.systems/volker.raschek/flucky/cli/sensor" + "git.cryptic.systems/volker.raschek/flucky/pkg/config" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" "github.com/Masterminds/semver" - "github.com/volker-raschek/flucky/cli/daemon" - "github.com/volker-raschek/flucky/cli/sensor" - "github.com/volker-raschek/flucky/pkg/config" - "github.com/volker-raschek/flucky/pkg/types" uuid "github.com/satori/go.uuid" "github.com/spf13/cobra" diff --git a/cli/sensor/sensor.go b/cli/sensor/sensor.go index 3cc0014..3f27246 100644 --- a/cli/sensor/sensor.go +++ b/cli/sensor/sensor.go @@ -5,13 +5,13 @@ import ( "net/url" "os" + "git.cryptic.systems/volker.raschek/flucky/pkg/cli" + "git.cryptic.systems/volker.raschek/flucky/pkg/config" + "git.cryptic.systems/volker.raschek/flucky/pkg/repository" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/go-logger" uuid "github.com/satori/go.uuid" "github.com/spf13/cobra" - "github.com/volker-raschek/flucky/pkg/cli" - "github.com/volker-raschek/flucky/pkg/config" - "github.com/volker-raschek/flucky/pkg/repository" - "github.com/volker-raschek/flucky/pkg/types" - "github.com/volker-raschek/go-logger/pkg/logger" ) // InitCmd initialize all sensor subcommands @@ -174,7 +174,7 @@ func addSensor(cmd *cobra.Command, args []string) error { // return fmt.Errorf("No loglevel defined") // } - flogger := logger.NewDefaultLogger(logger.LogLevelDebug) + flogger := logger.NewLogger(logger.LogLevelDebug) repo, err := repository.New(dsnURL, flogger) if err != nil { @@ -218,7 +218,7 @@ func disableSensor(cmd *cobra.Command, args []string) error { // return fmt.Errorf("No loglevel defined") // } - flogger := logger.NewDefaultLogger(logger.LogLevelDebug) + flogger := logger.NewLogger(logger.LogLevelDebug) repo, err := repository.New(dsnURL, flogger) if err != nil { @@ -250,7 +250,7 @@ func enableSensor(cmd *cobra.Command, args []string) error { // return fmt.Errorf("No loglevel defined") // } - flogger := logger.NewDefaultLogger(logger.LogLevelDebug) + flogger := logger.NewLogger(logger.LogLevelDebug) repo, err := repository.New(dsnURL, flogger) if err != nil { @@ -282,7 +282,7 @@ func listSensors(cmd *cobra.Command, args []string) error { // return fmt.Errorf("No loglevel defined") // } - flogger := logger.NewDefaultLogger(logger.LogLevelDebug) + flogger := logger.NewLogger(logger.LogLevelDebug) repo, err := repository.New(dsnURL, flogger) if err != nil { @@ -325,7 +325,7 @@ func removeSensor(cmd *cobra.Command, args []string) error { // return fmt.Errorf("No loglevel defined") // } - flogger := logger.NewDefaultLogger(logger.LogLevelDebug) + flogger := logger.NewLogger(logger.LogLevelDebug) repo, err := repository.New(dsnURL, flogger) if err != nil { @@ -357,7 +357,7 @@ func renameSensor(cmd *cobra.Command, args []string) error { // return fmt.Errorf("No loglevel defined") // } - flogger := logger.NewDefaultLogger(logger.LogLevelDebug) + flogger := logger.NewLogger(logger.LogLevelDebug) repo, err := repository.New(dsnURL, flogger) if err != nil { diff --git a/go.mod b/go.mod index c234172..c7e1166 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,9 @@ -module github.com/volker-raschek/flucky +module git.cryptic.systems/volker.raschek/flucky go 1.14 require ( + git.cryptic.systems/volker.raschek/go-logger v0.1.0 github.com/Masterminds/semver v1.5.0 github.com/d2r2/go-bsbmp v0.0.0-20190515110334-3b4b3aea8375 github.com/d2r2/go-i2c v0.0.0-20191123181816-73a8a799d6bc @@ -17,6 +18,6 @@ require ( github.com/opencontainers/go-digest v1.0.0 // indirect github.com/satori/go.uuid v1.2.0 github.com/spf13/cobra v1.0.0 - github.com/stretchr/testify v1.6.0 + github.com/stretchr/testify v1.6.1 github.com/volker-raschek/go-logger v0.1.0 ) diff --git a/go.sum b/go.sum index d5c6758..8961e3c 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +git.cryptic.systems/volker.raschek/go-logger v0.1.0 h1:JHBDesKBZaXjc2AlqYms1T3dGIX0oNIOBWl4cnVFWIo= +git.cryptic.systems/volker.raschek/go-logger v0.1.0/go.mod h1:GqeuxFj64SAolfj5kpbWup6E1vv37SaH5S+4wa40Tqs= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= @@ -155,6 +157,8 @@ github.com/stretchr/testify v1.5.1 h1:nOGnQDM7FYENwehXlg/kFVnos3rEvtKTjRvOWSzb6H github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/volker-raschek/go-logger v0.1.0 h1:BJPK4wCfcWlQYnOQC7ORU4LlMSgEYcwvpXQFs2rdPhE= diff --git a/main.go b/main.go index 9eea114..941b5f5 100644 --- a/main.go +++ b/main.go @@ -4,8 +4,8 @@ import ( "log" "os" + "git.cryptic.systems/volker.raschek/flucky/cli" "github.com/Masterminds/semver" - "github.com/volker-raschek/flucky/cli" ) var ( diff --git a/pkg/cli/cli.go b/pkg/cli/cli.go index 8086ca9..c521bf4 100644 --- a/pkg/cli/cli.go +++ b/pkg/cli/cli.go @@ -5,7 +5,7 @@ import ( "io" "text/tabwriter" - "github.com/volker-raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" ) // PrintSensors displays a list with all configured sensors diff --git a/pkg/config/config.go b/pkg/config/config.go index 7685e72..816ef04 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -8,10 +8,10 @@ import ( "time" - "github.com/volker-raschek/flucky/pkg/internal/format" + "git.cryptic.systems/volker.raschek/flucky/pkg/internal/format" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" uuid "github.com/satori/go.uuid" - "github.com/volker-raschek/flucky/pkg/types" ) var ( diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 5f4990a..b208ecc 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -7,11 +7,11 @@ import ( "os/signal" "syscall" - "github.com/volker-raschek/flucky/pkg/config" - "github.com/volker-raschek/flucky/pkg/repository" - "github.com/volker-raschek/flucky/pkg/sensor" - "github.com/volker-raschek/flucky/pkg/types" - "github.com/volker-raschek/go-logger/pkg/logger" + "git.cryptic.systems/volker.raschek/flucky/pkg/config" + "git.cryptic.systems/volker.raschek/flucky/pkg/repository" + "git.cryptic.systems/volker.raschek/flucky/pkg/sensor" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/go-logger" ) func Start(cnf *config.Config, flogger logger.Logger) error { diff --git a/pkg/repository/db/db.go b/pkg/repository/db/db.go index 62bf605..5a58b96 100644 --- a/pkg/repository/db/db.go +++ b/pkg/repository/db/db.go @@ -9,8 +9,8 @@ import ( "path/filepath" "strings" - "github.com/volker-raschek/flucky/pkg/types" - "github.com/volker-raschek/go-logger/pkg/logger" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/go-logger" ) // Database is a general interface for a database backend like postgres, oracle diff --git a/pkg/repository/db/postgres.go b/pkg/repository/db/postgres.go index d2f7c1b..ef9806f 100644 --- a/pkg/repository/db/postgres.go +++ b/pkg/repository/db/postgres.go @@ -6,9 +6,9 @@ import ( "fmt" "time" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/go-logger" _ "github.com/lib/pq" - "github.com/volker-raschek/flucky/pkg/types" - "github.com/volker-raschek/go-logger/pkg/logger" ) // Postgres implementation diff --git a/pkg/repository/db/sqlite.go b/pkg/repository/db/sqlite.go index 8b69228..73821a9 100644 --- a/pkg/repository/db/sqlite.go +++ b/pkg/repository/db/sqlite.go @@ -5,9 +5,9 @@ import ( "database/sql" "fmt" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/go-logger" _ "github.com/mattn/go-sqlite3" - "github.com/volker-raschek/flucky/pkg/types" - "github.com/volker-raschek/go-logger/pkg/logger" ) // SQLite implementation diff --git a/pkg/repository/repository.go b/pkg/repository/repository.go index 5005773..5250039 100644 --- a/pkg/repository/repository.go +++ b/pkg/repository/repository.go @@ -5,9 +5,9 @@ import ( "net/url" "strings" - "github.com/volker-raschek/flucky/pkg/repository/db" - "github.com/volker-raschek/flucky/pkg/types" - "github.com/volker-raschek/go-logger/pkg/logger" + "git.cryptic.systems/volker.raschek/flucky/pkg/repository/db" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/go-logger" ) // Repository represent a repository where all devices, sensors and measured diff --git a/pkg/repository/repository_test.go b/pkg/repository/repository_test.go index 050f1ab..9e83006 100644 --- a/pkg/repository/repository_test.go +++ b/pkg/repository/repository_test.go @@ -12,12 +12,12 @@ import ( "testing" "time" + "git.cryptic.systems/volker.raschek/flucky/pkg/repository" + "git.cryptic.systems/volker.raschek/flucky/pkg/testutils/dockerutils" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/go-logger" uuid "github.com/satori/go.uuid" "github.com/stretchr/testify/require" - "github.com/volker-raschek/flucky/pkg/repository" - "github.com/volker-raschek/flucky/pkg/testutils/dockerutils" - "github.com/volker-raschek/flucky/pkg/types" - "github.com/volker-raschek/go-logger/pkg/logger" ) func TestPostgresBackend(t *testing.T) { @@ -48,7 +48,7 @@ func TestPostgresBackend(t *testing.T) { dsnURL, err := url.Parse(fmt.Sprintf("postgres://postgres:%v@127.0.0.1:%v?sslmode=disable", postgresDBPasswort, postgresHostPort)) require.NoError(err) - repo, err := repository.New(dsnURL, logger.NewDefaultLogger(logger.LogLevelDebug)) + repo, err := repository.New(dsnURL, logger.NewLogger(logger.LogLevelDebug)) require.NoError(err) testBackend(t, repo) @@ -64,7 +64,7 @@ func TestSQLiteBackend(t *testing.T) { dsnURL, err := url.Parse(fmt.Sprintf("sqlite3://%v/test.db", workspace)) require.NoError(err) - repo, err := repository.New(dsnURL, logger.NewDefaultLogger(logger.LogLevelDebug)) + repo, err := repository.New(dsnURL, logger.NewLogger(logger.LogLevelDebug)) require.NoError(err) testBackend(t, repo) diff --git a/pkg/sensor/bme280.go b/pkg/sensor/bme280.go index 564c7c8..318e867 100644 --- a/pkg/sensor/bme280.go +++ b/pkg/sensor/bme280.go @@ -9,8 +9,8 @@ import ( "github.com/d2r2/go-logger" uuid "github.com/satori/go.uuid" - "github.com/volker-raschek/flucky/pkg/internal/format" - "github.com/volker-raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/flucky/pkg/internal/format" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" ) // BME280 is a sensor to measure humidity and temperature. diff --git a/pkg/sensor/dht11.go b/pkg/sensor/dht11.go index 2e9a903..379567c 100644 --- a/pkg/sensor/dht11.go +++ b/pkg/sensor/dht11.go @@ -4,10 +4,10 @@ import ( "fmt" "sync" + "git.cryptic.systems/volker.raschek/flucky/pkg/internal/format" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" "github.com/go-flucky/go-dht" uuid "github.com/satori/go.uuid" - "github.com/volker-raschek/flucky/pkg/internal/format" - "github.com/volker-raschek/flucky/pkg/types" ) // DHT11 is a sensor to measure humidity and temperature. diff --git a/pkg/sensor/dht22.go b/pkg/sensor/dht22.go index 4ccf738..0249f37 100644 --- a/pkg/sensor/dht22.go +++ b/pkg/sensor/dht22.go @@ -4,10 +4,10 @@ import ( "fmt" "sync" + "git.cryptic.systems/volker.raschek/flucky/pkg/internal/format" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" "github.com/go-flucky/go-dht" uuid "github.com/satori/go.uuid" - "github.com/volker-raschek/flucky/pkg/internal/format" - "github.com/volker-raschek/flucky/pkg/types" ) // DHT22 is a sensor to measure humidity and temperature. diff --git a/pkg/sensor/ds18b20.go b/pkg/sensor/ds18b20.go index 59c8c8d..c8ac21e 100644 --- a/pkg/sensor/ds18b20.go +++ b/pkg/sensor/ds18b20.go @@ -9,9 +9,9 @@ import ( "strings" "sync" + "git.cryptic.systems/volker.raschek/flucky/pkg/internal/format" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" uuid "github.com/satori/go.uuid" - "github.com/volker-raschek/flucky/pkg/internal/format" - "github.com/volker-raschek/flucky/pkg/types" ) // DS18B20 is a sensor to measure humidity and temperature. diff --git a/pkg/sensor/interfaces.go b/pkg/sensor/interfaces.go index 114df6b..4acdb3b 100644 --- a/pkg/sensor/interfaces.go +++ b/pkg/sensor/interfaces.go @@ -1,8 +1,9 @@ package sensor import ( - "github.com/volker-raschek/flucky/pkg/types" "time" + + "git.cryptic.systems/volker.raschek/flucky/pkg/types" ) type Sensor interface { diff --git a/pkg/sensor/sensor.go b/pkg/sensor/sensor.go index d7838d8..aa00abb 100644 --- a/pkg/sensor/sensor.go +++ b/pkg/sensor/sensor.go @@ -4,7 +4,7 @@ import ( "errors" "sync" - "github.com/volker-raschek/flucky/pkg/types" + "git.cryptic.systems/volker.raschek/flucky/pkg/types" ) var (