diff --git a/README.md b/README.md index b814ce3..378e0f3 100644 --- a/README.md +++ b/README.md @@ -236,10 +236,13 @@ In order to decide if Kelvin suits your needs and works in your setup, it helps 3. ***The light is turned off:*** Kelvin will clear the last known state and do nothing. # Development & Participation -If you want to tinker with Kelvin and it's inner workings, feel free to do so. To get started you can simple clone the main repository into your `GOPATH` by executing the following commands: +If you want to tinker with Kelvin and it's inner workings, feel free to do so. Kelvin uses the Go Modules support built into Go 1.11. To get started you can simply clone the main repository outside of `GOPATH` by executing the following commands (feel free to change `src` to the directory of your choice): ``` -cd $GOPATH -go get -v github.com/stefanwichmann/kelvin +mkdir $HOME/src +cd $HOME/src +git clone https://github.com/stefanwichmann/kelvin.git +cd kelvin +go build ``` Make sure you have set up your [go](https://www.golang.org) development environment by following the steps in the official [documentation](https://golang.org/doc/). diff --git a/archive.go b/archive.go index 9002807..2d90fec 100644 --- a/archive.go +++ b/archive.go @@ -26,7 +26,7 @@ import ( "archive/zip" "compress/gzip" "errors" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "io" "io/ioutil" "os" diff --git a/bridge.go b/bridge.go index bd2deb2..1a30e6d 100644 --- a/bridge.go +++ b/bridge.go @@ -31,7 +31,7 @@ import ( "strings" "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" hue "github.com/stefanwichmann/go.hue" ) diff --git a/configuration.go b/configuration.go index f645aa5..f499623 100644 --- a/configuration.go +++ b/configuration.go @@ -30,7 +30,7 @@ import ( "os" "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/ghodss/yaml" ) diff --git a/configuration_migration.go b/configuration_migration.go index 95e4fc9..08a29ee 100644 --- a/configuration_migration.go +++ b/configuration_migration.go @@ -23,7 +23,7 @@ package main import "time" import "fmt" -import log "github.com/Sirupsen/logrus" +import log "github.com/sirupsen/logrus" func (configuration *Configuration) migrateToLatestVersion() { log.Debugf("⚙ Migrating configuration to latest version...") diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..194bf92 --- /dev/null +++ b/go.mod @@ -0,0 +1,18 @@ +module github.com/sarangak/kelvin + +go 1.14 + +require ( + github.com/Masterminds/semver v1.5.0 + github.com/bt51/ntpclient v0.0.0-20140310165113-3045f71e2530 + github.com/btittelbach/astrotime v0.0.0-20160515101311-7ddba43aa26e + github.com/ghodss/yaml v1.0.0 + github.com/gorilla/handlers v1.4.2 + github.com/gorilla/mux v1.7.4 + github.com/onsi/ginkgo v1.12.0 // indirect + github.com/onsi/gomega v1.9.0 // indirect + github.com/sirupsen/logrus v1.5.0 + github.com/stefanwichmann/go.hue v0.0.0-20191102085005-2bc19682969e + github.com/stefanwichmann/lanscan v0.0.0-20190324154315-2a77f896f93a // indirect + gopkg.in/yaml.v2 v2.2.8 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..a75963b --- /dev/null +++ b/go.sum @@ -0,0 +1,60 @@ +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/bt51/ntpclient v0.0.0-20140310165113-3045f71e2530 h1:2W1J2qL8feh1Av0KJq5cbBACg+lx6DfIm18vt45P+DA= +github.com/bt51/ntpclient v0.0.0-20140310165113-3045f71e2530/go.mod h1:OahuhAz81f/KxpjyyO0H3rTNypHk3qd9s8BWriP7DAI= +github.com/btittelbach/astrotime v0.0.0-20160515101311-7ddba43aa26e h1:yPRY9/vyatroUweN7ntWNO1JMJyIdyx+JnBOobhCkRI= +github.com/btittelbach/astrotime v0.0.0-20160515101311-7ddba43aa26e/go.mod h1:jNKwDmwLM4+wENDkph85EVnlfuZ3o+MBtzFD8AiQK48= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/gorilla/handlers v1.4.2 h1:0QniY0USkHQ1RGCLfKxeNHK9bkDHGRYGNDFBCS+YARg= +github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= +github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.0 h1:Iw5WCbBcaAAd0fpRb1c9r5YCylv4XDoCSigm1zLevwU= +github.com/onsi/ginkgo v1.12.0/go.mod h1:oUhWkIvk5aDxtKvDDuw8gItl8pKl42LzjC9KZE0HfGg= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.9.0 h1:R1uwffexN6Pr340GtYRIdZmAiN4J+iw6WG4wog1DUXg= +github.com/onsi/gomega v1.9.0/go.mod h1:Ho0h+IUsWyvy1OpqCwxlQ/21gkhVunqlU8fDGcoTdcA= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sirupsen/logrus v1.5.0 h1:1N5EYkVAPEywqZRJd7cwnRtCb6xJx7NH3T3WUTF980Q= +github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo= +github.com/stefanwichmann/go.hue v0.0.0-20191102085005-2bc19682969e h1:dlt0K5l0/b5aKYcvcZQxS9eKB/oULfIgIPsMqvg4bUY= +github.com/stefanwichmann/go.hue v0.0.0-20191102085005-2bc19682969e/go.mod h1:zZj/cmketnAGzBubTUuPi9mZPC6dyzbJMIWeQTtAx68= +github.com/stefanwichmann/lanscan v0.0.0-20190324154315-2a77f896f93a h1:euRDD9Q8H1dItIr67JeUlPNJjTpXNqAuR7i3ujA2ELI= +github.com/stefanwichmann/lanscan v0.0.0-20190324154315-2a77f896f93a/go.mod h1:O59XMDOTv29FsoW1Rnm/nj3W0hZyJOMaHR/bQvCOBjs= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd h1:nTDtHvHSdCn1m6ITfMRqtOd/9+7a3s8RBNOZ3eYZzJA= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894 h1:Cz4ceDQGXuKRnVBDTS23GTn/pU5OE2C0WrNTOYK1Uuc= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e h1:N7DeIrjYszNmSW409R3frPPwglRwMkXSBzwVbkOjLLA= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7 h1:9zdDQZ7Thm29KFXgAX/+yaf3eVbP7djjWp/dXAppNCc= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/huelight.go b/huelight.go index c8b9390..f0eff3f 100644 --- a/huelight.go +++ b/huelight.go @@ -26,7 +26,7 @@ import ( "strconv" "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" hue "github.com/stefanwichmann/go.hue" ) diff --git a/interval.go b/interval.go index 52f7458..9a43c8d 100644 --- a/interval.go +++ b/interval.go @@ -22,7 +22,7 @@ package main import "time" -import log "github.com/Sirupsen/logrus" +import log "github.com/sirupsen/logrus" // Interval represents a time range of one day with // the given start and end configurations. diff --git a/kelvin.go b/kelvin.go index 23896a9..77ecea2 100644 --- a/kelvin.go +++ b/kelvin.go @@ -29,7 +29,7 @@ import ( "syscall" "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) var applicationVersion = "development" diff --git a/light.go b/light.go index 34a2490..df27809 100644 --- a/light.go +++ b/light.go @@ -24,7 +24,7 @@ package main import ( "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" hue "github.com/stefanwichmann/go.hue" ) diff --git a/lightstate.go b/lightstate.go index d15f811..b995777 100644 --- a/lightstate.go +++ b/lightstate.go @@ -21,7 +21,7 @@ // SOFTWARE. package main -import log "github.com/Sirupsen/logrus" +import log "github.com/sirupsen/logrus" // LightState represents a light configuration. // It can be read from or written to the physical lights. diff --git a/location.go b/location.go index 141ac82..43ff0a4 100644 --- a/location.go +++ b/location.go @@ -30,7 +30,7 @@ import ( "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" "github.com/btittelbach/astrotime" ) diff --git a/scenes.go b/scenes.go index 90048d7..9e7ae3b 100644 --- a/scenes.go +++ b/scenes.go @@ -21,7 +21,7 @@ // SOFTWARE. package main -import log "github.com/Sirupsen/logrus" +import log "github.com/sirupsen/logrus" import hue "github.com/stefanwichmann/go.hue" import "time" import "strings" diff --git a/schedule.go b/schedule.go index aa8dbe9..a80ccd6 100644 --- a/schedule.go +++ b/schedule.go @@ -25,7 +25,7 @@ import ( "fmt" "time" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) // Schedule represents all relevants timestamps of one day. diff --git a/upgrade.go b/upgrade.go index a895cdb..e1f6aa5 100644 --- a/upgrade.go +++ b/upgrade.go @@ -21,7 +21,7 @@ // SOFTWARE. package main -import log "github.com/Sirupsen/logrus" +import log "github.com/sirupsen/logrus" import "runtime" import "path/filepath" import "github.com/Masterminds/semver" diff --git a/webinterface.go b/webinterface.go index 3055815..2a86723 100644 --- a/webinterface.go +++ b/webinterface.go @@ -21,7 +21,7 @@ // SOFTWARE. package main -import log "github.com/Sirupsen/logrus" +import log "github.com/sirupsen/logrus" import "net/http" import "html/template" import "github.com/gorilla/mux"