From 5c657d96300b495148d0f20b9ed7ada8cd859580 Mon Sep 17 00:00:00 2001 From: sentriz Date: Fri, 17 May 2019 13:14:51 +0100 Subject: [PATCH] cleanup --- .gitignore | 1 + TODO | 72 ------------ cmd/scanner/main.go | 14 ++- cmd/server/main.go | 2 +- db/model.go | 28 +++-- go.mod | 22 ---- go.sum | 191 ------------------------------- handler/handler_sub_by_folder.go | 111 +++++++++++++++--- handler/handler_sub_by_tags.go | 97 +++++++++------- handler/handler_sub_common.go | 12 +- scanback | 39 ------- subsonic/media.go | 118 +++++++++++-------- subsonic/response.go | 29 ++--- 13 files changed, 272 insertions(+), 464 deletions(-) delete mode 100644 TODO delete mode 100644 scanback diff --git a/.gitignore b/.gitignore index 698373f..80d841f 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ scanner server cmd/scanner/scanner cmd/server/server +_test* diff --git a/TODO b/TODO deleted file mode 100644 index d7d0706..0000000 --- a/TODO +++ /dev/null @@ -1,72 +0,0 @@ -2019/05/07 14:34:55 entering folder `/home/senan/music` -2019/05/07 14:34:55 entering folder `/home/senan/music/A Certain Ratio` -2019/05/07 14:34:55 entering folder `/home/senan/music/A Certain Ratio/(1994) The Graveyard and the Ballroom` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/A Certain Ratio/(1994) The Graveyard and the Ballroom` -2019/05/07 14:34:55 entering folder `/home/senan/music/A Certain Ratio/(1981) To Each.` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/A Certain Ratio/(1981) To Each.` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/A Certain Ratio` -2019/05/07 14:34:55 entering folder `/home/senan/music/13th Floor Elevators` -2019/05/07 14:34:55 entering folder `/home/senan/music/13th Floor Elevators/(1966) The Psychedelic Sounds of the 13th Floor Elevators` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/13th Floor Elevators/(1966) The Psychedelic Sounds of the 13th Floor Elevators` -2019/05/07 14:34:55 entering folder `/home/senan/music/13th Floor Elevators/(1967) Easter Everywhere` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/13th Floor Elevators/(1967) Easter Everywhere` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/13th Floor Elevators` -2019/05/07 14:34:55 entering folder `/home/senan/music/Anika` -2019/05/07 14:34:55 entering folder `/home/senan/music/Anika/Hello` -2019/05/07 14:34:55 entering folder `/home/senan/music/Anika/Hello/There` -2019/05/07 14:34:55 entering folder `/home/senan/music/Anika/Hello/There/(2010) Anika` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/Hello/There/(2010) Anika` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/Hello/There` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/Hello` -2019/05/07 14:34:55 entering folder `/home/senan/music/Anika/No Music Here` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/No Music Here` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music` -2019/05/07 14:34:55 scanned in 364.785µs -2019/05/07 14:34:55 cleaned in 106.441µs - -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/A Certain Ratio/(1994) The Graveyard and the Ballroom` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/A Certain Ratio/(1981) To Each.` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/A Certain Ratio` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/13th Floor Elevators/(1966) The Psychedelic Sounds of the 13th Floor Elevators` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/13th Floor Elevators/(1967) Easter Everywhere` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/13th Floor Elevators` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/Hello/There/(2010) Anika` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/Hello/There` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/Hello` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika/No Music Here` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music/Anika` -2019/05/07 14:34:55 ___ processed folder `/home/senan/music` -2019/05/07 14:34:55 scanned in 364.785µs -2019/05/07 14:34:55 cleaned in 106.441µs - -// handleFolder is for browse by folders, while handleTrack is for both -func handleFolder(fullPath string, stat os.FileInfo) error { - log.Printf("entering folder `%s`", fullPath) - return nil - // this must be run before any tracks so that seenDirs is - // correct for the coming tracks - modTime := stat.ModTime() - folder := db.Folder{ - Path: fullPath, - } - // skip if the record exists and hasn't been modified since - // the last scan - err := tx.Where(folder).First(&folder).Error - if !gorm.IsRecordNotFoundError(err) && - modTime.Before(folder.UpdatedAt) { - // even though we don't want to update this record, - // add it to seenDirs now that we have the id - seenDirs.Push(folder.ID) - return nil - } - _, folderName := path.Split(fullPath) - folder.ParentID = seenDirs.Peek() - folder.Name = folderName - // save the record with new parent id, then add the new - // current id to seenDirs - tx.Save(&folder) - seenDirs.Push(folder.ID) - return nil -} - diff --git a/cmd/scanner/main.go b/cmd/scanner/main.go index 24f9b9e..e190a6a 100644 --- a/cmd/scanner/main.go +++ b/cmd/scanner/main.go @@ -126,13 +126,19 @@ func handleFolder(fullPath string, stat os.FileInfo) error { func handleFolderCompletion(fullPath string, info *godirwalk.Dirent) error { currentDir := currentDirStack.Peek() defer currentDirStack.Pop() - if currentCover.NewlyInserted { - currentDir.CoverID = currentCover.ID - tx.Save(currentDir) - } + var dirShouldSave bool if currentAlbum.ID != 0 { currentAlbum.CoverID = currentCover.ID tx.Save(currentAlbum) + currentDir.HasTracks = true + dirShouldSave = true + } + if currentCover.NewlyInserted { + currentDir.CoverID = currentCover.ID + dirShouldSave = true + } + if dirShouldSave { + tx.Save(currentDir) } currentCover = &db.Cover{} currentAlbum = &db.Album{} diff --git a/cmd/server/main.go b/cmd/server/main.go index d5c10c7..3bf08f6 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -140,7 +140,7 @@ func setAdminRoutes(cont handler.Controller, mux *http.ServeMux) { } func main() { - address := ":6969" + address := "0.0.0.0:6969" mux := http.NewServeMux() // create a new controller and pass a copy to both routes. // they will add more fields to their copy if they need them diff --git a/db/model.go b/db/model.go index 917c456..fb00180 100644 --- a/db/model.go +++ b/db/model.go @@ -49,6 +49,7 @@ type Track struct { Suffix string ContentType string Size int + Folder Folder FolderID int Path string `gorm:"not null;unique_index"` } @@ -82,22 +83,25 @@ type Setting struct { // Play represents the settings table type Play struct { IDBase - User User - UserID int `gorm:"not null;index"` - Album Album - AlbumID int `gorm:"not null;index"` - Time time.Time - Count int + User User + UserID int `gorm:"not null;index"` + Album Album + AlbumID int `gorm:"not null;index"` + Folder Folder + FolderID int `gorm:"not null;index"` + Time time.Time + Count int } // Folder represents the settings table type Folder struct { IDBase CrudBase - Name string - Path string `gorm:"not null;unique_index"` - Parent *Folder `gorm:"foreignkey:ParentID"` - ParentID int - CoverID int - Cover Cover + Name string + Path string `gorm:"not null;unique_index"` + Parent *Folder + ParentID int + CoverID int + HasTracks bool `gorm:"not null;index"` + Cover Cover } diff --git a/go.mod b/go.mod index ebdcdc9..702a5cb 100644 --- a/go.mod +++ b/go.mod @@ -2,47 +2,25 @@ module github.com/sentriz/gonic require ( cloud.google.com/go v0.37.1 // indirect - github.com/cosiner/argv v0.0.1 // indirect - github.com/cpuguy83/go-md2man v1.0.10 // indirect - github.com/davecgh/go-spew v1.1.1 - github.com/davidrjenni/reftools v0.0.0-20190411195930-981bbac422f8 // indirect github.com/denisenkom/go-mssqldb v0.0.0-20190315220205-a8ed825ac853 // indirect github.com/dhowden/tag v0.0.0-20181104225729-a9f04c2798ca github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 // indirect - github.com/fatih/motion v0.0.0-20180408211639-218875ebe238 // indirect - github.com/go-delve/delve v1.2.0 // indirect github.com/go-sql-driver/mysql v1.4.1 // indirect github.com/gobuffalo/genny v0.1.1 // indirect github.com/gobuffalo/gogen v0.1.1 // indirect github.com/gobuffalo/packr/v2 v2.2.0 github.com/gofrs/uuid v3.2.0+incompatible // indirect - github.com/golangci/golangci-lint v1.16.0 // indirect github.com/gorilla/securecookie v1.1.1 github.com/gorilla/sessions v1.1.3 github.com/jinzhu/gorm v1.9.2 github.com/jinzhu/inflection v0.0.0-20180308033659-04140366298a // indirect github.com/jinzhu/now v1.0.0 // indirect - github.com/josharian/impl v0.0.0-20180228163738-3d0f908298c4 // indirect github.com/karrick/godirwalk v1.8.0 - github.com/kisielk/errcheck v1.2.0 // indirect github.com/lib/pq v1.0.0 // indirect - github.com/mattn/go-colorable v0.1.1 // indirect - github.com/mattn/go-isatty v0.0.7 // indirect - github.com/mattn/go-runewidth v0.0.4 // indirect github.com/mattn/go-sqlite3 v1.10.0 // indirect - github.com/mdempsky/gocode v0.0.0-20190203001940-7fb65232883f // indirect - github.com/mozillazg/go-unidecode v0.1.1 - github.com/peterh/liner v1.1.0 // indirect - github.com/pkg/profile v1.3.0 // indirect github.com/rainycape/unidecode v0.0.0-20150907023854-cb7f23ec59be - github.com/rogpeppe/godef v1.1.1 // indirect - github.com/russross/blackfriday v2.0.0+incompatible // indirect - github.com/stretchr/objx v0.2.0 // indirect github.com/wader/gormstore v0.0.0-20190302154359-acb787ba3755 - github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a // indirect - golang.org/x/arch v0.0.0-20190312162104-788fe5ffcd8c // indirect golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd // indirect - golang.org/x/net v0.0.0-20190420063019-afa5a82059c6 // indirect golang.org/x/sync v0.0.0-20190423024810-112230192c58 // indirect golang.org/x/sys v0.0.0-20190422165155-953cdadca894 // indirect golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b // indirect diff --git a/go.sum b/go.sum index 6a3f3b5..eef7279 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,3 @@ -9fans.net/go v0.0.0-20181112161441-237454027057 h1:OcHlKWkAMJEF1ndWLGxp5dnJQkYM/YImUOvsBoz6h5E= -9fans.net/go v0.0.0-20181112161441-237454027057/go.mod h1:diCsxrliIURU9xsYtjCp5AbpQKqdhKmf0ujWDUSkfoY= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -9,9 +7,6 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/OpenPeeDeeP/depguard v0.0.0-20180806142446-a69c782687b2 h1:HTOmFEEYrWi4MW5ZKUx6xfeyM10Sx3kQF65xiQJMPYA= -github.com/OpenPeeDeeP/depguard v0.0.0-20180806142446-a69c782687b2/go.mod h1:7/4sitnI9YlQgTLLk734QlzXT8DuHVnAyztLplQjk+o= -github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -20,58 +15,23 @@ github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24 github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/cosiner/argv v0.0.0-20170225145430-13bacc38a0a5/go.mod h1:p/NrK5tF6ICIly4qwEDsf6VDirFiWWz0FenfYBwJaKQ= -github.com/cosiner/argv v0.0.1 h1:2iAFN+sWPktbZ4tvxm33Ei8VY66FPCxdOxpncUGpAXE= -github.com/cosiner/argv v0.0.1/go.mod h1:p/NrK5tF6ICIly4qwEDsf6VDirFiWWz0FenfYBwJaKQ= -github.com/cpuguy83/go-md2man v1.0.8/go.mod h1:N6JayAiVKtlHSnuTCeuLSQVs75hb8q+dYQLjr7cDsKY= -github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/davidrjenni/reftools v0.0.0-20190411195930-981bbac422f8 h1:Eu7kPTwAOeiiot8fjH/WXIYSsoaYB7Xs7sPF8NYeKhs= -github.com/davidrjenni/reftools v0.0.0-20190411195930-981bbac422f8/go.mod h1:0qWLWApvobxwtd9/A8fS62VkRImuquIgtCv/ye+KnxA= github.com/denisenkom/go-mssqldb v0.0.0-20190315220205-a8ed825ac853 h1:tTngnoO/B6HQnJ+pK8tN7kEAhmhIfaJOutqq/A4/JTM= github.com/denisenkom/go-mssqldb v0.0.0-20190315220205-a8ed825ac853/go.mod h1:xN/JuLBIz4bjkxNmByTiV1IbhfnYb6oo99phBn4Eqhc= github.com/dhowden/tag v0.0.0-20181104225729-a9f04c2798ca h1:EsPh1VImRZ6OOhWtz/zzwTjxVQKcKIiqS5tYNdx2eCg= github.com/dhowden/tag v0.0.0-20181104225729-a9f04c2798ca/go.mod h1:SniNVYuaD1jmdEEvi+7ywb1QFR7agjeTdGKyFb0p7Rw= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5 h1:Yzb9+7DPaBjB8zlTR87/ElzFsnQfuHnVUVqpZZIcV5Y= github.com/erikstmartin/go-testdb v0.0.0-20160219214506-8d10e4a1bae5/go.mod h1:a2zkGnVExMxdzMo3M0Hi/3sEU+cWnZpSni0O6/Yb/P0= -github.com/fatih/color v1.6.0 h1:66qjqZk8kalYAvDRtM1AdAJQI0tj4Wrue3Eq3B3pmFU= -github.com/fatih/color v1.6.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/fatih/motion v0.0.0-20180408211639-218875ebe238 h1:Qo4RxRMFag+fvDqQ6A3MblYBormptQUZ1ssOtV+EeQ8= -github.com/fatih/motion v0.0.0-20180408211639-218875ebe238/go.mod h1:pseIrV+t9A4+po+KJ1LheSnYH8m1qs6WhKx2zFiGi9I= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= -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/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-critic/go-critic v0.0.0-20181204210945-ee9bf5809ead h1:qwmAYufKDopQnFdeMw+iHJVxAd2CbF+VFKHyJJwnPKk= -github.com/go-critic/go-critic v0.0.0-20181204210945-ee9bf5809ead/go.mod h1:3MzXZKJdeXqdU9cj+rvZdNiN7SZ8V9OjybF8loZDmHU= -github.com/go-delve/delve v1.2.0 h1:uwGyfYO0WsWqbnDWvxCBKOr2qFLpii3tLxwM+fTJs70= -github.com/go-delve/delve v1.2.0/go.mod h1:yP+LD36s/ud5nm4lsQY0TwNhYu2PAwk6xItz+442j74= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-lintpack/lintpack v0.5.2 h1:DI5mA3+eKdWeJ40nU4d6Wc26qmdG8RCi/btYq0TuRN0= -github.com/go-lintpack/lintpack v0.5.2/go.mod h1:NwZuYi2nUHho8XEIZ6SIxihrnPoqBTDqfpXvXAN0sXM= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-sql-driver/mysql v1.4.1 h1:g24URVg0OFbNUTx9qqY1IRZ9D9z3iPyi5zKhQZpNwpA= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-toolsmith/astcast v0.0.0-20181028201508-b7a89ed70af1 h1:h+1eMw+tZAlgTVclcVN0/rdPaBI/RUzG0peblT6df+Q= -github.com/go-toolsmith/astcast v0.0.0-20181028201508-b7a89ed70af1/go.mod h1:TEo3Ghaj7PsZawQHxT/oBvo4HK/sl1RcuUHDKTTju+o= -github.com/go-toolsmith/astcopy v0.0.0-20180903214859-79b422d080c4 h1:wVs9OMjICHbAryp9hcIuWqUOi+NqEbUSZy9zMe3W//I= -github.com/go-toolsmith/astcopy v0.0.0-20180903214859-79b422d080c4/go.mod h1:c9CPdq2AzM8oPomdlPniEfPAC6g1s7NqZzODt8y6ib8= -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6 h1:aTBUNRTatDDU24gbOEKEoLiDwxtc98ga6K/iMTm6fvs= -github.com/go-toolsmith/astequal v0.0.0-20180903214952-dcb477bfacd6/go.mod h1:H+xSiq0+LtiDC11+h1G32h7Of5O3CYFJ99GVbS5lDKY= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086 h1:EIMuvbE9fbtQtimdLe5yeXjuC5CeKbQt8zH6GwtIrhM= -github.com/go-toolsmith/astfmt v0.0.0-20180903215011-8f8ee99c3086/go.mod h1:mP93XdblcopXwlyN4X4uodxXQhldPGZbcEJIimQHrkg= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30 h1:zRJPftZJNLPDiOtvYbFRwjSbaJAcVOf80TeEmWGe2kQ= -github.com/go-toolsmith/astp v0.0.0-20180903215135-0af7e3c24f30/go.mod h1:SV2ur98SGypH1UjcPpCatrV5hPazG6+IfNHbkDXBRrk= -github.com/go-toolsmith/pkgload v0.0.0-20181119091011-e9e65178eee8/go.mod h1:WoMrjiy4zvdS+Bg6z9jZH82QXwkcgCBX6nOfnmdaHks= -github.com/go-toolsmith/strparse v0.0.0-20180903215201-830b6daa1241 h1:ZRDeQioMGTBLeJxcPxXfFifEUgYxzR7fXw7w2WR+1bo= -github.com/go-toolsmith/strparse v0.0.0-20180903215201-830b6daa1241/go.mod h1:YI2nUKP9YGZnL/L1/DLFBfixrcjslWct4wyljWhSRy8= -github.com/go-toolsmith/typep v0.0.0-20181030061450-d63dc7650676 h1:6Qrsp0+25KEkaS2bB26UE0giFgRrIc8mYXboDL5OVMA= -github.com/go-toolsmith/typep v0.0.0-20181030061450-d63dc7650676/go.mod h1:JSQCQMUPdRlMZFswiq3TGpNp1GMktqkR2Ns5AIQkATU= github.com/gobuffalo/attrs v0.0.0-20190224210810-a9411de4debd/go.mod h1:4duuawTqi2wkkpB4ePgWMaai6/Kc6WEz83bhFwpHzj0= github.com/gobuffalo/depgen v0.0.0-20190329151759-d478694a28d3/go.mod h1:3STtPUQYuzV0gBVOY3vy6CfMm/ljR4pABfrTeHNLHUY= github.com/gobuffalo/depgen v0.1.0/go.mod h1:+ifsuy7fhi15RWncXQQKjWS9JPkdah5sZvtHc2RXGlg= @@ -107,8 +67,6 @@ github.com/gobuffalo/packr/v2 v2.2.0 h1:Ir9W9XIm9j7bhhkKE9cokvtTl1vBm62A/fene/ZC github.com/gobuffalo/packr/v2 v2.2.0/go.mod h1:CaAwI0GPIAv+5wKLtv8Afwl+Cm78K/I/VCm/3ptBN+0= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754 h1:tpom+2CJmpzAWj5/VEHync2rJGi+epHNIeRSWjzGA+4= github.com/gobuffalo/syncx v0.0.0-20190224160051-33c29581e754/go.mod h1:HhnNqWY95UYwwW3uSASeV7vtgYkT2t16hJgV3AEPUpw= -github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= -github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= @@ -119,40 +77,6 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= -github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6 h1:i2jIkQFb8RG45DuQs+ElyROY848cSJIoIkBM+7XXypA= -github.com/golangci/errcheck v0.0.0-20181003203344-ef45e06d44b6/go.mod h1:DbHgvLiFKX1Sh2T1w8Q/h4NAI8MHIpzCdnBUDTXU3I0= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZBf8NjltjWihK2QfBBBZuv91cMFfDHw= -github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= -github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196 h1:9rtVlONXLF1rJZzvLt4tfOXtnAFUEhxCJ64Ibzj6ECo= -github.com/golangci/go-tools v0.0.0-20180109140146-af6baa5dc196/go.mod h1:unzUULGw35sjyOYjUt0jMTXqHlZPpPc6e+xfO4cd6mM= -github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3 h1:pe9JHs3cHHDQgOFXJJdYkK6fLz2PWyYtP4hthoCMvs8= -github.com/golangci/goconst v0.0.0-20180610141641-041c5f2b40f3/go.mod h1:JXrF4TWy4tXYn62/9x8Wm/K/dm06p8tCKwFRDPZG/1o= -github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee h1:J2XAy40+7yz70uaOiMbNnluTg7gyQhtGqLQncQh+4J8= -github.com/golangci/gocyclo v0.0.0-20180528134321-2becd97e67ee/go.mod h1:ozx7R9SIwqmqf5pRP90DhR2Oay2UIjGuKheCBCNwAYU= -github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98 h1:ir6/L2ZOJfFrJlOTsuf/hlzdPuUwXV/VzkSlgS6f1vs= -github.com/golangci/gofmt v0.0.0-20181105071733-0b8337e80d98/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.16.0 h1:PcWAN9JHflZzJQaZVY1JXZE0Tgjq+jO2v4QLqJ/Azvw= -github.com/golangci/golangci-lint v1.16.0/go.mod h1:uySrAxrUmZYnxyccYSnwuAEm+3144Zg5IAUueIW8+fA= -github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547 h1:qMomh8bv+kDazm1dSLZ9S3zZ2PJZMHL4ilfBjxFOlmI= -github.com/golangci/gosec v0.0.0-20180901114220-66fb7fc33547/go.mod h1:0qUabqiIQgfmlAmulqxyiGkkyF6/tOGSnY2cnPVwrzU= -github.com/golangci/ineffassign v0.0.0-20180808204949-2ee8f2867dde h1:qEGp3ZF1Qw6TkbWKn6GdJ12Ssu/CpJBaBcJ4hrUjrSo= -github.com/golangci/ineffassign v0.0.0-20180808204949-2ee8f2867dde/go.mod h1:e5tpTHCfVze+7EpLEozzMB3eafxo2KT5veNg1k6byQU= -github.com/golangci/lint-1 v0.0.0-20180610141402-4bf9709227d1 h1:PHK2kIh21Zt4IcG0bBRzQwEDVKF64LnkoSXnm8lfJUk= -github.com/golangci/lint-1 v0.0.0-20180610141402-4bf9709227d1/go.mod h1:/X8TswGSh1pIozq4ZwCfxS0WA5JGXguxk94ar/4c87Y= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770 h1:EL/O5HGrF7Jaq0yNhBLucz9hTuRzj2LdwGBOaENgxIk= -github.com/golangci/misspell v0.0.0-20180809174111-950f5d19e770/go.mod h1:dEbvlSfYbMQDtrpRMQU675gSDLDNa8sCPPChZ7PhiVA= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21 h1:leSNB7iYzLYSSx3J/s5sVf4Drkc68W2wm4Ixh/mr0us= -github.com/golangci/prealloc v0.0.0-20180630174525-215b22d4de21/go.mod h1:tf5+bzsHdTM0bsB7+8mt0GUMvjCgwLpTapNZHU8AajI= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0 h1:HVfrLniijszjS1aiNg8JbBMO2+E1WIQ+j/gL4SQqGPg= -github.com/golangci/revgrep v0.0.0-20180526074752-d9c87f5ffaf0/go.mod h1:qOQCunEYvmd/TLamH+7LlVccLvUH5kZNhbCgTHoBbp4= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= @@ -173,9 +97,6 @@ github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:Fecb github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.6.2/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= -github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno= -github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= -github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jinzhu/gorm v1.9.2 h1:lCvgEaqe/HVE+tjAR2mt4HbbHAZsQOv3XAZiEZV37iw= @@ -186,15 +107,10 @@ github.com/jinzhu/now v1.0.0 h1:6WV8LvwPpDhKjo5U9O6b4+xdG/jTXNPwlDme/MTo8Ns= github.com/jinzhu/now v1.0.0/go.mod h1:oHTiXerJ20+SfYcrdlBO7rzZRJWGwSTQ0iUY2jI6Gfc= github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc= github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= -github.com/josharian/impl v0.0.0-20180228163738-3d0f908298c4 h1:gmIVMdGlVf5e6Yo6+ZklxdOrvtOvyrAjJyXAbmOznyo= -github.com/josharian/impl v0.0.0-20180228163738-3d0f908298c4/go.mod h1:t4Tr0tn92eq5ISef4cS5plFAMYAqZlAXtgUcKE6y8nw= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/karrick/godirwalk v1.8.0 h1:ycpSqVon/QJJoaT1t8sae0tp1Stg21j+dyuS7OoagcA= github.com/karrick/godirwalk v1.8.0/go.mod h1:H5KPZjojv4lE+QYImBI8xVtrBRgYrIVsaRPx4tDPEn4= -github.com/kisielk/errcheck v1.2.0 h1:reN85Pxc5larApoH1keMBiu2GWtPqXQ1nc9gx+jOU+E= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/gotool v0.0.0-20161130080628-0de1eaf82fa3/go.mod h1:jxZFDH7ILpTPQTk+E2s+z4CUas9lVNjIuKR4c5/zKgM= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= @@ -207,58 +123,19 @@ github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/logrusorgru/aurora v0.0.0-20181002194514-a7b3b318ed4e/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= -github.com/magiconair/properties v1.7.6 h1:U+1DqNen04MdEPgFiIwdOUiqZ8qPa37xgogX/sd3+54= -github.com/magiconair/properties v1.7.6/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2 h1:JgVTCPf0uBVcUSWpyXmGpgOc62nK5HWUBKAGc3Qqa5k= github.com/markbates/oncer v0.0.0-20181203154359-bf2de49a0be2/go.mod h1:Ld9puTsIW75CHf65OeIOkyKbteujpZVXDpWK6YGZbxE= github.com/markbates/safe v1.0.1 h1:yjZkbvRM6IzKj9tlu/zMJLS0n/V351OZWRnF3QfaUxI= github.com/markbates/safe v1.0.1/go.mod h1:nAqgmRi7cY2nqMc92/bSEeQA+R4OheNU2T1kNSCBdG0= -github.com/mattn/go-colorable v0.0.0-20170327083344-ded68f7a9561/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= -github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-isatty v0.0.7 h1:UvyT9uN+3r7yLEYSlJsbQGdsaB/a0DlgWP3pql6iwOc= -github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= -github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-runewidth v0.0.4 h1:2BvfKmzob6Bmd4YsL0zygOqfdFnK7GR4QL06Do4/p7Y= -github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o= github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= -github.com/mattn/goveralls v0.0.2/go.mod h1:8d1ZMHsd7fW6IRPKQh46F2WRpyib5/X4FOpevwGNQEw= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/mdempsky/gocode v0.0.0-20190203001940-7fb65232883f h1:ee+twVCignaZjt7jpbMSLxAeTN/Nfq9W/nm91E7QO1A= -github.com/mdempsky/gocode v0.0.0-20190203001940-7fb65232883f/go.mod h1:hltEC42XzfMNgg0S1v6JTywwra2Mu6F6cLR03debVQ8= -github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-ps v0.0.0-20170309133038-4fdf99ab2936/go.mod h1:r1VsdOzOPt1ZSrGZWFoNhsAedKnEd6r9Np1+5blZCWk= -github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 h1:+MZW2uvHgN8kYvksEN3f7eFL2wpzk0GxmlFsMybWc7E= -github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mozilla/tls-observatory v0.0.0-20180409132520-8791a200eb40/go.mod h1:SrKMQvPiws7F7iqYp8/TX+IhxCYhzr6N/1yb8cwHsGk= -github.com/mozillazg/go-unidecode v0.1.1 h1:uiRy1s4TUqLbcROUrnCN/V85Jlli2AmDF6EeAXOeMHE= -github.com/mozillazg/go-unidecode v0.1.1/go.mod h1:fYMdhyjni9ZeEmS6OE/GJHDLsF8TQvIVDwYR/drR26Q= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nbutton23/zxcvbn-go v0.0.0-20160627004424-a22cb81b2ecd/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= -github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663 h1:Ri1EhipkbhWsffPJ3IPlrb4SkTOPa2PfRXp3jchBczw= -github.com/nbutton23/zxcvbn-go v0.0.0-20171102151520-eafdab6b0663/go.mod h1:o96djdrsSGy3AWPyBgZMAGfxZNfgntdJG+11KU4QvbU= -github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= -github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.3/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= -github.com/pelletier/go-toml v1.1.0 h1:cmiOvKzEunMsAxyhXSzpL5Q1CRKpVv0KQsnAIcSEVYM= -github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/peterh/liner v0.0.0-20170317030525-88609521dc4b/go.mod h1:xIteQHvHuaLYG9IFj6mSxM0fCKrs34IrEQUhOYuGPHc= -github.com/peterh/liner v1.1.0 h1:f+aAedNJA6uk7+6rXsYBnhdo4Xux7ESLe+kcuVUF5os= -github.com/peterh/liner v1.1.0/go.mod h1:CRroGNssyjTd/qIG2FyxByd2S8JEAZXBl4qUrZf8GS0= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/profile v0.0.0-20170413231811-06b906832ed0/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pkg/profile v1.3.0/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= 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/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= @@ -277,61 +154,29 @@ github.com/rogpeppe/go-internal v1.1.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/rogpeppe/go-internal v1.2.2/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/godef v1.1.1 h1:NujOtt9q9vIClRTB3sCZpavac+NMRaIayzrcz1h4fSE= -github.com/rogpeppe/godef v1.1.1/go.mod h1:oEo1eMy1VUEHUzUIX4F7IqvMJRiz9UId44mvnR8oPlQ= -github.com/russross/blackfriday v0.0.0-20180428102519-11635eb403ff/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/russross/blackfriday v2.0.0+incompatible/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/ryanuber/go-glob v0.0.0-20170128012129-256dc444b735/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/shirou/gopsutil v0.0.0-20180427012116-c95755e4bcd7/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/w32 v0.0.0-20160930032740-bb4de0191aa4/go.mod h1:qsXQc7+bwAM3Q1u/4XEfrquwF8Lw7D7y5cD8CuHnfIc= -github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= -github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= -github.com/sirupsen/logrus v0.0.0-20180523074243-ea8897e79973/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= -github.com/sirupsen/logrus v1.0.5/go.mod h1:pMByvHTf9Beacp5x1UXfOR9xyW/9antXMhjMPG0dEzc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1 h1:GL2rEmy6nsikmW0r8opw9JIRScdMF5hA8cOYLH7In1k= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= -github.com/spf13/afero v1.1.0 h1:bopulORc2JeYaxfHLvJa5NzxviA9PoWhpiiJkru7Ji4= -github.com/spf13/afero v1.1.0/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg= -github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= -github.com/spf13/cobra v0.0.0-20170417170307-b6cb39589372/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/cobra v0.0.2/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= -github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec h1:2ZXvIUGghLpdTVHR1UfvfrzoVlZaE/yOWC5LueIHZig= -github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170417173400-9e4c21054fa1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/spf13/viper v1.0.2 h1:Ncr3ZIuJn322w2k1qmzXDnkLAdQMlJqBa9kfAH+irso= -github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= github.com/wader/gormstore v0.0.0-20190302154359-acb787ba3755 h1:pNaEDfvqe9W2h4D+xm5f+lnZdao3Rob6O0b8SovpGbE= github.com/wader/gormstore v0.0.0-20190302154359-acb787ba3755/go.mod h1:PbEnTGtqU8NGCALR62gu2+eQYO8zQDEvaMJiPaj5Hic= -github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a h1:00UFliGZl2UciXe8o/2iuEsRQ9u7z0rzDTVzuj6EYY0= -github.com/zmb3/gogetdoc v0.0.0-20190228002656-b37376c5da6a/go.mod h1:ofmGw6LrMypycsiWcyug6516EXpIxSbZ+uI9ppGypfY= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.19.1/go.mod h1:gug0GbSHa8Pafr0d2urOSgoXHZ6x/RUlaiT0d9pqb4A= go4.org v0.0.0-20180809161055-417644f6feb5/go.mod h1:MkTOUMDaeVYJUOUsaDXIhWPZYa1yOyC1qaOBpL57BhE= -golang.org/x/arch v0.0.0-20171004143515-077ac972c2e4/go.mod h1:cYlCBUl1MsqxdiKgmc4uh7TxZfWSFLOGSRR090WDxt8= -golang.org/x/arch v0.0.0-20190312162104-788fe5ffcd8c h1:Rx/HTKi09myZ25t1SOlDHmHOy/mKxNAcu0hP1oPX9qM= -golang.org/x/arch v0.0.0-20190312162104-788fe5ffcd8c/go.mod h1:flIaEI6LNU6xOCD5PaJvn9wGP0agmIOqjrtsKGRguv4= golang.org/x/build v0.0.0-20190314133821-5284462c4bec/go.mod h1:atTaCNAy0f16Ah5aV1gMSwgiKVHwu/JncqDpuRr7lS4= -golang.org/x/crypto v0.0.0-20180614174826-fd5f17ee7299/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190313024323-a1f597ede03a/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd h1:sMHc2rZHuzQmrbVoSpt9HgerkXPyIeCSO6k0zUMGfFk= golang.org/x/crypto v0.0.0-20190422183909-d864b10871cd/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -341,7 +186,6 @@ golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/net v0.0.0-20170915142106-8351a756f30f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -352,9 +196,7 @@ golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190313220215-9f648a60d977/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190420063019-afa5a82059c6/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -368,8 +210,6 @@ golang.org/x/sync v0.0.0-20190412183630-56d357773e84 h1:IqXQ59gzdXv58Jmm2xn0tSOR golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20171026204733-164713f0dfce/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180614134839-8883426083c0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -378,37 +218,23 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181218192612-074acd46bca6/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190403152447-81d4e9dc473e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= 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/text v0.0.0-20170915090833-1cbadb444a80/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20170915040203-e531a2a1c15f/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181030221726-6c7e314b6563/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181117154741-2ddaf7f79a09/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181120060634-fc4f04983f62/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181130195746-895048a75ecf/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181205014116-22934f0fdb62/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181207195948-8634b1ecd393/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20181219222714-6e267b5cc78e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190121143147-24cd39ecf745/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138 h1:H3uGjxCR/6Ds0Mjgyp7LMK81+LvmbvWWEnJhzk1Pi9E= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190314010720-f0bfdbff1f9c/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190408220357-e5b8258f4918/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190420181800-aa740d480789/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b h1:NVD8gBK33xpdqCaZVVtd6OFJp+3dxkXuz7+U7KaVN6s= @@ -432,17 +258,11 @@ google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmE google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -gopkg.in/airbrake/gobrake.v2 v2.0.9/go.mod h1:/h5ZAUhDkGaJfjzjKLSjv6zCL6O0LLBxU4K+aSYdM/U= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= -gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= -gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2/go.mod h1:Xk6kEKp8OKb+X14hQBKWaSkCsqBpgog8nAV2xsGOxlo= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= -gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.0.0-20170407172122-cd8b52f8269e/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -451,14 +271,3 @@ honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20180920025451-e3ad64cb4ed3/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34 h1:B1LAOfRqg2QUyCdzfjf46quTSYUTAK5OCwbh6pljHbM= -mvdan.cc/unparam v0.0.0-20190124213536-fbb59629db34/go.mod h1:H6SUd1XjIs+qQCyskXg5OFSrilMRUkD8ePJpHKDPaeY= -rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= -sourcegraph.com/sourcegraph/go-diff v0.5.1-0.20190210232911-dee78e514455 h1:qoQ5Kt+Zm+GXBtz49YwD3juBhr/E0U25jO6bBzxW6NI= -sourcegraph.com/sourcegraph/go-diff v0.5.1-0.20190210232911-dee78e514455/go.mod h1:kuch7UrkMzY0X+p9CRK03kfuPQ2zzQcaEFbx8wA8rck= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4 h1:JPJh2pk3+X4lXAkZIk2RuE/7/FoK9maXw+TNPJhVS/c= -sourcegraph.com/sqs/pbtypes v0.0.0-20180604144634-d3ebe8f20ae4/go.mod h1:ketZ/q3QxT9HOBeFhu6RdvsftgpsbFHBF5Cas6cDKZ0= diff --git a/handler/handler_sub_by_folder.go b/handler/handler_sub_by_folder.go index 1f5cb59..fcc61dc 100644 --- a/handler/handler_sub_by_folder.go +++ b/handler/handler_sub_by_folder.go @@ -1,8 +1,11 @@ package handler import ( + "fmt" "net/http" + "github.com/jinzhu/gorm" + "github.com/sentriz/gonic/db" "github.com/sentriz/gonic/subsonic" ) @@ -44,20 +47,17 @@ func (c *Controller) GetMusicDirectory(w http.ResponseWriter, r *http.Request) { respondError(w, r, 10, "please provide an `id` parameter") return } - sub := subsonic.NewResponse() + childrenObj := []*subsonic.Child{} var cFolder db.Folder c.DB.First(&cFolder, id) - sub.Directory = &subsonic.Directory{ - ID: cFolder.ID, - Parent: cFolder.ParentID, - Name: cFolder.Name, - } + // + // start looking for child folders in the current dir var folders []*db.Folder c.DB. Where("parent_id = ?", id). Find(&folders) for _, folder := range folders { - sub.Directory.Children = append(sub.Directory.Children, &subsonic.Child{ + childrenObj = append(childrenObj, &subsonic.Child{ Parent: cFolder.ID, ID: folder.ID, Title: folder.Name, @@ -65,30 +65,115 @@ func (c *Controller) GetMusicDirectory(w http.ResponseWriter, r *http.Request) { CoverID: folder.CoverID, }) } + // + // start looking for child tracks in the current dir var tracks []*db.Track c.DB. Where("folder_id = ?", id). Preload("Album"). + Order("track_number"). Find(&tracks) for _, track := range tracks { - sub.Directory.Children = append(sub.Directory.Children, &subsonic.Child{ - Parent: cFolder.ID, - IsDir: false, - Title: track.Title, + if getStrParam(r, "c") == "Jamstash" { + // jamstash thinks it can't play flacs + track.ContentType = "audio/mpeg" + track.Suffix = "mp3" + } + childrenObj = append(childrenObj, &subsonic.Child{ + ID: track.ID, Album: track.Album.Title, Artist: track.Artist, - Bitrate: track.Bitrate, ContentType: track.ContentType, CoverID: cFolder.CoverID, Duration: 0, + IsDir: false, + Parent: cFolder.ID, Path: track.Path, Size: track.Size, + Suffix: track.Suffix, + Title: track.Title, Track: track.TrackNumber, + Type: "music", }) } + // + // respond section + sub := subsonic.NewResponse() + sub.Directory = &subsonic.Directory{ + ID: cFolder.ID, + Parent: cFolder.ParentID, + Name: cFolder.Name, + Children: childrenObj, + } respond(w, r, sub) } // changes to this function should be reflected in in _by_tags.go's // getAlbumListTwo() function -func (c *Controller) GetAlbumList(w http.ResponseWriter, r *http.Request) {} +func (c *Controller) GetAlbumList(w http.ResponseWriter, r *http.Request) { + listType := getStrParam(r, "type") + if listType == "" { + respondError(w, r, 10, "please provide a `type` parameter") + return + } + q := c.DB + switch listType { + case "alphabeticalByArtist": + // not sure what it meant by "artist" since we're browsing by folder + // - so we'll consider the parent folder's name to be the "artist" + q = q.Joins(` + JOIN folders AS parent_folders + ON folders.parent_id = parent_folders.id`) + q = q.Order("parent_folders.name") + case "alphabeticalByName": + // not sure about "name" either, so lets use the folder's name + q = q.Order("name") + case "frequent": + user := r.Context().Value(contextUserKey).(*db.User) + q = q.Joins(` + JOIN plays + ON folders.id = plays.folder_id AND plays.user_id = ?`, + user.ID) + q = q.Order("plays.count DESC") + case "newest": + q = q.Order("updated_at DESC") + case "random": + q = q.Order(gorm.Expr("random()")) + case "recent": + user := r.Context().Value(contextUserKey).(*db.User) + q = q.Joins(` + JOIN plays + ON folders.id = plays.folder_id AND plays.user_id = ?`, + user.ID) + q = q.Order("plays.time DESC") + default: + respondError(w, r, 10, fmt.Sprintf( + "unknown value `%s` for parameter 'type'", listType, + )) + return + } + var folders []*db.Folder + q. + Where("folders.has_tracks = 1"). + Offset(getIntParamOr(r, "offset", 0)). + Limit(getIntParamOr(r, "size", 10)). + Preload("Parent"). + Find(&folders) + listObj := []*subsonic.Album{} + for _, folder := range folders { + listObj = append(listObj, &subsonic.Album{ + ID: folder.ID, + Title: folder.Name, + Album: folder.Name, + CoverID: folder.CoverID, + ParentID: folder.ParentID, + IsDir: true, + Artist: folder.Parent.Name, + }) + } + sub := subsonic.NewResponse() + sub.Albums = &subsonic.Albums{ + List: listObj, + } + respond(w, r, sub) +} diff --git a/handler/handler_sub_by_tags.go b/handler/handler_sub_by_tags.go index 6943208..c49df46 100644 --- a/handler/handler_sub_by_tags.go +++ b/handler/handler_sub_by_tags.go @@ -14,7 +14,7 @@ func (c *Controller) GetArtists(w http.ResponseWriter, r *http.Request) { var artists []*db.AlbumArtist c.DB.Find(&artists) var indexMap = make(map[rune]*subsonic.Index) - var indexes []*subsonic.Index + var indexes subsonic.Artists for _, artist := range artists { i := indexOf(artist.Name) index, ok := indexMap[i] @@ -24,7 +24,7 @@ func (c *Controller) GetArtists(w http.ResponseWriter, r *http.Request) { Artists: []*subsonic.Artist{}, } indexMap[i] = index - indexes = append(indexes, index) + indexes.List = append(indexes.List, index) } index.Artists = append(index.Artists, &subsonic.Artist{ ID: artist.ID, @@ -32,7 +32,7 @@ func (c *Controller) GetArtists(w http.ResponseWriter, r *http.Request) { }) } sub := subsonic.NewResponse() - sub.Artists = indexes + sub.Artists = &indexes respond(w, r, sub) } @@ -46,13 +46,9 @@ func (c *Controller) GetArtist(w http.ResponseWriter, r *http.Request) { c.DB. Preload("Albums"). First(&artist, id) - sub := subsonic.NewResponse() - sub.Artist = &subsonic.Artist{ - ID: artist.ID, - Name: artist.Name, - } + albumsObj := []*subsonic.Album{} for _, album := range artist.Albums { - sub.Artist.Albums = append(sub.Artist.Albums, &subsonic.Album{ + albumsObj = append(albumsObj, &subsonic.Album{ ID: album.ID, Name: album.Title, Created: album.CreatedAt, @@ -61,6 +57,12 @@ func (c *Controller) GetArtist(w http.ResponseWriter, r *http.Request) { CoverID: album.CoverID, }) } + sub := subsonic.NewResponse() + sub.Artist = &subsonic.Artist{ + ID: artist.ID, + Name: artist.Name, + Albums: albumsObj, + } respond(w, r, sub) } @@ -75,16 +77,9 @@ func (c *Controller) GetAlbum(w http.ResponseWriter, r *http.Request) { Preload("AlbumArtist"). Preload("Tracks"). First(&album, id) - sub := subsonic.NewResponse() - sub.Album = &subsonic.Album{ - ID: album.ID, - Name: album.Title, - CoverID: album.CoverID, - Created: album.CreatedAt, - Artist: album.AlbumArtist.Name, - } + tracksObj := []*subsonic.Track{} for _, track := range album.Tracks { - sub.Album.Tracks = append(sub.Album.Tracks, &subsonic.Track{ + tracksObj = append(tracksObj, &subsonic.Track{ ID: track.ID, Title: track.Title, Artist: track.Artist, // track artist @@ -101,6 +96,15 @@ func (c *Controller) GetAlbum(w http.ResponseWriter, r *http.Request) { Type: "music", }) } + sub := subsonic.NewResponse() + sub.Album = &subsonic.Album{ + ID: album.ID, + Name: album.Title, + CoverID: album.CoverID, + Created: album.CreatedAt, + Artist: album.AlbumArtist.Name, + Tracks: tracksObj, + } respond(w, r, sub) } @@ -112,51 +116,54 @@ func (c *Controller) GetAlbumListTwo(w http.ResponseWriter, r *http.Request) { respondError(w, r, 10, "please provide a `type` parameter") return } - query := c.DB + q := c.DB switch listType { case "alphabeticalByArtist": - query = query. - Joins("JOIN album_artists ON albums.album_artist_id=album_artists.id"). - Order("album_artists.name") + q = q.Joins(` + JOIN album_artists + ON albums.album_artist_id = album_artists.id`) + q = q.Order("album_artists.name") case "alphabeticalByName": - query = query.Order("title") + q = q.Order("title") case "byYear": - startYear := getIntParamOr(r, "fromYear", 1800) - endYear := getIntParamOr(r, "toYear", 2200) - query = query. - Where("year BETWEEN ? AND ?", startYear, endYear). - Order("year") + q = q.Where( + "year BETWEEN ? AND ?", + getIntParamOr(r, "fromYear", 1800), + getIntParamOr(r, "toYear", 2200)) + q = q.Order("year") case "frequent": user := r.Context().Value(contextUserKey).(*db.User) - query = query. - Joins("JOIN plays ON albums.id=plays.album_id AND plays.user_id=?", user.ID). - Order("plays.count desc") + q = q.Joins(` + JOIN plays + ON albums.id = plays.album_id AND plays.user_id = ?`, + user.ID) + q = q.Order("plays.count DESC") case "newest": - query = query.Order("updated_at desc") + q = q.Order("updated_at DESC") case "random": - query = query.Order(gorm.Expr("random()")) + q = q.Order(gorm.Expr("random()")) case "recent": user := r.Context().Value(contextUserKey).(*db.User) - query = query. - Joins("JOIN plays ON albums.id=plays.album_id AND plays.user_id=?", user.ID). - Order("plays.time desc") + q = q.Joins(` + JOIN plays + ON albums.id = plays.album_id AND plays.user_id = ?`, + user.ID) + q = q.Order("plays.time DESC") default: respondError(w, r, 10, fmt.Sprintf( "unknown value `%s` for parameter 'type'", listType, )) return } - offset := getIntParamOr(r, "offset", 0) - size := getIntParamOr(r, "size", 10) var albums []*db.Album - query. - Offset(offset). - Limit(size). + q. + Offset(getIntParamOr(r, "offset", 0)). + Limit(getIntParamOr(r, "size", 10)). Preload("AlbumArtist"). Find(&albums) - sub := subsonic.NewResponse() + listObj := []*subsonic.Album{} for _, album := range albums { - sub.Albums = append(sub.Albums, &subsonic.Album{ + listObj = append(listObj, &subsonic.Album{ ID: album.ID, Name: album.Title, Created: album.CreatedAt, @@ -165,5 +172,9 @@ func (c *Controller) GetAlbumListTwo(w http.ResponseWriter, r *http.Request) { ArtistID: album.AlbumArtist.ID, }) } + sub := subsonic.NewResponse() + sub.AlbumsTwo = &subsonic.Albums{ + List: listObj, + } respond(w, r, sub) } diff --git a/handler/handler_sub_common.go b/handler/handler_sub_common.go index aad9371..13b9360 100644 --- a/handler/handler_sub_common.go +++ b/handler/handler_sub_common.go @@ -32,6 +32,7 @@ func (c *Controller) Stream(w http.ResponseWriter, r *http.Request) { var track db.Track c.DB. Preload("Album"). + Preload("Folder"). First(&track, id) if track.Path == "" { respondError(w, r, 70, fmt.Sprintf("media with id `%d` was not found", id)) @@ -48,8 +49,9 @@ func (c *Controller) Stream(w http.ResponseWriter, r *http.Request) { // after we've served the file, mark the album as played user := r.Context().Value(contextUserKey).(*db.User) play := db.Play{ - AlbumID: track.Album.ID, - UserID: user.ID, + AlbumID: track.Album.ID, + FolderID: track.Folder.ID, + UserID: user.ID, } c.DB.Where(play).First(&play) play.Time = time.Now() // for getAlbumList?type=recent @@ -122,10 +124,12 @@ func (c *Controller) Scrobble(w http.ResponseWriter, r *http.Request) { } func (c *Controller) GetMusicFolders(w http.ResponseWriter, r *http.Request) { - sub := subsonic.NewResponse() - sub.MusicFolders = []*subsonic.MusicFolder{ + folders := &subsonic.MusicFolders{} + folders.List = []*subsonic.MusicFolder{ {ID: 1, Name: "music"}, } + sub := subsonic.NewResponse() + sub.MusicFolders = folders respond(w, r, sub) } diff --git a/scanback b/scanback deleted file mode 100644 index 3a18582..0000000 --- a/scanback +++ /dev/null @@ -1,39 +0,0 @@ - -func handleFolderForFolder(fullPath string, stat os.FileInfo) { - // update folder table for browsing by folder - modTime := stat.ModTime() - var folder db.Folder - err := tx.Where("path = ?", fullPath).First(&folder).Error - if !gorm.IsRecordNotFoundError(err) && - modTime.Before(folder.UpdatedAt) { - // we found the record but it hasn't changed - currentDirStack.Push(&folder) - return - } - _, folderName := path.Split(fullPath) - folder.Path = fullPath - folder.ParentID = currentDirStack.PeekID() - folder.Name = folderName - tx.Save(&folder) - currentDirStack.Push(&folder) -} - -func handleFolderForAlbum(fullPath string, stat os.FileInfo) { - // update album table (the currentAlbum record will be updated when - // we exit this folder) - err := tx.Where("path = ?", fullPath).First(¤tAlbum).Error - if !gorm.IsRecordNotFoundError(err) { - // we found the record - // TODO: think about mod time here - return - } - currentAlbum = db.Album{Path: fullPath} - fmt.Println("SAVING", fullPath, err) - tx.Save(¤tAlbum) -} - -func handleFolder(fullPath string, stat os.FileInfo) error { - handleFolderForAlbum(fullPath, stat) - handleFolderForFolder(fullPath, stat) - return nil -} diff --git a/subsonic/media.go b/subsonic/media.go index ca1bbd4..0afb93f 100644 --- a/subsonic/media.go +++ b/subsonic/media.go @@ -2,16 +2,27 @@ package subsonic import "time" +type Albums struct { + List []*Album `xml:"album" json:"album,omitempty"` +} + type Album struct { - ID int `xml:"id,attr" json:"id"` - Name string `xml:"name,attr" json:"name"` - ArtistID int `xml:"artistId,attr" json:"artistId"` - Artist string `xml:"artist,attr" json:"artist"` - TrackCount int `xml:"songCount,attr" json:"songCount"` - Duration int `xml:"duration,attr" json:"duration"` - CoverID int `xml:"coverArt,attr" json:"coverArt"` - Created time.Time `xml:"created,attr" json:"created"` - Tracks []*Track `xml:"song" json:"song,omitempty"` + // common + ID int `xml:"id,attr,omitempty" json:"id"` + CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"` + ArtistID int `xml:"artistId,attr,omitempty" json:"artistId,omitempty"` + Artist string `xml:"artist,attr,omitempty" json:"artist,omitempty"` + // browsing by folder (getAlbumList) + Title string `xml:"title,attr,omitempty" json:"title,omitempty"` + Album string `xml:"album,attr,omitempty" json:"album,omitempty"` + ParentID int `xml:"parent,attr,omitempty" json:"parent,omitempty"` + IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"` + // browsing by tags (getAlbumList2) + Name string `xml:"name,attr,omitempty" json:"name,omitempty"` + TrackCount int `xml:"songCount,attr,omitempty" json:"songCount,omitempty"` + Duration int `xml:"duration,attr,omitempty" json:"duration,omitempty"` + Created time.Time `xml:"created,attr,omitempty" json:"created,omitempty"` + Tracks []*Track `xml:"song,omitempty" json:"song,omitempty"` } type RandomTracks struct { @@ -19,59 +30,63 @@ type RandomTracks struct { } type Track struct { - ID int `xml:"id,attr" json:"id"` - Parent int `xml:"parent,attr" json:"parent"` - Title string `xml:"title,attr" json:"title"` - Album string `xml:"album,attr" json:"album"` - Artist string `xml:"artist,attr" json:"artist"` - IsDir bool `xml:"isDir,attr" json:"isDir"` - CoverID int `xml:"coverArt,attr" json:"coverArt"` - Created time.Time `xml:"created,attr" json:"created"` - Duration int `xml:"duration,attr" json:"duration"` - Genre string `xml:"genre,attr" json:"genre"` - Bitrate int `xml:"bitRate,attr" json:"bitRate"` - Size int `xml:"size,attr" json:"size"` - Suffix string `xml:"suffix,attr" json:"suffix"` - ContentType string `xml:"contentType,attr" json:"contentType"` - IsVideo bool `xml:"isVideo,attr" json:"isVideo"` - Path string `xml:"path,attr" json:"path"` - AlbumID int `xml:"albumId,attr" json:"albumId"` - ArtistID int `xml:"artistId,attr" json:"artistId"` - TrackNo int `xml:"track,attr" json:"track"` - Type string `xml:"type,attr" json:"type"` + ID int `xml:"id,attr,omitempty" json:"id"` + Parent int `xml:"parent,attr,omitempty" json:"parent"` + Title string `xml:"title,attr,omitempty" json:"title"` + Album string `xml:"album,attr,omitempty" json:"album"` + Artist string `xml:"artist,attr,omitempty" json:"artist"` + IsDir bool `xml:"isDir,attr,omitempty" json:"isDir"` + CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt"` + Created time.Time `xml:"created,attr,omitempty" json:"created"` + Duration int `xml:"duration,attr,omitempty" json:"duration"` + Genre string `xml:"genre,attr,omitempty" json:"genre"` + Bitrate int `xml:"bitRate,attr,omitempty" json:"bitRate"` + Size int `xml:"size,attr,omitempty" json:"size"` + Suffix string `xml:"suffix,attr,omitempty" json:"suffix"` + ContentType string `xml:"contentType,attr,omitempty" json:"contentType"` + IsVideo bool `xml:"isVideo,attr,omitempty" json:"isVideo"` + Path string `xml:"path,attr,omitempty" json:"path"` + AlbumID int `xml:"albumId,attr,omitempty" json:"albumId"` + ArtistID int `xml:"artistId,attr,omitempty" json:"artistId"` + TrackNo int `xml:"track,attr,omitempty" json:"track"` + Type string `xml:"type,attr,omitempty" json:"type"` +} + +type Artists struct { + List []*Index `xml:"index,omitempty" json:"index,omitempty"` } type Artist struct { - ID int `xml:"id,attr" json:"id"` - Name string `xml:"name,attr" json:"name"` - CoverID int `xml:"coverArt,attr" json:"coverArt,omitempty"` - AlbumCount int `xml:"albumCount,attr" json:"albumCount,omitempty"` - Albums []*Album `xml:"album,omitempty" json:"album,omitempty"` + ID int `xml:"id,attr,omitempty" json:"id"` + Name string `xml:"name,attr,omitempty" json:"name"` + CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"` + AlbumCount int `xml:"albumCount,attr,omitempty" json:"albumCount,omitempty"` + Albums []*Album `xml:"album,omitempty" json:"album,omitempty"` } type Indexes struct { - LastModified int `xml:"lastModified,attr" json:"lastModified"` - Index []*Index `xml:"index" json:"index"` + LastModified int `xml:"lastModified,attr,omitempty" json:"lastModified"` + Index []*Index `xml:"index,omitempty" json:"index"` } type Index struct { - Name string `xml:"name,attr" json:"name"` - Artists []*Artist `xml:"artist" json:"artist"` + Name string `xml:"name,attr,omitempty" json:"name"` + Artists []*Artist `xml:"artist,omitempty" json:"artist"` } type Directory struct { - ID int `xml:"id,attr" json:"id"` - Parent int `xml:"parent,attr" json:"parent"` - Name string `xml:"name,attr" json:"name"` + ID int `xml:"id,attr,omitempty" json:"id"` + Parent int `xml:"parent,attr,omitempty" json:"parent"` + Name string `xml:"name,attr,omitempty" json:"name"` Starred string `xml:"starred,attr,omitempty" json:"starred,omitempty"` - Children []*Child `xml:"child" json:"child"` + Children []*Child `xml:"child,omitempty" json:"child"` } type Child struct { - ID int `xml:"id,attr" json:"id,omitempty"` - Parent int `xml:"parent,attr" json:"parent,omitempty"` - Title string `xml:"title,attr" json:"title,omitempty"` - IsDir bool `xml:"isDir,attr" json:"isDir,omitempty"` + ID int `xml:"id,attr,omitempty" json:"id,omitempty"` + Parent int `xml:"parent,attr,omitempty" json:"parent,omitempty"` + Title string `xml:"title,attr,omitempty" json:"title,omitempty"` + IsDir bool `xml:"isDir,attr,omitempty" json:"isDir,omitempty"` Album string `xml:"album,attr,omitempty" json:"album,omitempty"` AlbumID int `xml:"albumId,attr,omitempty" json:"albumId,omitempty"` Artist string `xml:"artist,attr,omitempty" json:"artist,omitempty"` @@ -79,18 +94,23 @@ type Child struct { Track int `xml:"track,attr,omitempty" json:"track,omitempty"` Year int `xml:"year,attr,omitempty" json:"year,omitempty"` Genre string `xml:"genre,attr,omitempty" json:"genre,omitempty"` - CoverID int `xml:"coverArt,attr" json:"coverArt,omitempty"` + CoverID int `xml:"coverArt,attr,omitempty" json:"coverArt,omitempty"` Size int `xml:"size,attr,omitempty" json:"size,omitempty"` ContentType string `xml:"contentType,attr,omitempty" json:"contentType,omitempty"` Suffix string `xml:"suffix,attr,omitempty" json:"suffix,omitempty"` Duration int `xml:"duration,attr,omitempty" json:"duration,omitempty"` Bitrate int `xml:"bitRate,attr,omitempty" json:"bitrate,omitempty"` Path string `xml:"path,attr,omitempty" json:"path,omitempty"` + Type string `xml:"type,attr,omitempty" json:"type,omitempty"` +} + +type MusicFolders struct { + List []*MusicFolder `xml:"musicFolder,omitempty" json:"musicFolder,omitempty"` } type MusicFolder struct { - ID int `xml:"id,attr" json:"id,omitempty"` - Name string `xml:"name,attr" json:"name,omitempty"` + ID int `xml:"id,attr,omitempty" json:"id,omitempty"` + Name string `xml:"name,attr,omitempty" json:"name,omitempty"` } type Licence struct { diff --git a/subsonic/response.go b/subsonic/response.go index a549a27..95b09ba 100644 --- a/subsonic/response.go +++ b/subsonic/response.go @@ -15,20 +15,21 @@ type MetaResponse struct { } type Response struct { - Status string `xml:"status,attr" json:"status"` - Version string `xml:"version,attr" json:"version"` - XMLNS string `xml:"xmlns,attr" json:"-"` - Error *Error `xml:"error" json:"error,omitempty"` - Albums []*Album `xml:"albumList2>album" json:"albumList2,omitempty"` - Album *Album `xml:"album" json:"album,omitempty"` - Track *Track `xml:"song" json:"song,omitempty"` - Indexes *Indexes `xml:"indexes" json:"indexes,omitempty"` - Artists []*Index `xml:"artists>index" json:"artists,omitempty"` - Artist *Artist `xml:"artist" json:"artist,omitempty"` - Directory *Directory `xml:"directory" json:"directory,omitempty"` - RandomTracks *RandomTracks `xml:"randomSongs" json:"randomSongs,omitempty"` - MusicFolders []*MusicFolder `xml:"musicFolders>musicFolder" json:"musicFolders,omitempty"` - Licence *Licence `xml:"license" json:"license,omitempty"` + Status string `xml:"status,attr" json:"status"` + Version string `xml:"version,attr" json:"version"` + XMLNS string `xml:"xmlns,attr" json:"-"` + Error *Error `xml:"error" json:"error,omitempty"` + AlbumsTwo *Albums `xml:"albumList2" json:"albumList2,omitempty"` + Albums *Albums `xml:"albumList" json:"albumList,omitempty"` + Album *Album `xml:"album" json:"album,omitempty"` + Track *Track `xml:"song" json:"song,omitempty"` + Indexes *Indexes `xml:"indexes" json:"indexes,omitempty"` + Artists *Artists `xml:"artists" json:"artists,omitempty"` + Artist *Artist `xml:"artist" json:"artist,omitempty"` + Directory *Directory `xml:"directory" json:"directory,omitempty"` + RandomTracks *RandomTracks `xml:"randomSongs" json:"randomSongs,omitempty"` + MusicFolders *MusicFolders `xml:"musicFolders" json:"musicFolders,omitempty"` + Licence *Licence `xml:"license" json:"license,omitempty"` } type Error struct {