fix: migrate to gitea
This commit is contained in:
parent
940e04371c
commit
a49546bd6d
@ -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 {
|
||||
|
@ -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"
|
||||
|
@ -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 {
|
||||
|
5
go.mod
5
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
|
||||
)
|
||||
|
4
go.sum
4
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=
|
||||
|
2
main.go
2
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 (
|
||||
|
@ -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
|
||||
|
@ -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 (
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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.
|
||||
|
@ -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 {
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"errors"
|
||||
"sync"
|
||||
|
||||
"github.com/volker-raschek/flucky/pkg/types"
|
||||
"git.cryptic.systems/volker.raschek/flucky/pkg/types"
|
||||
)
|
||||
|
||||
var (
|
||||
|
Loading…
Reference in New Issue
Block a user