From a98df0b11fbe9554e395594bea0d5e6a83e01f4a Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 3 Mar 2020 16:40:02 +0100 Subject: [PATCH 01/21] first prototype of the thumbnail service Currently uses in memory caching and loads the file from the local filesystem. --- go.mod | 1 + go.sum | 2 + pkg/service/v0/instrument.go | 4 +- pkg/service/v0/logging.go | 4 +- pkg/service/v0/service.go | 45 ++++++++++++---- pkg/service/v0/tracing.go | 4 +- pkg/thumbnails/cache/cache.go | 11 ++++ pkg/thumbnails/cache/filesystem.go | 3 ++ pkg/thumbnails/cache/inmemory.go | 22 ++++++++ pkg/thumbnails/encoding.go | 47 ++++++++++++++++ pkg/thumbnails/thumbnails.go | 86 ++++++++++++++++++++++++++++++ 11 files changed, 214 insertions(+), 15 deletions(-) create mode 100644 pkg/thumbnails/cache/cache.go create mode 100644 pkg/thumbnails/cache/filesystem.go create mode 100644 pkg/thumbnails/cache/inmemory.go create mode 100644 pkg/thumbnails/encoding.go create mode 100644 pkg/thumbnails/thumbnails.go diff --git a/go.mod b/go.mod index 7069238..0cde5ba 100644 --- a/go.mod +++ b/go.mod @@ -10,6 +10,7 @@ require ( github.com/go-chi/chi v4.0.2+incompatible github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/micro/cli/v2 v2.1.1 + github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/ogier/pflag v0.0.1 // indirect github.com/oklog/run v1.0.0 github.com/openzipkin/zipkin-go v0.2.2 diff --git a/go.sum b/go.sum index bde3bff..0767e8b 100644 --- a/go.sum +++ b/go.sum @@ -522,6 +522,8 @@ github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= github.com/nats-io/stan.go v0.5.0/go.mod h1:dYqB+vMN3C2F9pT1FRQpg9eHbjPj6mP0yYuyBNuXHZE= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= +github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= +github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= github.com/nlopes/slack v0.6.0/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= github.com/nlopes/slack v0.6.1-0.20191106133607-d06c2a2b3249/go.mod h1:JzQ9m3PMAqcpeCam7UaHSuBuupz7CmpjehYMayT6YOk= github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/HzqidhOhjw= diff --git a/pkg/service/v0/instrument.go b/pkg/service/v0/instrument.go index 5021bf1..9c3a6d9 100644 --- a/pkg/service/v0/instrument.go +++ b/pkg/service/v0/instrument.go @@ -25,6 +25,6 @@ func (i instrument) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // Dummy implements the Service interface. -func (i instrument) Dummy(w http.ResponseWriter, r *http.Request) { - i.next.Dummy(w, r) +func (i instrument) Thumbnails(w http.ResponseWriter, r *http.Request) { + i.next.Thumbnails(w, r) } diff --git a/pkg/service/v0/logging.go b/pkg/service/v0/logging.go index e0b10f8..a439f1e 100644 --- a/pkg/service/v0/logging.go +++ b/pkg/service/v0/logging.go @@ -25,6 +25,6 @@ func (l logging) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // Dummy implements the Service interface. -func (l logging) Dummy(w http.ResponseWriter, r *http.Request) { - l.next.Dummy(w, r) +func (l logging) Thumbnails(w http.ResponseWriter, r *http.Request) { + l.next.Thumbnails(w, r) } diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index a251734..e47c73c 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -2,15 +2,18 @@ package svc import ( "net/http" + "strconv" "github.com/go-chi/chi" "github.com/owncloud/ocis-thumbnails/pkg/config" + "github.com/owncloud/ocis-thumbnails/pkg/thumbnails" + "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/cache" ) // Service defines the extension handlers. type Service interface { ServeHTTP(http.ResponseWriter, *http.Request) - Dummy(http.ResponseWriter, *http.Request) + Thumbnails(http.ResponseWriter, *http.Request) } // NewService returns a service implementation for Service. @@ -23,10 +26,13 @@ func NewService(opts ...Option) Service { svc := Thumbnails{ config: options.Config, mux: m, + manager: thumbnails.SimpleManager{ + Cache: cache.NewInMemoryCache(), + }, } m.Route(options.Config.HTTP.Root, func(r chi.Router) { - r.Get("/", svc.Dummy) + r.Get("/thumbnails", svc.Thumbnails) }) return svc @@ -34,8 +40,9 @@ func NewService(opts ...Option) Service { // Thumbnails defines implements the business logic for Service. type Thumbnails struct { - config *config.Config - mux *chi.Mux + config *config.Config + mux *chi.Mux + manager thumbnails.Manager } // ServeHTTP implements the Service interface. @@ -43,10 +50,30 @@ func (g Thumbnails) ServeHTTP(w http.ResponseWriter, r *http.Request) { g.mux.ServeHTTP(w, r) } -// Dummy implements the Service interface. -func (g Thumbnails) Dummy(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) +// Thumbnails provides the endpoint to retrieve a thumbnail for an image +func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { + query := r.URL.Query() + width, _ := strconv.Atoi(query.Get("w")) + height, _ := strconv.Atoi(query.Get("h")) + fileType := query.Get("type") + fileID := query.Get("file_id") - w.Write([]byte("Hello ocis-thumbnails!")) + encoder := thumbnails.EncoderForType(fileType) + if encoder == nil { + // TODO: better error responses + w.Write([]byte("can't encode that")) + return + } + ctx := thumbnails.ThumbnailContext{ + Width: width, + Height: height, + ImagePath: fileID, + Encoder: encoder, + } + thumbnail, err := g.manager.Get(ctx) + if err != nil { + w.Write([]byte(err.Error())) + } + + w.Write(thumbnail) } diff --git a/pkg/service/v0/tracing.go b/pkg/service/v0/tracing.go index 48da0b3..444afd3 100644 --- a/pkg/service/v0/tracing.go +++ b/pkg/service/v0/tracing.go @@ -21,6 +21,6 @@ func (t tracing) ServeHTTP(w http.ResponseWriter, r *http.Request) { } // Dummy implements the Service interface. -func (t tracing) Dummy(w http.ResponseWriter, r *http.Request) { - t.next.Dummy(w, r) +func (t tracing) Thumbnails(w http.ResponseWriter, r *http.Request) { + t.next.Thumbnails(w, r) } diff --git a/pkg/thumbnails/cache/cache.go b/pkg/thumbnails/cache/cache.go new file mode 100644 index 0000000..71db593 --- /dev/null +++ b/pkg/thumbnails/cache/cache.go @@ -0,0 +1,11 @@ +package cache + +import ( + "image" +) + +// Cache defines the interface for a thumbnail cache. +type Cache interface { + Get(key string) image.Image + Set(key string, thumbnail image.Image) (image.Image, error) +} diff --git a/pkg/thumbnails/cache/filesystem.go b/pkg/thumbnails/cache/filesystem.go new file mode 100644 index 0000000..b3e25a4 --- /dev/null +++ b/pkg/thumbnails/cache/filesystem.go @@ -0,0 +1,3 @@ +package cache + +// TODO: implement filesystem cache for longer persistence diff --git a/pkg/thumbnails/cache/inmemory.go b/pkg/thumbnails/cache/inmemory.go new file mode 100644 index 0000000..d9c45fb --- /dev/null +++ b/pkg/thumbnails/cache/inmemory.go @@ -0,0 +1,22 @@ +package cache + +import "image" + +func NewInMemoryCache() InMemoryCache { + return InMemoryCache{ + store: make(map[string]image.Image), + } +} + +type InMemoryCache struct { + store map[string]image.Image +} + +func (fsc InMemoryCache) Get(key string) image.Image { + return fsc.store[key] +} + +func (fsc InMemoryCache) Set(key string, thumbnail image.Image) (image.Image, error) { + fsc.store[key] = thumbnail + return thumbnail, nil +} diff --git a/pkg/thumbnails/encoding.go b/pkg/thumbnails/encoding.go new file mode 100644 index 0000000..60a02f5 --- /dev/null +++ b/pkg/thumbnails/encoding.go @@ -0,0 +1,47 @@ +package thumbnails + +import ( + "image" + "image/jpeg" + "image/png" + "io" + "strings" +) + +type Encoder interface { + Encode(io.Writer, image.Image) error + Types() []string +} + +type PngEncoder struct{} + +func (e PngEncoder) Encode(w io.Writer, i image.Image) error { + return png.Encode(w, i) +} + +func (e PngEncoder) Types() []string { + return []string{"png"} +} + +type JpegEncoder struct{} + +func (e JpegEncoder) Encode(w io.Writer, i image.Image) error { + return jpeg.Encode(w, i, nil) +} + +func (e JpegEncoder) Types() []string { + return []string{"jpeg", "jpg"} +} + +func EncoderForType(fileType string) Encoder { + switch strings.ToLower(fileType) { + case "png": + return PngEncoder{} + case "jpg": + fallthrough + case "jpeg": + return JpegEncoder{} + default: + return nil + } +} diff --git a/pkg/thumbnails/thumbnails.go b/pkg/thumbnails/thumbnails.go new file mode 100644 index 0000000..07d163e --- /dev/null +++ b/pkg/thumbnails/thumbnails.go @@ -0,0 +1,86 @@ +package thumbnails + +import ( + "bytes" + "image" + "os" + "strings" + "time" + + "github.com/nfnt/resize" + "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/cache" +) + +// ThumbnailContext bundles information needed to generate a thumbnail for afile +type ThumbnailContext struct { + Width int + Height int + ImagePath string + + Encoder Encoder +} + +// Manager is responsible for generating thumbnails +type Manager interface { + // Get will return a thumbnail for a file + Get(ThumbnailContext) ([]byte, error) + GetCached(ThumbnailContext) []byte +} + +// SimpleManager is a simple implementation of Manager +type SimpleManager struct { + Cache cache.Cache +} + +// Get implements the Get Method of Manager +func (s SimpleManager) Get(ctx ThumbnailContext) ([]byte, error) { + key := buildCacheKey(ctx) + + cached := s.Cache.Get(key) + if cached == nil { + thumbnail := s.generate(ctx) + s.Cache.Set(key, thumbnail) + cached = thumbnail + } + + buf := new(bytes.Buffer) + err := ctx.Encoder.Encode(buf, cached) + if err != nil { + return nil, err + } + return buf.Bytes(), nil +} + +// GetCached tries to get the cached thumbnail and return it. +// If there is no cached thumbnail it will return nil +func (s SimpleManager) GetCached(ctx ThumbnailContext) []byte { + key := buildCacheKey(ctx) + cached := s.Cache.Get(key) + if cached == nil { + return nil + } + buf := new(bytes.Buffer) + ctx.Encoder.Encode(buf, cached) + return buf.Bytes() +} + +func (s SimpleManager) generate(ctx ThumbnailContext) image.Image { + // TODO: remove, just for demo purposes + time.Sleep(time.Second * 2) + + // TODO: get file from reva + reader, _ := os.Open(ctx.ImagePath) + defer reader.Close() + m, _, _ := image.Decode(reader) + thumbnail := resize.Thumbnail(uint(ctx.Width), uint(ctx.Height), m, resize.Lanczos2) + return thumbnail +} + +func buildCacheKey(ctx ThumbnailContext) string { + parts := []string{ + ctx.ImagePath, + string(ctx.Width) + "x" + string(ctx.Height), + strings.Join(ctx.Encoder.Types(), ","), + } + return strings.Join(parts, "+") +} From 34dcaf9ffe74fcf561be2ce19aa5e027a93fb2ad Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 4 Mar 2020 16:55:13 +0100 Subject: [PATCH 02/21] implement file sources If the file is not cached we have to get it from somewhere. For that I implemented a webdav file source which gets the file from reva. --- pkg/flagset/flagset.go | 4 +-- pkg/service/v0/service.go | 41 +++++++++++++++++++++++---- pkg/thumbnails/imgsource/imgsource.go | 33 +++++++++++++++++++++ pkg/thumbnails/imgsource/webdav.go | 41 +++++++++++++++++++++++++++ pkg/thumbnails/thumbnails.go | 28 ++++++------------ 5 files changed, 121 insertions(+), 26 deletions(-) create mode 100644 pkg/thumbnails/imgsource/imgsource.go create mode 100644 pkg/thumbnails/imgsource/webdav.go diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 253f24d..39d4005 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -89,7 +89,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: "0.0.0.0:9114", + Value: "0.0.0.0:9194", Usage: "Address to bind debug server", EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -115,7 +115,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: "0.0.0.0:9110", + Value: "0.0.0.0:9190", Usage: "Address to bind http server", EnvVars: []string{"THUMBNAILS_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index e47c73c..d652ecf 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -8,6 +8,7 @@ import ( "github.com/owncloud/ocis-thumbnails/pkg/config" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/cache" + "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/imgsource" ) // Service defines the extension handlers. @@ -29,6 +30,9 @@ func NewService(opts ...Option) Service { manager: thumbnails.SimpleManager{ Cache: cache.NewInMemoryCache(), }, + source: imgsource.WebDav{ + Basepath: "http://localhost:9140/remote.php/webdav/", + }, } m.Route(options.Config.HTTP.Root, func(r chi.Router) { @@ -43,6 +47,7 @@ type Thumbnails struct { config *config.Config mux *chi.Mux manager thumbnails.Manager + source imgsource.Source } // ServeHTTP implements the Service interface. @@ -53,27 +58,53 @@ func (g Thumbnails) ServeHTTP(w http.ResponseWriter, r *http.Request) { // Thumbnails provides the endpoint to retrieve a thumbnail for an image func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { query := r.URL.Query() - width, _ := strconv.Atoi(query.Get("w")) - height, _ := strconv.Atoi(query.Get("h")) + width, _ := strconv.Atoi(query.Get("width")) + height, _ := strconv.Atoi(query.Get("height")) fileType := query.Get("type") - fileID := query.Get("file_id") + filePath := query.Get("file_path") encoder := thumbnails.EncoderForType(fileType) if encoder == nil { // TODO: better error responses + w.WriteHeader(http.StatusBadRequest) w.Write([]byte("can't encode that")) return } ctx := thumbnails.ThumbnailContext{ Width: width, Height: height, - ImagePath: fileID, + ImagePath: filePath, Encoder: encoder, } - thumbnail, err := g.manager.Get(ctx) + + thumbnail := g.manager.GetCached(ctx) + if thumbnail != nil { + w.Write(thumbnail) + return + } + + auth := r.Header.Get("Authorization") + + sCtx := imgsource.NewContext() + sCtx.Set(imgsource.WebDavAuth, auth) + // TODO: clean up error handling + img, err := g.source.Get(ctx.ImagePath, sCtx) if err != nil { + w.WriteHeader(http.StatusInternalServerError) w.Write([]byte(err.Error())) + return + } + if img == nil { + w.WriteHeader(http.StatusInternalServerError) + w.Write([]byte("img is nil")) + return + } + thumbnail, err = g.manager.Get(ctx, img) + if err != nil { + w.Write([]byte(err.Error())) + return } + w.WriteHeader(http.StatusCreated) w.Write(thumbnail) } diff --git a/pkg/thumbnails/imgsource/imgsource.go b/pkg/thumbnails/imgsource/imgsource.go new file mode 100644 index 0000000..6697c9b --- /dev/null +++ b/pkg/thumbnails/imgsource/imgsource.go @@ -0,0 +1,33 @@ +package imgsource + +import "image" + +// Source defines the interface for image sources +type Source interface { + Get(path string, ctx SourceContext) (image.Image, error) +} + +// NewContext creates a new SourceContext instance +func NewContext() SourceContext { + return SourceContext{ + m: make(map[string]interface{}), + } +} + +// SourceContext is used to pass source specific parameters +type SourceContext struct { + m map[string]interface{} +} + +// GetString tries to cast the value to a string +func (s SourceContext) GetString(key string) string { + if s, ok := s.m[key].(string); ok { + return s + } + return "" +} + +// Set sets a value +func (s SourceContext) Set(key string, val interface{}) { + s.m[key] = val +} diff --git a/pkg/thumbnails/imgsource/webdav.go b/pkg/thumbnails/imgsource/webdav.go new file mode 100644 index 0000000..5637d94 --- /dev/null +++ b/pkg/thumbnails/imgsource/webdav.go @@ -0,0 +1,41 @@ +package imgsource + +import ( + "fmt" + "image" + "net/http" + "net/url" + "path" +) + +// WebDav implements the Source interface for webdav services +type WebDav struct { + Basepath string +} + +const ( + // WebDavAuth is the parameter name for the autorization token + WebDavAuth = "Authorization" +) + +// Get downloads the file from a webdav service +func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { + u, _ := url.Parse(s.Basepath) + u.Path = path.Join(u.Path, file) + req, err := http.NewRequest(http.MethodGet, u.String(), nil) + if err != nil { + return nil, fmt.Errorf("could not get the file %s error: %s", file, err.Error()) + } + + auth := ctx.GetString(WebDavAuth) + req.Header.Add("Authorization", auth) + + client := &http.Client{} + resp, err := client.Do(req) + if err != nil { + return nil, fmt.Errorf("could not get the file %s error: %s", file, err.Error()) + } + + img, _, _ := image.Decode(resp.Body) + return img, nil +} diff --git a/pkg/thumbnails/thumbnails.go b/pkg/thumbnails/thumbnails.go index 07d163e..5f1614a 100644 --- a/pkg/thumbnails/thumbnails.go +++ b/pkg/thumbnails/thumbnails.go @@ -3,7 +3,6 @@ package thumbnails import ( "bytes" "image" - "os" "strings" "time" @@ -16,14 +15,13 @@ type ThumbnailContext struct { Width int Height int ImagePath string - - Encoder Encoder + Encoder Encoder } // Manager is responsible for generating thumbnails type Manager interface { // Get will return a thumbnail for a file - Get(ThumbnailContext) ([]byte, error) + Get(ThumbnailContext, image.Image) ([]byte, error) GetCached(ThumbnailContext) []byte } @@ -33,18 +31,14 @@ type SimpleManager struct { } // Get implements the Get Method of Manager -func (s SimpleManager) Get(ctx ThumbnailContext) ([]byte, error) { - key := buildCacheKey(ctx) +func (s SimpleManager) Get(ctx ThumbnailContext, img image.Image) ([]byte, error) { + thumbnail := s.generate(ctx, img) - cached := s.Cache.Get(key) - if cached == nil { - thumbnail := s.generate(ctx) - s.Cache.Set(key, thumbnail) - cached = thumbnail - } + key := buildCacheKey(ctx) + s.Cache.Set(key, thumbnail) buf := new(bytes.Buffer) - err := ctx.Encoder.Encode(buf, cached) + err := ctx.Encoder.Encode(buf, thumbnail) if err != nil { return nil, err } @@ -64,15 +58,11 @@ func (s SimpleManager) GetCached(ctx ThumbnailContext) []byte { return buf.Bytes() } -func (s SimpleManager) generate(ctx ThumbnailContext) image.Image { +func (s SimpleManager) generate(ctx ThumbnailContext, img image.Image) image.Image { // TODO: remove, just for demo purposes time.Sleep(time.Second * 2) - // TODO: get file from reva - reader, _ := os.Open(ctx.ImagePath) - defer reader.Close() - m, _, _ := image.Decode(reader) - thumbnail := resize.Thumbnail(uint(ctx.Width), uint(ctx.Height), m, resize.Lanczos2) + thumbnail := resize.Thumbnail(uint(ctx.Width), uint(ctx.Height), img, resize.Lanczos2) return thumbnail } From 0978653f9077d7ddebbc67beb9fec206b19e9201 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 5 Mar 2020 15:04:40 +0100 Subject: [PATCH 03/21] rename cache to storage --- pkg/service/v0/service.go | 6 ++--- pkg/thumbnails/cache/inmemory.go | 22 ---------------- .../{cache => storage}/filesystem.go | 2 +- pkg/thumbnails/storage/inmemory.go | 22 ++++++++++++++++ .../{cache/cache.go => storage/storage.go} | 6 ++--- pkg/thumbnails/thumbnails.go | 26 +++++++++---------- 6 files changed, 42 insertions(+), 42 deletions(-) delete mode 100644 pkg/thumbnails/cache/inmemory.go rename pkg/thumbnails/{cache => storage}/filesystem.go (78%) create mode 100644 pkg/thumbnails/storage/inmemory.go rename pkg/thumbnails/{cache/cache.go => storage/storage.go} (54%) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index d652ecf..4d3b45e 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -7,8 +7,8 @@ import ( "github.com/go-chi/chi" "github.com/owncloud/ocis-thumbnails/pkg/config" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails" - "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/cache" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/imgsource" + "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/storage" ) // Service defines the extension handlers. @@ -28,7 +28,7 @@ func NewService(opts ...Option) Service { config: options.Config, mux: m, manager: thumbnails.SimpleManager{ - Cache: cache.NewInMemoryCache(), + Storage: storage.NewInMemoryStorage(), }, source: imgsource.WebDav{ Basepath: "http://localhost:9140/remote.php/webdav/", @@ -77,7 +77,7 @@ func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { Encoder: encoder, } - thumbnail := g.manager.GetCached(ctx) + thumbnail := g.manager.GetStored(ctx) if thumbnail != nil { w.Write(thumbnail) return diff --git a/pkg/thumbnails/cache/inmemory.go b/pkg/thumbnails/cache/inmemory.go deleted file mode 100644 index d9c45fb..0000000 --- a/pkg/thumbnails/cache/inmemory.go +++ /dev/null @@ -1,22 +0,0 @@ -package cache - -import "image" - -func NewInMemoryCache() InMemoryCache { - return InMemoryCache{ - store: make(map[string]image.Image), - } -} - -type InMemoryCache struct { - store map[string]image.Image -} - -func (fsc InMemoryCache) Get(key string) image.Image { - return fsc.store[key] -} - -func (fsc InMemoryCache) Set(key string, thumbnail image.Image) (image.Image, error) { - fsc.store[key] = thumbnail - return thumbnail, nil -} diff --git a/pkg/thumbnails/cache/filesystem.go b/pkg/thumbnails/storage/filesystem.go similarity index 78% rename from pkg/thumbnails/cache/filesystem.go rename to pkg/thumbnails/storage/filesystem.go index b3e25a4..db9db0b 100644 --- a/pkg/thumbnails/cache/filesystem.go +++ b/pkg/thumbnails/storage/filesystem.go @@ -1,3 +1,3 @@ -package cache +package storage // TODO: implement filesystem cache for longer persistence diff --git a/pkg/thumbnails/storage/inmemory.go b/pkg/thumbnails/storage/inmemory.go new file mode 100644 index 0000000..307a847 --- /dev/null +++ b/pkg/thumbnails/storage/inmemory.go @@ -0,0 +1,22 @@ +package storage + +import "image" + +func NewInMemoryStorage() InMemoryStorage { + return InMemoryStorage{ + store: make(map[string]image.Image), + } +} + +type InMemoryStorage struct { + store map[string]image.Image +} + +func (fsc InMemoryStorage) Get(key string) image.Image { + return fsc.store[key] +} + +func (fsc InMemoryStorage) Set(key string, thumbnail image.Image) (image.Image, error) { + fsc.store[key] = thumbnail + return thumbnail, nil +} diff --git a/pkg/thumbnails/cache/cache.go b/pkg/thumbnails/storage/storage.go similarity index 54% rename from pkg/thumbnails/cache/cache.go rename to pkg/thumbnails/storage/storage.go index 71db593..11a4177 100644 --- a/pkg/thumbnails/cache/cache.go +++ b/pkg/thumbnails/storage/storage.go @@ -1,11 +1,11 @@ -package cache +package storage import ( "image" ) -// Cache defines the interface for a thumbnail cache. -type Cache interface { +// Storage defines the interface for a thumbnail store. +type Storage interface { Get(key string) image.Image Set(key string, thumbnail image.Image) (image.Image, error) } diff --git a/pkg/thumbnails/thumbnails.go b/pkg/thumbnails/thumbnails.go index 5f1614a..61b93bf 100644 --- a/pkg/thumbnails/thumbnails.go +++ b/pkg/thumbnails/thumbnails.go @@ -7,7 +7,7 @@ import ( "time" "github.com/nfnt/resize" - "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/cache" + "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/storage" ) // ThumbnailContext bundles information needed to generate a thumbnail for afile @@ -22,20 +22,20 @@ type ThumbnailContext struct { type Manager interface { // Get will return a thumbnail for a file Get(ThumbnailContext, image.Image) ([]byte, error) - GetCached(ThumbnailContext) []byte + GetStored(ThumbnailContext) []byte } // SimpleManager is a simple implementation of Manager type SimpleManager struct { - Cache cache.Cache + Storage storage.Storage } // Get implements the Get Method of Manager func (s SimpleManager) Get(ctx ThumbnailContext, img image.Image) ([]byte, error) { thumbnail := s.generate(ctx, img) - key := buildCacheKey(ctx) - s.Cache.Set(key, thumbnail) + key := buildKey(ctx) + s.Storage.Set(key, thumbnail) buf := new(bytes.Buffer) err := ctx.Encoder.Encode(buf, thumbnail) @@ -45,16 +45,16 @@ func (s SimpleManager) Get(ctx ThumbnailContext, img image.Image) ([]byte, error return buf.Bytes(), nil } -// GetCached tries to get the cached thumbnail and return it. -// If there is no cached thumbnail it will return nil -func (s SimpleManager) GetCached(ctx ThumbnailContext) []byte { - key := buildCacheKey(ctx) - cached := s.Cache.Get(key) - if cached == nil { +// GetStored tries to get the stored thumbnail and return it. +// If there is no stored thumbnail it will return nil +func (s SimpleManager) GetStored(ctx ThumbnailContext) []byte { + key := buildKey(ctx) + stored := s.Storage.Get(key) + if stored == nil { return nil } buf := new(bytes.Buffer) - ctx.Encoder.Encode(buf, cached) + ctx.Encoder.Encode(buf, stored) return buf.Bytes() } @@ -66,7 +66,7 @@ func (s SimpleManager) generate(ctx ThumbnailContext, img image.Image) image.Ima return thumbnail } -func buildCacheKey(ctx ThumbnailContext) string { +func buildKey(ctx ThumbnailContext) string { parts := []string{ ctx.ImagePath, string(ctx.Width) + "x" + string(ctx.Height), From f55199f01be2f928028365a6b0ac52b19593d764 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Thu, 5 Mar 2020 17:13:19 +0100 Subject: [PATCH 04/21] implement prototype filesystem storage --- pkg/service/v0/service.go | 2 + pkg/thumbnails/storage/filesystem.go | 69 +++++++++++++++++++++++++++- pkg/thumbnails/storage/inmemory.go | 33 ++++++++----- pkg/thumbnails/storage/storage.go | 14 ++++-- pkg/thumbnails/thumbnails.go | 30 ++++++------ 5 files changed, 116 insertions(+), 32 deletions(-) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 4d3b45e..88e4664 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -62,6 +62,7 @@ func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { height, _ := strconv.Atoi(query.Get("height")) fileType := query.Get("type") filePath := query.Get("file_path") + etag := query.Get("etag") encoder := thumbnails.EncoderForType(fileType) if encoder == nil { @@ -75,6 +76,7 @@ func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { Height: height, ImagePath: filePath, Encoder: encoder, + ETag: etag, } thumbnail := g.manager.GetStored(ctx) diff --git a/pkg/thumbnails/storage/filesystem.go b/pkg/thumbnails/storage/filesystem.go index db9db0b..0466a1f 100644 --- a/pkg/thumbnails/storage/filesystem.go +++ b/pkg/thumbnails/storage/filesystem.go @@ -1,3 +1,70 @@ package storage -// TODO: implement filesystem cache for longer persistence +import ( + "bytes" + "fmt" + "io/ioutil" + "os" + "path/filepath" + "strconv" +) + +const BasePath = "/home/corby/tmp/thumbnails/fs/" + +type FileSystem struct { +} + +func (s FileSystem) Get(key string) []byte { + content, err := ioutil.ReadFile(BasePath + key) + if err != nil { + return nil + } + + return content +} + +func (s FileSystem) Set(key string, img []byte) error { + folder := filepath.Dir(BasePath + key) + if err := createFolderIfNotExists(folder); err != nil { + return fmt.Errorf("error while creating folder %s", folder) + } + + f, err := os.Create(BasePath + key) + if err != nil { + fmt.Println(err.Error()) + return err + } + defer f.Close() + _, err = f.Write(img) + if err != nil { + return err + } + return nil +} + +func (s FileSystem) BuildKey(ctx StorageContext) string { + etag := ctx.ETag + filetype := ctx.Types[0] + filename := strconv.Itoa(ctx.Width) + "x" + strconv.Itoa(ctx.Height) + "." + filetype + + key := new(bytes.Buffer) + key.WriteString(etag[:2]) + key.WriteRune('/') + key.WriteString(etag[2:4]) + key.WriteRune('/') + key.WriteString(etag[4:]) + key.WriteRune('/') + key.WriteString(filename) + + return key.String() +} + +func createFolderIfNotExists(folder string) error { + if _, err := os.Stat(folder); os.IsNotExist(err) { + err := os.MkdirAll(folder, 0700) + if err != nil { + return err + } + } + return nil +} diff --git a/pkg/thumbnails/storage/inmemory.go b/pkg/thumbnails/storage/inmemory.go index 307a847..d66d071 100644 --- a/pkg/thumbnails/storage/inmemory.go +++ b/pkg/thumbnails/storage/inmemory.go @@ -1,22 +1,33 @@ package storage -import "image" +import ( + "strings" +) -func NewInMemoryStorage() InMemoryStorage { - return InMemoryStorage{ - store: make(map[string]image.Image), +func NewInMemoryStorage() InMemory { + return InMemory{ + store: make(map[string][]byte), } } -type InMemoryStorage struct { - store map[string]image.Image +type InMemory struct { + store map[string][]byte } -func (fsc InMemoryStorage) Get(key string) image.Image { - return fsc.store[key] +func (s InMemory) Get(key string) []byte { + return s.store[key] } -func (fsc InMemoryStorage) Set(key string, thumbnail image.Image) (image.Image, error) { - fsc.store[key] = thumbnail - return thumbnail, nil +func (s InMemory) Set(key string, thumbnail []byte) error { + s.store[key] = thumbnail + return nil +} + +func (s InMemory) BuildKey(ctx StorageContext) string { + parts := []string{ + ctx.ETag, + string(ctx.Width) + "x" + string(ctx.Height), + strings.Join(ctx.Types, ","), + } + return strings.Join(parts, "+") } diff --git a/pkg/thumbnails/storage/storage.go b/pkg/thumbnails/storage/storage.go index 11a4177..4582433 100644 --- a/pkg/thumbnails/storage/storage.go +++ b/pkg/thumbnails/storage/storage.go @@ -1,11 +1,15 @@ package storage -import ( - "image" -) +type StorageContext struct { + ETag string + Types []string + Width int + Height int +} // Storage defines the interface for a thumbnail store. type Storage interface { - Get(key string) image.Image - Set(key string, thumbnail image.Image) (image.Image, error) + Get(string) []byte + Set(string, []byte) error + BuildKey(StorageContext) string } diff --git a/pkg/thumbnails/thumbnails.go b/pkg/thumbnails/thumbnails.go index 61b93bf..10235f5 100644 --- a/pkg/thumbnails/thumbnails.go +++ b/pkg/thumbnails/thumbnails.go @@ -3,7 +3,6 @@ package thumbnails import ( "bytes" "image" - "strings" "time" "github.com/nfnt/resize" @@ -16,6 +15,7 @@ type ThumbnailContext struct { Height int ImagePath string Encoder Encoder + ETag string } // Manager is responsible for generating thumbnails @@ -34,28 +34,27 @@ type SimpleManager struct { func (s SimpleManager) Get(ctx ThumbnailContext, img image.Image) ([]byte, error) { thumbnail := s.generate(ctx, img) - key := buildKey(ctx) - s.Storage.Set(key, thumbnail) + key := s.Storage.BuildKey(mapToStorageContext(ctx)) buf := new(bytes.Buffer) err := ctx.Encoder.Encode(buf, thumbnail) if err != nil { return nil, err } - return buf.Bytes(), nil + bytes := buf.Bytes() + s.Storage.Set(key, bytes) + return bytes, nil } // GetStored tries to get the stored thumbnail and return it. -// If there is no stored thumbnail it will return nil +// If there is no cached thumbnail it will return nil func (s SimpleManager) GetStored(ctx ThumbnailContext) []byte { - key := buildKey(ctx) + key := s.Storage.BuildKey(mapToStorageContext(ctx)) stored := s.Storage.Get(key) if stored == nil { return nil } - buf := new(bytes.Buffer) - ctx.Encoder.Encode(buf, stored) - return buf.Bytes() + return stored } func (s SimpleManager) generate(ctx ThumbnailContext, img image.Image) image.Image { @@ -66,11 +65,12 @@ func (s SimpleManager) generate(ctx ThumbnailContext, img image.Image) image.Ima return thumbnail } -func buildKey(ctx ThumbnailContext) string { - parts := []string{ - ctx.ImagePath, - string(ctx.Width) + "x" + string(ctx.Height), - strings.Join(ctx.Encoder.Types(), ","), +func mapToStorageContext(ctx ThumbnailContext) storage.StorageContext { + sCtx := storage.StorageContext{ + ETag: ctx.ETag, + Width: ctx.Width, + Height: ctx.Height, + Types: ctx.Encoder.Types(), } - return strings.Join(parts, "+") + return sCtx } From 975387822b537f2be4bdf95f4dbe70f78b5fcf41 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 9 Mar 2020 16:01:20 +0100 Subject: [PATCH 05/21] add config for filesystem storage --- pkg/config/config.go | 16 +++++++++++----- pkg/flagset/flagset.go | 7 +++++++ pkg/thumbnails/imgsource/webdav.go | 4 ++-- pkg/thumbnails/storage/filesystem.go | 12 +++++++----- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index c92c982..13b7a8e 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -33,11 +33,17 @@ type Tracing struct { // Config combines all available configuration parts. type Config struct { - File string - Log Log - Debug Debug - HTTP HTTP - Tracing Tracing + File string + Log Log + Debug Debug + HTTP HTTP + Tracing Tracing + FilesystemStorage FilesystemStorage +} + +// FilesystemStorage defines the available filesystem storage configuration. +type FilesystemStorage struct { + RootDirectory string } // New initializes a new configuration with or without defaults. diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 39d4005..b9f4f30 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -134,5 +134,12 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { EnvVars: []string{"THUMBNAILS_HTTP_ROOT"}, Destination: &cfg.HTTP.Root, }, + &cli.StringFlag{ + Name: "filesystemstorage-root", + Value: "/tmp/ocis-thumbnails/", + Usage: "Root path of the filesystem storage directory", + EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"}, + Destination: &cfg.FilesystemStorage.RootDirectory, + }, } } diff --git a/pkg/thumbnails/imgsource/webdav.go b/pkg/thumbnails/imgsource/webdav.go index 5637d94..b3c1ba8 100644 --- a/pkg/thumbnails/imgsource/webdav.go +++ b/pkg/thumbnails/imgsource/webdav.go @@ -24,7 +24,7 @@ func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { u.Path = path.Join(u.Path, file) req, err := http.NewRequest(http.MethodGet, u.String(), nil) if err != nil { - return nil, fmt.Errorf("could not get the file %s error: %s", file, err.Error()) + return nil, fmt.Errorf("could not get the file \"%s\" error: %s", file, err.Error()) } auth := ctx.GetString(WebDavAuth) @@ -33,7 +33,7 @@ func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { client := &http.Client{} resp, err := client.Do(req) if err != nil { - return nil, fmt.Errorf("could not get the file %s error: %s", file, err.Error()) + return nil, fmt.Errorf("could not get the file \"%s\" error: %s", file, err.Error()) } img, _, _ := image.Decode(resp.Body) diff --git a/pkg/thumbnails/storage/filesystem.go b/pkg/thumbnails/storage/filesystem.go index 0466a1f..e306a11 100644 --- a/pkg/thumbnails/storage/filesystem.go +++ b/pkg/thumbnails/storage/filesystem.go @@ -7,15 +7,16 @@ import ( "os" "path/filepath" "strconv" -) -const BasePath = "/home/corby/tmp/thumbnails/fs/" + "github.com/owncloud/ocis-thumbnails/pkg/config" +) type FileSystem struct { + cfg config.FilesystemStorage } func (s FileSystem) Get(key string) []byte { - content, err := ioutil.ReadFile(BasePath + key) + content, err := ioutil.ReadFile(filepath.Join(s.cfg.RootDirectory, key)) if err != nil { return nil } @@ -24,12 +25,13 @@ func (s FileSystem) Get(key string) []byte { } func (s FileSystem) Set(key string, img []byte) error { - folder := filepath.Dir(BasePath + key) + path := filepath.Join(s.cfg.RootDirectory, key) + folder := filepath.Dir(path) if err := createFolderIfNotExists(folder); err != nil { return fmt.Errorf("error while creating folder %s", folder) } - f, err := os.Create(BasePath + key) + f, err := os.Create(path) if err != nil { fmt.Println(err.Error()) return err From 4647168160876160f8f307abe4c1e6dd204aaf2c Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 9 Mar 2020 17:03:33 +0100 Subject: [PATCH 06/21] clean up and add comments --- pkg/config/config.go | 6 ++-- pkg/service/v0/service.go | 4 +-- pkg/thumbnails/encoding.go | 11 ++++++++ pkg/thumbnails/storage/filesystem.go | 42 +++++++++++++++++----------- pkg/thumbnails/storage/storage.go | 5 ++-- pkg/thumbnails/thumbnails.go | 27 ++++++++---------- 6 files changed, 55 insertions(+), 40 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 13b7a8e..3d66ec9 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -38,11 +38,11 @@ type Config struct { Debug Debug HTTP HTTP Tracing Tracing - FilesystemStorage FilesystemStorage + FileSystemStorage FileSystemStorage } -// FilesystemStorage defines the available filesystem storage configuration. -type FilesystemStorage struct { +// FileSystemStorage defines the available filesystem storage configuration. +type FileSystemStorage struct { RootDirectory string } diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 88e4664..8c88cd6 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -28,7 +28,7 @@ func NewService(opts ...Option) Service { config: options.Config, mux: m, manager: thumbnails.SimpleManager{ - Storage: storage.NewInMemoryStorage(), + Storage: storage.NewFileSystemStorage(options.Config.FileSystemStorage), }, source: imgsource.WebDav{ Basepath: "http://localhost:9140/remote.php/webdav/", @@ -71,7 +71,7 @@ func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { w.Write([]byte("can't encode that")) return } - ctx := thumbnails.ThumbnailContext{ + ctx := thumbnails.Context{ Width: width, Height: height, ImagePath: filePath, diff --git a/pkg/thumbnails/encoding.go b/pkg/thumbnails/encoding.go index 60a02f5..8deb128 100644 --- a/pkg/thumbnails/encoding.go +++ b/pkg/thumbnails/encoding.go @@ -8,31 +8,42 @@ import ( "strings" ) +// Encoder encodes the thumbnail to a specific format. type Encoder interface { + // Encode encodes the image to a format. Encode(io.Writer, image.Image) error + // Types returns the formats suffixes. Types() []string } +// PngEncoder encodes to png type PngEncoder struct{} +// Encode encodes to png format func (e PngEncoder) Encode(w io.Writer, i image.Image) error { return png.Encode(w, i) } +// Types returns the png suffix func (e PngEncoder) Types() []string { return []string{"png"} } +// JpegEncoder encodes to jpg. type JpegEncoder struct{} +// Encode encodes to jpg func (e JpegEncoder) Encode(w io.Writer, i image.Image) error { return jpeg.Encode(w, i, nil) } +// Types returns the jpg suffixes. func (e JpegEncoder) Types() []string { return []string{"jpeg", "jpg"} } +// EncoderForType returns the encoder for a given file type +// or nil if the type is not supported. func EncoderForType(fileType string) Encoder { switch strings.ToLower(fileType) { case "png": diff --git a/pkg/thumbnails/storage/filesystem.go b/pkg/thumbnails/storage/filesystem.go index e306a11..e92e91b 100644 --- a/pkg/thumbnails/storage/filesystem.go +++ b/pkg/thumbnails/storage/filesystem.go @@ -11,12 +11,21 @@ import ( "github.com/owncloud/ocis-thumbnails/pkg/config" ) +// NewFileSystemStorage creates a new instanz of FileSystem +func NewFileSystemStorage(cfg config.FileSystemStorage) FileSystem { + return FileSystem{ + dir: cfg.RootDirectory, + } +} + +// FileSystem represents a storage for the thumbnails using the local file system. type FileSystem struct { - cfg config.FilesystemStorage + dir string } +// Get loads the image from the file system. func (s FileSystem) Get(key string) []byte { - content, err := ioutil.ReadFile(filepath.Join(s.cfg.RootDirectory, key)) + content, err := ioutil.ReadFile(filepath.Join(s.dir, key)) if err != nil { return nil } @@ -24,11 +33,12 @@ func (s FileSystem) Get(key string) []byte { return content } +// Set writes the image to the file system. func (s FileSystem) Set(key string, img []byte) error { - path := filepath.Join(s.cfg.RootDirectory, key) - folder := filepath.Dir(path) - if err := createFolderIfNotExists(folder); err != nil { - return fmt.Errorf("error while creating folder %s", folder) + path := filepath.Join(s.dir, key) + dir := filepath.Dir(path) + if err := os.MkdirAll(dir, 0700); err != nil { + return fmt.Errorf("error while creating directory %s", dir) } f, err := os.Create(path) @@ -44,7 +54,15 @@ func (s FileSystem) Set(key string, img []byte) error { return nil } -func (s FileSystem) BuildKey(ctx StorageContext) string { +// BuildKey generate the unique key for a thumbnail. +// The key is structure as follows: +// +// ///x. +// +// e.g. 97/9f/4c8db98f7b82e768ef478d3c8612/500x300.png +// +// The key also represents the path to the thumbnail in the filesystem under the configured root directory. +func (s FileSystem) BuildKey(ctx Context) string { etag := ctx.ETag filetype := ctx.Types[0] filename := strconv.Itoa(ctx.Width) + "x" + strconv.Itoa(ctx.Height) + "." + filetype @@ -60,13 +78,3 @@ func (s FileSystem) BuildKey(ctx StorageContext) string { return key.String() } - -func createFolderIfNotExists(folder string) error { - if _, err := os.Stat(folder); os.IsNotExist(err) { - err := os.MkdirAll(folder, 0700) - if err != nil { - return err - } - } - return nil -} diff --git a/pkg/thumbnails/storage/storage.go b/pkg/thumbnails/storage/storage.go index 4582433..8f5f3d9 100644 --- a/pkg/thumbnails/storage/storage.go +++ b/pkg/thumbnails/storage/storage.go @@ -1,6 +1,7 @@ package storage -type StorageContext struct { +// Context combines different attributes needed for storage operations. +type Context struct { ETag string Types []string Width int @@ -11,5 +12,5 @@ type StorageContext struct { type Storage interface { Get(string) []byte Set(string, []byte) error - BuildKey(StorageContext) string + BuildKey(Context) string } diff --git a/pkg/thumbnails/thumbnails.go b/pkg/thumbnails/thumbnails.go index 10235f5..7172bac 100644 --- a/pkg/thumbnails/thumbnails.go +++ b/pkg/thumbnails/thumbnails.go @@ -3,14 +3,13 @@ package thumbnails import ( "bytes" "image" - "time" "github.com/nfnt/resize" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/storage" ) -// ThumbnailContext bundles information needed to generate a thumbnail for afile -type ThumbnailContext struct { +// Context bundles information needed to generate a thumbnail for afile +type Context struct { Width int Height int ImagePath string @@ -21,8 +20,10 @@ type ThumbnailContext struct { // Manager is responsible for generating thumbnails type Manager interface { // Get will return a thumbnail for a file - Get(ThumbnailContext, image.Image) ([]byte, error) - GetStored(ThumbnailContext) []byte + Get(Context, image.Image) ([]byte, error) + // GetStored loads the thumbnail from the storage. + // It will return nil if no image is stored for the given context. + GetStored(Context) []byte } // SimpleManager is a simple implementation of Manager @@ -31,7 +32,7 @@ type SimpleManager struct { } // Get implements the Get Method of Manager -func (s SimpleManager) Get(ctx ThumbnailContext, img image.Image) ([]byte, error) { +func (s SimpleManager) Get(ctx Context, img image.Image) ([]byte, error) { thumbnail := s.generate(ctx, img) key := s.Storage.BuildKey(mapToStorageContext(ctx)) @@ -48,25 +49,19 @@ func (s SimpleManager) Get(ctx ThumbnailContext, img image.Image) ([]byte, error // GetStored tries to get the stored thumbnail and return it. // If there is no cached thumbnail it will return nil -func (s SimpleManager) GetStored(ctx ThumbnailContext) []byte { +func (s SimpleManager) GetStored(ctx Context) []byte { key := s.Storage.BuildKey(mapToStorageContext(ctx)) stored := s.Storage.Get(key) - if stored == nil { - return nil - } return stored } -func (s SimpleManager) generate(ctx ThumbnailContext, img image.Image) image.Image { - // TODO: remove, just for demo purposes - time.Sleep(time.Second * 2) - +func (s SimpleManager) generate(ctx Context, img image.Image) image.Image { thumbnail := resize.Thumbnail(uint(ctx.Width), uint(ctx.Height), img, resize.Lanczos2) return thumbnail } -func mapToStorageContext(ctx ThumbnailContext) storage.StorageContext { - sCtx := storage.StorageContext{ +func mapToStorageContext(ctx Context) storage.Context { + sCtx := storage.Context{ ETag: ctx.ETag, Width: ctx.Width, Height: ctx.Height, From d8c359332b8d31f1a2acc10f9c7a4e2a86f8a312 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 10 Mar 2020 10:57:30 +0100 Subject: [PATCH 07/21] rename Context --- pkg/thumbnails/storage/inmemory.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/thumbnails/storage/inmemory.go b/pkg/thumbnails/storage/inmemory.go index d66d071..aa9e84a 100644 --- a/pkg/thumbnails/storage/inmemory.go +++ b/pkg/thumbnails/storage/inmemory.go @@ -23,7 +23,7 @@ func (s InMemory) Set(key string, thumbnail []byte) error { return nil } -func (s InMemory) BuildKey(ctx StorageContext) string { +func (s InMemory) BuildKey(ctx Context) string { parts := []string{ ctx.ETag, string(ctx.Width) + "x" + string(ctx.Height), From 2a587b37c85691dba88bd816ea752069410c8c21 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Tue, 10 Mar 2020 14:47:42 +0100 Subject: [PATCH 08/21] clean up and add comments --- pkg/config/config.go | 6 ++++++ pkg/flagset/flagset.go | 9 ++++++++- pkg/service/v0/service.go | 4 +--- pkg/thumbnails/imgsource/webdav.go | 26 +++++++++++++++++++++----- pkg/thumbnails/storage/inmemory.go | 6 ++++++ 5 files changed, 42 insertions(+), 9 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index 3d66ec9..a5bc260 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -39,6 +39,7 @@ type Config struct { HTTP HTTP Tracing Tracing FileSystemStorage FileSystemStorage + WebDavSource WebDavSource } // FileSystemStorage defines the available filesystem storage configuration. @@ -46,6 +47,11 @@ type FileSystemStorage struct { RootDirectory string } +// WebDavSource defines the available webdav source configuration. +type WebDavSource struct { + BaseURL string +} + // New initializes a new configuration with or without defaults. func New() *Config { return &Config{} diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index b9f4f30..75af98d 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -139,7 +139,14 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { Value: "/tmp/ocis-thumbnails/", Usage: "Root path of the filesystem storage directory", EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"}, - Destination: &cfg.FilesystemStorage.RootDirectory, + Destination: &cfg.FileSystemStorage.RootDirectory, + }, + &cli.StringFlag{ + Name: "webdavsource-baseurl", + Value: "http://localhost:9140/remote.php/webdav/", + Usage: "Base url for a webdav api", + EnvVars: []string{"THUMBNAILS_WEBDAVSOURCE_BASEURL"}, + Destination: &cfg.WebDavSource.BaseURL, }, } } diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 8c88cd6..8740f5a 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -30,9 +30,7 @@ func NewService(opts ...Option) Service { manager: thumbnails.SimpleManager{ Storage: storage.NewFileSystemStorage(options.Config.FileSystemStorage), }, - source: imgsource.WebDav{ - Basepath: "http://localhost:9140/remote.php/webdav/", - }, + source: imgsource.NewWebDavSource(options.Config.WebDavSource), } m.Route(options.Config.HTTP.Root, func(r chi.Router) { diff --git a/pkg/thumbnails/imgsource/webdav.go b/pkg/thumbnails/imgsource/webdav.go index b3c1ba8..a6d8fdb 100644 --- a/pkg/thumbnails/imgsource/webdav.go +++ b/pkg/thumbnails/imgsource/webdav.go @@ -6,11 +6,20 @@ import ( "net/http" "net/url" "path" + + "github.com/owncloud/ocis-thumbnails/pkg/config" ) +// NewWebDavSource creates a new webdav instance. +func NewWebDavSource(cfg config.WebDavSource) WebDav { + return WebDav{ + baseURL: cfg.BaseURL, + } +} + // WebDav implements the Source interface for webdav services type WebDav struct { - Basepath string + baseURL string } const ( @@ -20,11 +29,11 @@ const ( // Get downloads the file from a webdav service func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { - u, _ := url.Parse(s.Basepath) + u, _ := url.Parse(s.baseURL) u.Path = path.Join(u.Path, file) req, err := http.NewRequest(http.MethodGet, u.String(), nil) if err != nil { - return nil, fmt.Errorf("could not get the file \"%s\" error: %s", file, err.Error()) + return nil, fmt.Errorf("could not get the image \"%s\" error: %s", file, err.Error()) } auth := ctx.GetString(WebDavAuth) @@ -33,9 +42,16 @@ func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { client := &http.Client{} resp, err := client.Do(req) if err != nil { - return nil, fmt.Errorf("could not get the file \"%s\" error: %s", file, err.Error()) + return nil, fmt.Errorf("could not get the image \"%s\" error: %s", file, err.Error()) } - img, _, _ := image.Decode(resp.Body) + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("could not get the image \"%s\". Request returned with statuscode %d ", file, resp.StatusCode) + } + + img, _, err := image.Decode(resp.Body) + if err != nil { + return nil, fmt.Errorf("could not decode the image \"%s\". error: %s", file, err.Error()) + } return img, nil } diff --git a/pkg/thumbnails/storage/inmemory.go b/pkg/thumbnails/storage/inmemory.go index aa9e84a..c8f02a9 100644 --- a/pkg/thumbnails/storage/inmemory.go +++ b/pkg/thumbnails/storage/inmemory.go @@ -4,25 +4,31 @@ import ( "strings" ) +// NewInMemoryStorage creates a new InMemory instance. func NewInMemoryStorage() InMemory { return InMemory{ store: make(map[string][]byte), } } +// InMemory represents an in memory storage for thumbnails +// Can be used during development type InMemory struct { store map[string][]byte } +// Get loads the thumbnail from memory. func (s InMemory) Get(key string) []byte { return s.store[key] } +// Set stores the thumbnail in memory. func (s InMemory) Set(key string, thumbnail []byte) error { s.store[key] = thumbnail return nil } +// BuildKey generates a unique key to store and retrieve the thumbnail. func (s InMemory) BuildKey(ctx Context) string { parts := []string{ ctx.ETag, From e0354f2ce9fceaae1d066e72994289c9eac9307b Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 9 Mar 2020 11:30:56 +0100 Subject: [PATCH 09/21] Fix Formatting --- .github/config.yml | 1 + CHANGELOG.md | 15 ++++++++++ Makefile | 6 ++-- changelog/CHANGELOG.tmpl | 8 ++--- changelog/unreleased/.keep | 0 changelog/unreleased/initial-version | 7 +++++ go.mod | 2 ++ go.sum | 45 ++++++++++++++++++++++++++++ tools.go | 8 +++++ 9 files changed, 85 insertions(+), 7 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 changelog/unreleased/.keep create mode 100644 changelog/unreleased/initial-version create mode 100644 tools.go diff --git a/.github/config.yml b/.github/config.yml index c723ec7..229466c 100644 --- a/.github/config.yml +++ b/.github/config.yml @@ -3,6 +3,7 @@ # Comment to be posted to on PRs that don't update documentation updateDocsComment: > Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a [changelog](https://github.com/owncloud/ocis-thumbnails/blob/master/changelog/README.md) item based on your changes. + updateDocsWhiteList: - Tests-only - tests-only diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..1f8ea9e --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changes in unreleased + +## Summary + +* Change - Initial release of basic version: [#1](https://github.com/owncloud/ocis-thumbnails/issues/1) + +## Details + +* Change - Initial release of basic version: [#1](https://github.com/owncloud/ocis-thumbnails/issues/1) + + Just prepare an initial basic version to embed a thumbnailer into our microservice + infrastructure in the scope of the ownCloud Infinite Scale project. + + https://github.com/owncloud/ocis-thumbnails/issues/1 + diff --git a/Makefile b/Makefile index 8e45e15..bbfafe3 100644 --- a/Makefile +++ b/Makefile @@ -110,15 +110,15 @@ release-dirs: .PHONY: release-linux release-linux: release-dirs - go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)--' ./cmd/$(NAME) + go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'linux' -arch 'amd64 386 arm64 arm' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) .PHONY: release-windows release-windows: release-dirs - go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)--' ./cmd/$(NAME) + go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '-extldflags "-static" $(LDFLAGS)' -os 'windows' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) .PHONY: release-darwin release-darwin: release-dirs - go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)--' ./cmd/$(NAME) + go run github.com/mitchellh/gox -tags 'netgo $(TAGS)' -ldflags '$(LDFLAGS)' -os 'darwin' -arch 'amd64' -output '$(DIST)/binaries/$(EXECUTABLE)-$(OUTPUT)-{{.OS}}-{{.Arch}}' ./cmd/$(NAME) .PHONY: release-copy release-copy: diff --git a/changelog/CHANGELOG.tmpl b/changelog/CHANGELOG.tmpl index 886288f..17f148f 100644 --- a/changelog/CHANGELOG.tmpl +++ b/changelog/CHANGELOG.tmpl @@ -3,7 +3,7 @@ {{ if gt (len $allVersions) 1 -}} # Changelog for [{{ .Version }}] ({{ .Date }}) -The following sections list the changes in ownCloudocis-thumbnails{{ .Version }}. +The following sections list the changes in ownCloudocis-thumbnails {{ .Version }}. {{/* creating version compare links */ -}} {{ $next := add1 $index -}} @@ -30,12 +30,12 @@ The following sections list the changes in ownCloudocis-thumbnails{{ .Version }} ## Summary {{ range $entry := .Entries }}{{ with $entry }} - * {{ .TypeShort }} #{{ .PrimaryID }}: {{ .Title }} +* {{ .Type }} - {{ .Title }}: [#{{ .PrimaryID }}]({{ .PrimaryURL }}) {{- end }}{{ end }} ## Details {{ range $entry := .Entries }}{{ with $entry }} - * {{ .Type }} #{{ .PrimaryID }}: {{ .Title }} +* {{ .Type }} - {{ .Title }}: [#{{ .PrimaryID }}]({{ .PrimaryURL }}) {{ range $par := .Paragraphs }} {{ wrapIndent $par 80 3 }} {{ end -}} @@ -50,4 +50,4 @@ The following sections list the changes in ownCloudocis-thumbnails{{ .Version }} {{ end }} {{ end }}{{ end -}} -{{ end }}{{ end -}} \ No newline at end of file +{{ end }}{{ end -}} diff --git a/changelog/unreleased/.keep b/changelog/unreleased/.keep new file mode 100644 index 0000000..e69de29 diff --git a/changelog/unreleased/initial-version b/changelog/unreleased/initial-version new file mode 100644 index 0000000..eeb21e0 --- /dev/null +++ b/changelog/unreleased/initial-version @@ -0,0 +1,7 @@ +Change: Initial release of basic version + +Just prepare an initial basic version to embed a thumbnailer into our +microservice infrastructure in the scope of the ownCloud Infinite Scale +project. + +https://github.com/owncloud/ocis-thumbnails/issues/1 diff --git a/go.mod b/go.mod index 0cde5ba..3972a7d 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( contrib.go.opencensus.io/exporter/jaeger v0.2.0 contrib.go.opencensus.io/exporter/ocagent v0.6.0 contrib.go.opencensus.io/exporter/zipkin v0.1.1 + github.com/UnnoTed/fileb0x v1.1.4 // indirect github.com/cespare/reflex v0.2.0 // indirect github.com/go-chi/chi v4.0.2+incompatible github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect @@ -15,6 +16,7 @@ require ( github.com/oklog/run v1.0.0 github.com/openzipkin/zipkin-go v0.2.2 github.com/owncloud/ocis-pkg/v2 v2.0.1 + github.com/restic/calens v0.2.0 // indirect github.com/spf13/viper v1.5.0 go.opencensus.io v0.22.2 ) diff --git a/go.sum b/go.sum index 0767e8b..4dc7390 100644 --- a/go.sum +++ b/go.sum @@ -51,6 +51,12 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190605020000-c4ba1fdf4d36/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.0.2 h1:tRi7ENs+AaOUCH+j6qwNQgPYfV26dX3JNonq+V4mhqc= +github.com/Masterminds/semver/v3 v3.0.2/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/sprig/v3 v3.0.1 h1:RuaOafp+8qOLUPX1lInLfUrLc1MEVbnz7a40RLoixKY= +github.com/Masterminds/sprig/v3 v3.0.1/go.mod h1:Cp7HwZjmqKrC+Y7XqSJOU2yRvAJRGLiohfgz5ZJj8+4= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= @@ -64,6 +70,8 @@ github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJ github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/sarama v1.24.1/go.mod h1:fGP8eQ6PugKEI0iUETYYtnP6d1pH/bdDMTel1X5ajsU= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= +github.com/UnnoTed/fileb0x v1.1.4 h1:IUgFzgBipF/ujNx9wZgkrKOF3oltUuXMSoaejrBws+A= +github.com/UnnoTed/fileb0x v1.1.4/go.mod h1:X59xXT18tdNk/D6j+KZySratBsuKJauMtVuJ9cgOiZs= github.com/abbot/go-http-auth v0.4.1-0.20181019201920-860ed7f246ff/go.mod h1:Cz6ARTIzApMJDzh5bRMSUou6UMSp0IEXg9km/ci7TJM= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k= @@ -108,6 +116,8 @@ github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6r github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= +github.com/bmatcuk/doublestar v1.1.1 h1:YroD6BJCZBYx06yYFEWvUuKVWQn3vLLQAVmDmvTSaiQ= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= @@ -168,6 +178,7 @@ github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/decker502/dnspod-go v0.2.0/go.mod h1:qsurYu1FgxcDwfSwXJdLt4kRsBLZeosEb9uq4Sy+08g= github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= @@ -212,6 +223,8 @@ github.com/fsouza/go-dockerclient v1.4.4/go.mod h1:PrwszSL5fbmsESocROrOGq/NULMXR github.com/fsouza/go-dockerclient v1.6.0/go.mod h1:YWwtNPuL4XTX1SKJQk86cWPmmqwx+4np9qfPbb+znGc= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gizak/termui/v3 v3.1.0 h1:ZZmVDgwHl7gR7elfKf1xc4IudXZ5qqfDh4wExk4Iajc= +github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= @@ -245,6 +258,7 @@ github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stomp/stomp v2.0.3+incompatible/go.mod h1:VqCtqNZv1226A1/79yh+rMiFUcfY3R109np+7ke4n0c= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= +github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= @@ -365,10 +379,13 @@ github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 h1:FdBGmSkD2Qp github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5/go.mod h1:0YZ2wQSuwviXXXGUiK6zXzskyBLAbLXhamxzcFHSLoM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= +github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84= +github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= @@ -393,6 +410,8 @@ github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSg github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/justinas/alice v1.2.0 h1:+MHSA/vccVCF4Uq37S42jwlkvI2Xzl7zTPCN5BnZNVo= github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA= +github.com/karrick/godirwalk v1.7.8 h1:VfG72pyIxgtC7+3X9CMHI0AOl4LwyRAg98WAgsvffi8= +github.com/karrick/godirwalk v1.7.8/go.mod h1:2c9FRhkDxdIbgkOnCEvnSWs71Bhugbl46shStcFDJ34= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs= github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= @@ -412,6 +431,10 @@ github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= +github.com/labstack/echo v3.2.1+incompatible h1:J2M7YArHx4gi8p/3fDw8tX19SXhBCoRpviyAZSN3I88= +github.com/labstack/echo v3.2.1+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s= +github.com/labstack/gommon v0.2.7 h1:2qOPq/twXDrQ6ooBGrn3mrmVOC+biLlatwgIu8lbzRM= +github.com/labstack/gommon v0.2.7/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= @@ -435,11 +458,16 @@ github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGD github.com/marten-seemann/qtls v0.3.2/go.mod h1:xzjG7avBwGGbdZ8dTGxlBnLArsVKLvwmjgmPuiQEcYk= github.com/marten-seemann/qtls v0.4.1 h1:YlT8QP3WCCvvok7MGEZkMldXbyqgr8oFg5/n8Gtbkks= github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc= +github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= +github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= +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-tty v0.0.0-20180219170247-931426f7535a/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -473,12 +501,15 @@ github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM= github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= @@ -489,6 +520,7 @@ github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0Qu github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -530,6 +562,8 @@ github.com/nrdcg/auroradns v1.0.0/go.mod h1:6JPXKzIRzZzMqtTDgueIhTi6rFf1QvYE/Hzq github.com/nrdcg/dnspod-go v0.3.0/go.mod h1:vZSoFSFeQVm2gWLMkyX61LZ8HI3BaqtHZWgPTGKr6KQ= github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2SwKQ= github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= +github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyhcnrFqxvNVCBPb2KZ9hV2RBdS840= +github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= github.com/nsqio/go-nsq v1.0.7/go.mod h1:XP5zaUs3pqf+Q71EqUJs3HYfBIqfK6G83WQMdNN+Ito= github.com/ogier/pflag v0.0.1 h1:RW6JSWSu/RkSatfcLtogGfFgpim5p7ARQ10ECk5O750= github.com/ogier/pflag v0.0.1/go.mod h1:zkFki7tvTa0tafRvTBIZTvzYyAu6kQhPZFnshFFPE+g= @@ -586,6 +620,7 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 h1:J9b7z+QKAmPf4YLrFg6oQUotqHQeUNWwkvo7jZp1GLU= @@ -622,6 +657,8 @@ github.com/rainycape/memcache v0.0.0-20150622160815-1031fa0ce2f2/go.mod h1:7tZKc github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/restic/calens v0.1.0 h1:RHGokdZ72dICyIz1EjEsfZwUhvNZz/zy2SawxJktdWA= github.com/restic/calens v0.1.0/go.mod h1:u67f5msOjCTDYNzOf/NoAUSdmXP03YXPCwIQLYADy5M= +github.com/restic/calens v0.2.0 h1:LVNAtmFc+Pb4ODX66qdX1T3Di1P0OTLyUsVyvM/xD7E= +github.com/restic/calens v0.2.0/go.mod h1:UXwyAKS4wsgUZGEc7NrzzygJbLsQZIo3wl+62Q1wvmU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= @@ -677,6 +714,7 @@ github.com/stretchr/testify v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRci github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= @@ -697,6 +735,10 @@ github.com/uber/jaeger-client-go v2.15.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMW github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc= github.com/urfave/cli v0.0.0-20171014202726-7bc6a0acffa5/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 h1:gKMu1Bf6QINDnvyZuTaACm9ofY+PRh+5vFz4oxBZeF8= +github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA= github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= @@ -739,6 +781,7 @@ gocloud.dev v0.17.0/go.mod h1:tIHTRdR1V5dlD8sTkzYdTGizBJ314BDykJ8KmadEXwo= gocloud.dev/pubsub/rabbitpubsub v0.17.0/go.mod h1:7o1XYDiIC+b0mmcwJuofsDg08t0DtU2ubfn7C/Uz7Y0= golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -787,6 +830,7 @@ golang.org/x/net v0.0.0-20180611182652-db08ff08e862/go.mod h1:mL1N/T3taQHkDXs73r 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= +golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -836,6 +880,7 @@ golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5h 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= +golang.org/x/sys v0.0.0-20181019160139-8e24a49d80f8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/tools.go b/tools.go new file mode 100644 index 0000000..8a77af6 --- /dev/null +++ b/tools.go @@ -0,0 +1,8 @@ +// +build tools + +package main + +import ( + _ "github.com/UnnoTed/fileb0x" + _ "github.com/restic/calens" +) From 61d0e5263c22e7fc9b6c0db5152f520853ad7cec Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 9 Mar 2020 12:04:02 +0100 Subject: [PATCH 10/21] Update README.md --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ae2d1e6..7d6963a 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,11 @@ # ownCloud Infinite Scale: THUMBNAILS -== Badges need to be provided manually == +[![Build Status](https://cloud.drone.io/api/badges/owncloud/ocis-thumbnails/status.svg)](https://cloud.drone.io/owncloud/ocis-thumbnails) +[![Gitter chat](https://badges.gitter.im/cs3org/reva.svg)](https://gitter.im/cs3org/reva) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/5dcc0c9b2319462dbbe517d90219062c)](https://www.codacy.com/gh/owncloud/ocis-thumbnails?utm_source=github.com&utm_medium=referral&utm_content=owncloud/ocis-thumbnails&utm_campaign=Badge_Grade) +[![Go Doc](https://godoc.org/github.com/owncloud/ocis-thumbnails?status.svg)](http://godoc.org/github.com/owncloud/ocis-thumbnails) +[![Go Report](http://goreportcard.com/badge/github.com/owncloud/ocis-thumbnails)](http://goreportcard.com/report/github.com/owncloud/ocis-thumbnails) +[![](https://images.microbadger.com/badges/image/owncloud/ocis-thumbnails.svg)](http://microbadger.com/images/owncloud/ocis-thumbnails "Get your own image badge on microbadger.com") **This project is under heavy development, it's not in a working state yet!** From 78b5231ac2f3b1da825deb26d9c999104de3365e Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 9 Mar 2020 12:05:31 +0100 Subject: [PATCH 11/21] Update manifest.tmpl --- docker/manifest.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/manifest.tmpl b/docker/manifest.tmpl index 254456d..cddd65a 100644 --- a/docker/manifest.tmpl +++ b/docker/manifest.tmpl @@ -1,4 +1,4 @@ -image: owncloud/ocis-thumbnails :{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} +image: owncloud/ocis-thumbnails:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}} {{#if build.tags}} tags: {{#each build.tags}} @@ -6,16 +6,16 @@ tags: {{/each}} {{/if}} manifests: - - image: owncloud/ocis-thumbnails :{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 + - image: owncloud/ocis-thumbnails:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64 platform: architecture: amd64 os: linux - - image: owncloud/ocis-thumbnails :{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 + - image: owncloud/ocis-thumbnails:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm64 platform: architecture: arm64 variant: v8 os: linux - - image: owncloud/ocis-thumbnails :{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm + - image: owncloud/ocis-thumbnails:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-arm platform: architecture: arm variant: v6 From e36a7ef0cc368665e51b4f732de3129ea5a56603 Mon Sep 17 00:00:00 2001 From: Michael Barz Date: Mon, 9 Mar 2020 12:42:56 +0100 Subject: [PATCH 12/21] Typo in CHANGELOG.tmpl --- changelog/CHANGELOG.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/CHANGELOG.tmpl b/changelog/CHANGELOG.tmpl index 17f148f..caa3daa 100644 --- a/changelog/CHANGELOG.tmpl +++ b/changelog/CHANGELOG.tmpl @@ -3,7 +3,7 @@ {{ if gt (len $allVersions) 1 -}} # Changelog for [{{ .Version }}] ({{ .Date }}) -The following sections list the changes in ownCloudocis-thumbnails {{ .Version }}. +The following sections list the changes in ocis-thumbnails {{ .Version }}. {{/* creating version compare links */ -}} {{ $next := add1 $index -}} From 985c11896fa3effe98c2c3f8601a9ee2d3ac22b0 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 11 Mar 2020 14:18:25 +0100 Subject: [PATCH 13/21] refactoring: implement review feedback --- pkg/flagset/flagset.go | 6 ++--- pkg/service/v0/service.go | 17 +++++++------- pkg/thumbnails/imgsource/imgsource.go | 32 +++++---------------------- pkg/thumbnails/imgsource/webdav.go | 13 +++++++++-- 4 files changed, 27 insertions(+), 41 deletions(-) diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 75af98d..8512b2d 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -42,7 +42,7 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag { return []cli.Flag{ &cli.StringFlag{ Name: "debug-addr", - Value: "0.0.0.0:9114", + Value: "0.0.0.0:9189", Usage: "Address to debug endpoint", EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -89,7 +89,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "debug-addr", - Value: "0.0.0.0:9194", + Value: "0.0.0.0:9189", Usage: "Address to bind debug server", EnvVars: []string{"THUMBNAILS_DEBUG_ADDR"}, Destination: &cfg.Debug.Addr, @@ -115,7 +115,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "http-addr", - Value: "0.0.0.0:9190", + Value: "0.0.0.0:9185", Usage: "Address to bind http server", EnvVars: []string{"THUMBNAILS_HTTP_ADDR"}, Destination: &cfg.HTTP.Addr, diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 8740f5a..28b3052 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -1,6 +1,7 @@ package svc import ( + "context" "net/http" "strconv" @@ -24,7 +25,7 @@ func NewService(opts ...Option) Service { m := chi.NewMux() m.Use(options.Middleware...) - svc := Thumbnails{ + svc := Thumbnail{ config: options.Config, mux: m, manager: thumbnails.SimpleManager{ @@ -40,8 +41,8 @@ func NewService(opts ...Option) Service { return svc } -// Thumbnails defines implements the business logic for Service. -type Thumbnails struct { +// Thumbnail implements the business logic for Service. +type Thumbnail struct { config *config.Config mux *chi.Mux manager thumbnails.Manager @@ -49,12 +50,12 @@ type Thumbnails struct { } // ServeHTTP implements the Service interface. -func (g Thumbnails) ServeHTTP(w http.ResponseWriter, r *http.Request) { +func (g Thumbnail) ServeHTTP(w http.ResponseWriter, r *http.Request) { g.mux.ServeHTTP(w, r) } // Thumbnails provides the endpoint to retrieve a thumbnail for an image -func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { +func (g Thumbnail) Thumbnails(w http.ResponseWriter, r *http.Request) { query := r.URL.Query() width, _ := strconv.Atoi(query.Get("width")) height, _ := strconv.Atoi(query.Get("height")) @@ -84,11 +85,9 @@ func (g Thumbnails) Thumbnails(w http.ResponseWriter, r *http.Request) { } auth := r.Header.Get("Authorization") - - sCtx := imgsource.NewContext() - sCtx.Set(imgsource.WebDavAuth, auth) + sCtx := context.WithValue(r.Context(), imgsource.WebDavAuth, auth) // TODO: clean up error handling - img, err := g.source.Get(ctx.ImagePath, sCtx) + img, err := g.source.Get(sCtx, ctx.ImagePath) if err != nil { w.WriteHeader(http.StatusInternalServerError) w.Write([]byte(err.Error())) diff --git a/pkg/thumbnails/imgsource/imgsource.go b/pkg/thumbnails/imgsource/imgsource.go index 6697c9b..030a966 100644 --- a/pkg/thumbnails/imgsource/imgsource.go +++ b/pkg/thumbnails/imgsource/imgsource.go @@ -1,33 +1,11 @@ package imgsource -import "image" +import ( + "context" + "image" +) // Source defines the interface for image sources type Source interface { - Get(path string, ctx SourceContext) (image.Image, error) -} - -// NewContext creates a new SourceContext instance -func NewContext() SourceContext { - return SourceContext{ - m: make(map[string]interface{}), - } -} - -// SourceContext is used to pass source specific parameters -type SourceContext struct { - m map[string]interface{} -} - -// GetString tries to cast the value to a string -func (s SourceContext) GetString(key string) string { - if s, ok := s.m[key].(string); ok { - return s - } - return "" -} - -// Set sets a value -func (s SourceContext) Set(key string, val interface{}) { - s.m[key] = val + Get(ctx context.Context, path string) (image.Image, error) } diff --git a/pkg/thumbnails/imgsource/webdav.go b/pkg/thumbnails/imgsource/webdav.go index a6d8fdb..ecb3832 100644 --- a/pkg/thumbnails/imgsource/webdav.go +++ b/pkg/thumbnails/imgsource/webdav.go @@ -1,6 +1,7 @@ package imgsource import ( + "context" "fmt" "image" "net/http" @@ -28,7 +29,7 @@ const ( ) // Get downloads the file from a webdav service -func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { +func (s WebDav) Get(ctx context.Context, file string) (image.Image, error) { u, _ := url.Parse(s.baseURL) u.Path = path.Join(u.Path, file) req, err := http.NewRequest(http.MethodGet, u.String(), nil) @@ -36,7 +37,10 @@ func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { return nil, fmt.Errorf("could not get the image \"%s\" error: %s", file, err.Error()) } - auth := ctx.GetString(WebDavAuth) + auth, ok := authorization(ctx) + if !ok { + return nil, fmt.Errorf("could not get image \"%s\" error: authorization is missing", file) + } req.Header.Add("Authorization", auth) client := &http.Client{} @@ -55,3 +59,8 @@ func (s WebDav) Get(file string, ctx SourceContext) (image.Image, error) { } return img, nil } + +func authorization(ctx context.Context) (string, bool) { + auth, ok := ctx.Value(WebDavAuth).(string) + return auth, ok +} From 1389cd742ee37a69b2abe836a456bf38dbe62971 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 11 Mar 2020 15:11:12 +0100 Subject: [PATCH 14/21] add proper logging --- pkg/service/v0/service.go | 13 ++++++++++--- pkg/thumbnails/storage/filesystem.go | 15 +++++++++------ pkg/thumbnails/thumbnails.go | 22 +++++++++++++++++----- 3 files changed, 36 insertions(+), 14 deletions(-) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 28b3052..5ae4cb0 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -6,6 +6,7 @@ import ( "strconv" "github.com/go-chi/chi" + "github.com/owncloud/ocis-pkg/v2/log" "github.com/owncloud/ocis-thumbnails/pkg/config" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/imgsource" @@ -28,10 +29,15 @@ func NewService(opts ...Option) Service { svc := Thumbnail{ config: options.Config, mux: m, - manager: thumbnails.SimpleManager{ - Storage: storage.NewFileSystemStorage(options.Config.FileSystemStorage), - }, + manager: thumbnails.NewSimpleManager( + storage.NewFileSystemStorage( + options.Config.FileSystemStorage, + options.Logger, + ), + options.Logger, + ), source: imgsource.NewWebDavSource(options.Config.WebDavSource), + logger: options.Logger, } m.Route(options.Config.HTTP.Root, func(r chi.Router) { @@ -47,6 +53,7 @@ type Thumbnail struct { mux *chi.Mux manager thumbnails.Manager source imgsource.Source + logger log.Logger } // ServeHTTP implements the Service interface. diff --git a/pkg/thumbnails/storage/filesystem.go b/pkg/thumbnails/storage/filesystem.go index e92e91b..e59b771 100644 --- a/pkg/thumbnails/storage/filesystem.go +++ b/pkg/thumbnails/storage/filesystem.go @@ -8,25 +8,29 @@ import ( "path/filepath" "strconv" + "github.com/owncloud/ocis-pkg/v2/log" "github.com/owncloud/ocis-thumbnails/pkg/config" ) // NewFileSystemStorage creates a new instanz of FileSystem -func NewFileSystemStorage(cfg config.FileSystemStorage) FileSystem { +func NewFileSystemStorage(cfg config.FileSystemStorage, logger log.Logger) FileSystem { return FileSystem{ - dir: cfg.RootDirectory, + dir: cfg.RootDirectory, + logger: logger, } } // FileSystem represents a storage for the thumbnails using the local file system. type FileSystem struct { - dir string + dir string + logger log.Logger } // Get loads the image from the file system. func (s FileSystem) Get(key string) []byte { content, err := ioutil.ReadFile(filepath.Join(s.dir, key)) if err != nil { + s.logger.Warn().Err(err).Msgf("could not read file %s", key) return nil } @@ -43,13 +47,12 @@ func (s FileSystem) Set(key string, img []byte) error { f, err := os.Create(path) if err != nil { - fmt.Println(err.Error()) - return err + return fmt.Errorf("could not create file \"%s\" error: %s", key, err.Error()) } defer f.Close() _, err = f.Write(img) if err != nil { - return err + return fmt.Errorf("could not write to file \"%s\" error: %s", key, err.Error()) } return nil } diff --git a/pkg/thumbnails/thumbnails.go b/pkg/thumbnails/thumbnails.go index 7172bac..c13f4c5 100644 --- a/pkg/thumbnails/thumbnails.go +++ b/pkg/thumbnails/thumbnails.go @@ -5,6 +5,7 @@ import ( "image" "github.com/nfnt/resize" + "github.com/owncloud/ocis-pkg/v2/log" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/storage" ) @@ -26,16 +27,24 @@ type Manager interface { GetStored(Context) []byte } +func NewSimpleManager(storage storage.Storage, logger log.Logger) SimpleManager { + return SimpleManager{ + storage: storage, + logger: logger, + } +} + // SimpleManager is a simple implementation of Manager type SimpleManager struct { - Storage storage.Storage + storage storage.Storage + logger log.Logger } // Get implements the Get Method of Manager func (s SimpleManager) Get(ctx Context, img image.Image) ([]byte, error) { thumbnail := s.generate(ctx, img) - key := s.Storage.BuildKey(mapToStorageContext(ctx)) + key := s.storage.BuildKey(mapToStorageContext(ctx)) buf := new(bytes.Buffer) err := ctx.Encoder.Encode(buf, thumbnail) @@ -43,15 +52,18 @@ func (s SimpleManager) Get(ctx Context, img image.Image) ([]byte, error) { return nil, err } bytes := buf.Bytes() - s.Storage.Set(key, bytes) + err = s.storage.Set(key, bytes) + if err != nil { + s.logger.Warn().Err(err).Msg("could not store thumbnail") + } return bytes, nil } // GetStored tries to get the stored thumbnail and return it. // If there is no cached thumbnail it will return nil func (s SimpleManager) GetStored(ctx Context) []byte { - key := s.Storage.BuildKey(mapToStorageContext(ctx)) - stored := s.Storage.Get(key) + key := s.storage.BuildKey(mapToStorageContext(ctx)) + stored := s.storage.Get(key) return stored } From f9d0f7e413afca734ac068861f446c5269243f03 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 11 Mar 2020 15:18:32 +0100 Subject: [PATCH 15/21] add comment --- pkg/thumbnails/thumbnails.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/thumbnails/thumbnails.go b/pkg/thumbnails/thumbnails.go index c13f4c5..7622322 100644 --- a/pkg/thumbnails/thumbnails.go +++ b/pkg/thumbnails/thumbnails.go @@ -27,6 +27,7 @@ type Manager interface { GetStored(Context) []byte } +// NewSimpleManager creates a new instance of SimpleManager func NewSimpleManager(storage storage.Storage, logger log.Logger) SimpleManager { return SimpleManager{ storage: storage, From 016471532a669e42e90c3aed7b13e08397961bf8 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 11 Mar 2020 15:46:52 +0100 Subject: [PATCH 16/21] add changelog --- .../unreleased/{initial-version => initial-version.md} | 0 changelog/unreleased/thumbnail-service.md | 6 ++++++ go.sum | 2 ++ 3 files changed, 8 insertions(+) rename changelog/unreleased/{initial-version => initial-version.md} (100%) create mode 100644 changelog/unreleased/thumbnail-service.md diff --git a/changelog/unreleased/initial-version b/changelog/unreleased/initial-version.md similarity index 100% rename from changelog/unreleased/initial-version rename to changelog/unreleased/initial-version.md diff --git a/changelog/unreleased/thumbnail-service.md b/changelog/unreleased/thumbnail-service.md new file mode 100644 index 0000000..b67eb49 --- /dev/null +++ b/changelog/unreleased/thumbnail-service.md @@ -0,0 +1,6 @@ +Change: implement the first working version + +We implemented the first simple version. +It can load images via webdav and store them locally in the filesystem. + +https://github.com/owncloud/ocis-thumbnails/pull/3 diff --git a/go.sum b/go.sum index 4dc7390..3083637 100644 --- a/go.sum +++ b/go.sum @@ -819,6 +819,7 @@ golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190930215403-16217165b5de h1:5hukYrvBGR8/eNkX5mdUezrA6JiaEZDtJb9Ei+1LlBs= golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f h1:J5lckAjkw6qYlOZNj90mLYNTEKDvWeuc1yieZ8qUzUE= golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= @@ -952,6 +953,7 @@ golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64 golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191216052735-49a3e744a425/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 h1:RIIXAeV6GvDBuADKumTODatUqANFZ+5BPMnzsy4hulY= golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= From f5f68e27dc648d392bcd2352f0448d58a62a3605 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 11 Mar 2020 15:58:40 +0100 Subject: [PATCH 17/21] use os.TempDir() for portable temporary directory --- pkg/flagset/flagset.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 8512b2d..7d97e99 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -1,6 +1,9 @@ package flagset import ( + "os" + "path" + "github.com/micro/cli/v2" "github.com/owncloud/ocis-thumbnails/pkg/config" ) @@ -136,7 +139,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "filesystemstorage-root", - Value: "/tmp/ocis-thumbnails/", + Value: path.Join(os.TempDir(), "ocis-thumbnails/"), Usage: "Root path of the filesystem storage directory", EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"}, Destination: &cfg.FileSystemStorage.RootDirectory, From 78a92cf7223dac61834583c1ec500a359f2d8606 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 11 Mar 2020 16:00:51 +0100 Subject: [PATCH 18/21] use filepath.Join instead of path.Join --- pkg/flagset/flagset.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 7d97e99..04eae47 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -2,7 +2,7 @@ package flagset import ( "os" - "path" + "path/filepath" "github.com/micro/cli/v2" "github.com/owncloud/ocis-thumbnails/pkg/config" @@ -139,7 +139,7 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { }, &cli.StringFlag{ Name: "filesystemstorage-root", - Value: path.Join(os.TempDir(), "ocis-thumbnails/"), + Value: filepath.Join(os.TempDir(), "ocis-thumbnails/"), Usage: "Root path of the filesystem storage directory", EnvVars: []string{"THUMBNAILS_FILESYSTEMSTORAGE_ROOT"}, Destination: &cfg.FileSystemStorage.RootDirectory, From 35141c8e0979679218a23dc5594ec061e54a6cb7 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Fri, 13 Mar 2020 14:37:52 +0100 Subject: [PATCH 19/21] implement grpc service and remove http service --- go.mod | 2 + go.sum | 1 + pkg/command/server.go | 89 +++---------- pkg/config/config.go | 10 +- pkg/flagset/flagset.go | 30 ++--- pkg/proto/v0/thumbnails.pb.go | 195 ++++++++++++++++++++++++++++ pkg/proto/v0/thumbnails.pb.micro.go | 85 ++++++++++++ pkg/proto/v0/thumbnails.proto | 25 ++++ pkg/server/debug/option.go | 50 ------- pkg/server/debug/server.go | 51 -------- pkg/server/{http => grpc}/option.go | 33 +++-- pkg/server/grpc/server.go | 39 ++++++ pkg/server/http/server.go | 56 -------- pkg/service/v0/instrument.go | 18 +-- pkg/service/v0/logging.go | 18 +-- pkg/service/v0/service.go | 88 ++++--------- pkg/service/v0/tracing.go | 19 ++- 17 files changed, 451 insertions(+), 358 deletions(-) create mode 100644 pkg/proto/v0/thumbnails.pb.go create mode 100644 pkg/proto/v0/thumbnails.pb.micro.go create mode 100644 pkg/proto/v0/thumbnails.proto delete mode 100644 pkg/server/debug/option.go delete mode 100644 pkg/server/debug/server.go rename pkg/server/{http => grpc}/option.go (80%) create mode 100644 pkg/server/grpc/server.go delete mode 100644 pkg/server/http/server.go diff --git a/go.mod b/go.mod index 3972a7d..1a9250e 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,10 @@ require ( github.com/UnnoTed/fileb0x v1.1.4 // indirect github.com/cespare/reflex v0.2.0 // indirect github.com/go-chi/chi v4.0.2+incompatible + github.com/golang/protobuf v1.3.2 github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/micro/cli/v2 v2.1.1 + github.com/micro/go-micro/v2 v2.0.0 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/ogier/pflag v0.0.1 // indirect github.com/oklog/run v1.0.0 diff --git a/go.sum b/go.sum index 3083637..c44798d 100644 --- a/go.sum +++ b/go.sum @@ -487,6 +487,7 @@ github.com/micro/go-micro v1.18.0/go.mod h1:klwUJL1gkdY1MHFyz+fFJXn52dKcty4hoe95 github.com/micro/go-micro/v2 v2.0.0 h1:bMx549RwJ9Yuiui8cDVlfYhVNP8I8KBJTMyLthEXpRw= github.com/micro/go-micro/v2 v2.0.0/go.mod h1:v7QP5UhKRt37ixjJe8DouWmg0/eE6dltr5h0idJ9BpE= github.com/micro/go-plugins v1.5.1/go.mod h1:jcxejzJCAMH731cQHbS/hncyKe0rxAbzKkibj8glad4= +github.com/micro/go-plugins/wrapper/trace/opencensus/v2 v2.0.1 h1:7IkXfl94MdLZQwk0lNmu9Cg5WP42Zak9EtQMeN4SvVs= github.com/micro/go-plugins/wrapper/trace/opencensus/v2 v2.0.1/go.mod h1:QrkcwcDtIs2hIJpIEhozekyf6Rfz5C36kFI8+zzCpX0= github.com/micro/mdns v0.3.0 h1:bYycYe+98AXR3s8Nq5qvt6C573uFTDPIYzJemWON0QE= github.com/micro/mdns v0.3.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc= diff --git a/pkg/command/server.go b/pkg/command/server.go index 31f8dce..af6cafe 100644 --- a/pkg/command/server.go +++ b/pkg/command/server.go @@ -2,9 +2,9 @@ package command import ( "context" + "fmt" "os" "os/signal" - "strings" "time" "contrib.go.opencensus.io/exporter/jaeger" @@ -17,8 +17,7 @@ import ( "github.com/owncloud/ocis-thumbnails/pkg/config" "github.com/owncloud/ocis-thumbnails/pkg/flagset" "github.com/owncloud/ocis-thumbnails/pkg/metrics" - "github.com/owncloud/ocis-thumbnails/pkg/server/debug" - "github.com/owncloud/ocis-thumbnails/pkg/server/http" + "github.com/owncloud/ocis-thumbnails/pkg/server/grpc" "go.opencensus.io/stats/view" "go.opencensus.io/trace" ) @@ -30,10 +29,6 @@ func Server(cfg *config.Config) *cli.Command { Usage: "Start integrated server", Flags: flagset.ServerWithConfig(cfg), Before: func(c *cli.Context) error { - if cfg.HTTP.Root != "/" { - cfg.HTTP.Root = strings.TrimSuffix(cfg.HTTP.Root, "/") - } - return nil }, Action: func(c *cli.Context) error { @@ -131,72 +126,22 @@ func Server(cfg *config.Config) *cli.Command { defer cancel() - { - server, err := http.Server( - http.Logger(logger), - http.Context(ctx), - http.Config(cfg), - http.Metrics(metrics), - http.Flags(flagset.RootWithConfig(cfg)), - http.Flags(flagset.ServerWithConfig(cfg)), - ) - - if err != nil { - logger.Info(). - Err(err). - Str("transport", "http"). - Msg("Failed to initialize server") - - return err - } - - gr.Add(func() error { - return server.Run() - }, func(_ error) { - logger.Info(). - Str("transport", "http"). - Msg("Shutting down server") - - cancel() - }) - } - - { - server, err := debug.Server( - debug.Logger(logger), - debug.Context(ctx), - debug.Config(cfg), - ) - - if err != nil { - logger.Info(). - Err(err). - Str("transport", "debug"). - Msg("Failed to initialize server") - - return err - } - - gr.Add(func() error { - return server.ListenAndServe() - }, func(_ error) { - ctx, timeout := context.WithTimeout(ctx, 5*time.Second) - - defer timeout() - defer cancel() + service := grpc.NewService( + grpc.Logger(logger), + grpc.Context(ctx), + grpc.Config(cfg), + grpc.Name(cfg.Server.Name), + grpc.Namespace(cfg.Server.Namespace), + grpc.Address(cfg.Server.Address), + grpc.Metrics(metrics), + ) - if err := server.Shutdown(ctx); err != nil { - logger.Info(). - Err(err). - Str("transport", "debug"). - Msg("Failed to shutdown server") - } else { - logger.Info(). - Str("transport", "debug"). - Msg("Shutting down server") - } - }) - } + gr.Add(func() error { + return service.Run() + }, func(_ error) { + fmt.Println("shutting down grpc server") + cancel() + }) { stop := make(chan os.Signal, 1) diff --git a/pkg/config/config.go b/pkg/config/config.go index a5bc260..e84b514 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -15,11 +15,11 @@ type Debug struct { Zpages bool } -// HTTP defines the available http configuration. -type HTTP struct { - Addr string +// Server defines the available server configuration. +type Server struct { + Name string Namespace string - Root string + Address string } // Tracing defines the available tracing configuration. @@ -36,7 +36,7 @@ type Config struct { File string Log Log Debug Debug - HTTP HTTP + Server Server Tracing Tracing FileSystemStorage FileSystemStorage WebDavSource WebDavSource diff --git a/pkg/flagset/flagset.go b/pkg/flagset/flagset.go index 04eae47..2f34817 100644 --- a/pkg/flagset/flagset.go +++ b/pkg/flagset/flagset.go @@ -117,25 +117,25 @@ func ServerWithConfig(cfg *config.Config) []cli.Flag { Destination: &cfg.Debug.Zpages, }, &cli.StringFlag{ - Name: "http-addr", - Value: "0.0.0.0:9185", - Usage: "Address to bind http server", - EnvVars: []string{"THUMBNAILS_HTTP_ADDR"}, - Destination: &cfg.HTTP.Addr, + Name: "grpc-name", + Value: "thumbnails", + Usage: "Name of the service", + EnvVars: []string{"THUMBNAILS_GRPC_NAME"}, + Destination: &cfg.Server.Name, }, &cli.StringFlag{ - Name: "http-namespace", - Value: "com.owncloud.web", - Usage: "Set the base namespace for the http namespace", - EnvVars: []string{"THUMBNAILS_HTTP_NAMESPACE"}, - Destination: &cfg.HTTP.Namespace, + Name: "grpc-addr", + Value: "0.0.0.0:9185", + Usage: "Address to bind grpc server", + EnvVars: []string{"THUMBNAILS_GRPC_ADDR"}, + Destination: &cfg.Server.Address, }, &cli.StringFlag{ - Name: "http-root", - Value: "/", - Usage: "Root path of http server", - EnvVars: []string{"THUMBNAILS_HTTP_ROOT"}, - Destination: &cfg.HTTP.Root, + Name: "grpc-namespace", + Value: "com.owncloud.api", + Usage: "Set the base namespace for the grpc namespace", + EnvVars: []string{"THUMBNAILS_GRPC_NAMESPACE"}, + Destination: &cfg.Server.Namespace, }, &cli.StringFlag{ Name: "filesystemstorage-root", diff --git a/pkg/proto/v0/thumbnails.pb.go b/pkg/proto/v0/thumbnails.pb.go new file mode 100644 index 0000000..8fb6ad6 --- /dev/null +++ b/pkg/proto/v0/thumbnails.pb.go @@ -0,0 +1,195 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// source: pkg/proto/v0/thumbnails.proto + +package proto + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +type GetRequest_FileType int32 + +const ( + GetRequest_PNG GetRequest_FileType = 0 + GetRequest_JPG GetRequest_FileType = 1 +) + +var GetRequest_FileType_name = map[int32]string{ + 0: "PNG", + 1: "JPG", +} + +var GetRequest_FileType_value = map[string]int32{ + "PNG": 0, + "JPG": 1, +} + +func (x GetRequest_FileType) String() string { + return proto.EnumName(GetRequest_FileType_name, int32(x)) +} + +func (GetRequest_FileType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_e354cb4f8a62b6c2, []int{0, 0} +} + +type GetRequest struct { + Filepath string `protobuf:"bytes,1,opt,name=filepath,proto3" json:"filepath,omitempty"` + Filetype GetRequest_FileType `protobuf:"varint,2,opt,name=filetype,proto3,enum=com.owncloud.ocis.thumbnails.v0.GetRequest_FileType" json:"filetype,omitempty"` + Etag string `protobuf:"bytes,3,opt,name=etag,proto3" json:"etag,omitempty"` + Width int32 `protobuf:"varint,4,opt,name=width,proto3" json:"width,omitempty"` + Height int32 `protobuf:"varint,5,opt,name=height,proto3" json:"height,omitempty"` + Authorization string `protobuf:"bytes,6,opt,name=authorization,proto3" json:"authorization,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetRequest) Reset() { *m = GetRequest{} } +func (m *GetRequest) String() string { return proto.CompactTextString(m) } +func (*GetRequest) ProtoMessage() {} +func (*GetRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e354cb4f8a62b6c2, []int{0} +} + +func (m *GetRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetRequest.Unmarshal(m, b) +} +func (m *GetRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetRequest.Marshal(b, m, deterministic) +} +func (m *GetRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetRequest.Merge(m, src) +} +func (m *GetRequest) XXX_Size() int { + return xxx_messageInfo_GetRequest.Size(m) +} +func (m *GetRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetRequest proto.InternalMessageInfo + +func (m *GetRequest) GetFilepath() string { + if m != nil { + return m.Filepath + } + return "" +} + +func (m *GetRequest) GetFiletype() GetRequest_FileType { + if m != nil { + return m.Filetype + } + return GetRequest_PNG +} + +func (m *GetRequest) GetEtag() string { + if m != nil { + return m.Etag + } + return "" +} + +func (m *GetRequest) GetWidth() int32 { + if m != nil { + return m.Width + } + return 0 +} + +func (m *GetRequest) GetHeight() int32 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *GetRequest) GetAuthorization() string { + if m != nil { + return m.Authorization + } + return "" +} + +type GetResponse struct { + Thumbnail []byte `protobuf:"bytes,1,opt,name=thumbnail,proto3" json:"thumbnail,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetResponse) Reset() { *m = GetResponse{} } +func (m *GetResponse) String() string { return proto.CompactTextString(m) } +func (*GetResponse) ProtoMessage() {} +func (*GetResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_e354cb4f8a62b6c2, []int{1} +} + +func (m *GetResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetResponse.Unmarshal(m, b) +} +func (m *GetResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetResponse.Marshal(b, m, deterministic) +} +func (m *GetResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetResponse.Merge(m, src) +} +func (m *GetResponse) XXX_Size() int { + return xxx_messageInfo_GetResponse.Size(m) +} +func (m *GetResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetResponse proto.InternalMessageInfo + +func (m *GetResponse) GetThumbnail() []byte { + if m != nil { + return m.Thumbnail + } + return nil +} + +func init() { + proto.RegisterEnum("com.owncloud.ocis.thumbnails.v0.GetRequest_FileType", GetRequest_FileType_name, GetRequest_FileType_value) + proto.RegisterType((*GetRequest)(nil), "com.owncloud.ocis.thumbnails.v0.GetRequest") + proto.RegisterType((*GetResponse)(nil), "com.owncloud.ocis.thumbnails.v0.GetResponse") +} + +func init() { proto.RegisterFile("pkg/proto/v0/thumbnails.proto", fileDescriptor_e354cb4f8a62b6c2) } + +var fileDescriptor_e354cb4f8a62b6c2 = []byte{ + // 300 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x4f, 0x4f, 0xc2, 0x40, + 0x10, 0xc5, 0x2d, 0x50, 0xfe, 0x8c, 0x68, 0xc8, 0xc4, 0x98, 0x86, 0x60, 0x24, 0xc4, 0x03, 0x09, + 0x66, 0x21, 0xe8, 0x27, 0xf0, 0x60, 0x13, 0x0f, 0x86, 0x54, 0x4e, 0xde, 0x4a, 0x19, 0xd9, 0x8d, + 0xa5, 0xbb, 0xd2, 0x29, 0x04, 0x13, 0x13, 0x3f, 0xba, 0x71, 0x2b, 0x45, 0x4f, 0xea, 0x69, 0xe7, + 0xfd, 0x76, 0xf2, 0x66, 0xf6, 0x2d, 0x9c, 0x99, 0xe7, 0xc5, 0xd0, 0xac, 0x34, 0xeb, 0xe1, 0x7a, + 0x34, 0x64, 0x99, 0x2d, 0x67, 0x49, 0xa8, 0xe2, 0x54, 0x58, 0x86, 0xe7, 0x91, 0x5e, 0x0a, 0xbd, + 0x49, 0xa2, 0x58, 0x67, 0x73, 0xa1, 0x23, 0x95, 0x8a, 0x6f, 0x3d, 0xeb, 0x51, 0xef, 0xbd, 0x04, + 0xe0, 0x13, 0x07, 0xf4, 0x92, 0x51, 0xca, 0xd8, 0x86, 0xfa, 0x93, 0x8a, 0xc9, 0x84, 0x2c, 0x3d, + 0xa7, 0xeb, 0xf4, 0x1b, 0x41, 0xa1, 0x71, 0x92, 0xdf, 0xf1, 0xd6, 0x90, 0x57, 0xea, 0x3a, 0xfd, + 0xe3, 0xf1, 0xb5, 0xf8, 0xc5, 0x5e, 0xec, 0xad, 0xc5, 0xad, 0x8a, 0x69, 0xba, 0x35, 0x14, 0x14, + 0x2e, 0x88, 0x50, 0x21, 0x0e, 0x17, 0x5e, 0xd9, 0x4e, 0xb2, 0x35, 0x9e, 0x80, 0xbb, 0x51, 0x73, + 0x96, 0x5e, 0xa5, 0xeb, 0xf4, 0xdd, 0x20, 0x17, 0x78, 0x0a, 0x55, 0x49, 0x6a, 0x21, 0xd9, 0x73, + 0x2d, 0xfe, 0x52, 0x78, 0x01, 0x47, 0x61, 0xc6, 0x52, 0xaf, 0xd4, 0x6b, 0xc8, 0x4a, 0x27, 0x5e, + 0xd5, 0x5a, 0xfd, 0x84, 0xbd, 0x0e, 0xd4, 0x77, 0xd3, 0xb1, 0x06, 0xe5, 0xc9, 0xbd, 0xdf, 0x3a, + 0xf8, 0x2c, 0xee, 0x26, 0x7e, 0xcb, 0xe9, 0x0d, 0xe0, 0xd0, 0xae, 0x99, 0x1a, 0x9d, 0xa4, 0x84, + 0x1d, 0x68, 0x14, 0x6f, 0xb0, 0x19, 0x34, 0x83, 0x3d, 0x18, 0xbf, 0x41, 0x6b, 0xba, 0x13, 0x0f, + 0xb4, 0x5a, 0xab, 0x88, 0x50, 0x41, 0xd3, 0x27, 0x2e, 0x30, 0x0e, 0xfe, 0x11, 0x4b, 0xfb, 0xf2, + 0x6f, 0xcd, 0xf9, 0x72, 0x37, 0xb5, 0x47, 0xd7, 0x7e, 0xec, 0xac, 0x6a, 0x8f, 0xab, 0x8f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x54, 0x8e, 0xdc, 0xb1, 0x00, 0x02, 0x00, 0x00, +} diff --git a/pkg/proto/v0/thumbnails.pb.micro.go b/pkg/proto/v0/thumbnails.pb.micro.go new file mode 100644 index 0000000..9533ba8 --- /dev/null +++ b/pkg/proto/v0/thumbnails.pb.micro.go @@ -0,0 +1,85 @@ +// Code generated by protoc-gen-micro. DO NOT EDIT. +// source: pkg/proto/v0/thumbnails.proto + +package proto + +import ( + fmt "fmt" + proto "github.com/golang/protobuf/proto" + math "math" +) + +import ( + context "context" + client "github.com/micro/go-micro/v2/client" + server "github.com/micro/go-micro/v2/server" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ client.Option +var _ server.Option + +// Client API for ThumbnailService service + +type ThumbnailService interface { + GetThumbnail(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) +} + +type thumbnailService struct { + c client.Client + name string +} + +func NewThumbnailService(name string, c client.Client) ThumbnailService { + return &thumbnailService{ + c: c, + name: name, + } +} + +func (c *thumbnailService) GetThumbnail(ctx context.Context, in *GetRequest, opts ...client.CallOption) (*GetResponse, error) { + req := c.c.NewRequest(c.name, "ThumbnailService.GetThumbnail", in) + out := new(GetResponse) + err := c.c.Call(ctx, req, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for ThumbnailService service + +type ThumbnailServiceHandler interface { + GetThumbnail(context.Context, *GetRequest, *GetResponse) error +} + +func RegisterThumbnailServiceHandler(s server.Server, hdlr ThumbnailServiceHandler, opts ...server.HandlerOption) error { + type thumbnailService interface { + GetThumbnail(ctx context.Context, in *GetRequest, out *GetResponse) error + } + type ThumbnailService struct { + thumbnailService + } + h := &thumbnailServiceHandler{hdlr} + return s.Handle(s.NewHandler(&ThumbnailService{h}, opts...)) +} + +type thumbnailServiceHandler struct { + ThumbnailServiceHandler +} + +func (h *thumbnailServiceHandler) GetThumbnail(ctx context.Context, in *GetRequest, out *GetResponse) error { + return h.ThumbnailServiceHandler.GetThumbnail(ctx, in, out) +} diff --git a/pkg/proto/v0/thumbnails.proto b/pkg/proto/v0/thumbnails.proto new file mode 100644 index 0000000..94f2529 --- /dev/null +++ b/pkg/proto/v0/thumbnails.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; + +package com.owncloud.ocis.thumbnails.v0; +option go_package = "proto"; + +service ThumbnailService { + rpc GetThumbnail(GetRequest) returns (GetResponse); +} + +message GetRequest { + string filepath = 1; + enum FileType { + PNG = 0; + JPG = 1; + } + FileType filetype = 2; + string etag = 3; + int32 width = 4; + int32 height = 5; + string authorization = 6; +} + +message GetResponse { + bytes thumbnail = 1; +} \ No newline at end of file diff --git a/pkg/server/debug/option.go b/pkg/server/debug/option.go deleted file mode 100644 index b07f8b6..0000000 --- a/pkg/server/debug/option.go +++ /dev/null @@ -1,50 +0,0 @@ -package debug - -import ( - "context" - - "github.com/owncloud/ocis-thumbnails/pkg/config" - "github.com/owncloud/ocis-pkg/v2/log" -) - -// Option defines a single option function. -type Option func(o *Options) - -// Options defines the available options for this package. -type Options struct { - Logger log.Logger - Context context.Context - Config *config.Config -} - -// newOptions initializes the available default options. -func newOptions(opts ...Option) Options { - opt := Options{} - - for _, o := range opts { - o(&opt) - } - - return opt -} - -// Logger provides a function to set the logger option. -func Logger(val log.Logger) Option { - return func(o *Options) { - o.Logger = val - } -} - -// Context provides a function to set the context option. -func Context(val context.Context) Option { - return func(o *Options) { - o.Context = val - } -} - -// Config provides a function to set the config option. -func Config(val *config.Config) Option { - return func(o *Options) { - o.Config = val - } -} diff --git a/pkg/server/debug/server.go b/pkg/server/debug/server.go deleted file mode 100644 index 0ac9f25..0000000 --- a/pkg/server/debug/server.go +++ /dev/null @@ -1,51 +0,0 @@ -package debug - -import ( - "io" - "net/http" - - "github.com/owncloud/ocis-thumbnails/pkg/config" - "github.com/owncloud/ocis-thumbnails/pkg/version" - "github.com/owncloud/ocis-pkg/v2/service/debug" -) - -// Server initializes the debug service and server. -func Server(opts ...Option) (*http.Server, error) { - options := newOptions(opts...) - - return debug.NewService( - debug.Logger(options.Logger), - debug.Name("ocis-thumbnails"), - debug.Version(version.String), - debug.Address(options.Config.Debug.Addr), - debug.Token(options.Config.Debug.Token), - debug.Pprof(options.Config.Debug.Pprof), - debug.Zpages(options.Config.Debug.Zpages), - debug.Health(health(options.Config)), - debug.Ready(ready(options.Config)), - ), nil -} - -// health implements the health check. -func health(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO(tboerger): check if services are up and running - - io.WriteString(w, http.StatusText(http.StatusOK)) - } -} - -// ready implements the ready check. -func ready(cfg *config.Config) func(http.ResponseWriter, *http.Request) { - return func(w http.ResponseWriter, r *http.Request) { - w.Header().Set("Content-Type", "text/plain") - w.WriteHeader(http.StatusOK) - - // TODO(tboerger): check if services are up and running - - io.WriteString(w, http.StatusText(http.StatusOK)) - } -} diff --git a/pkg/server/http/option.go b/pkg/server/grpc/option.go similarity index 80% rename from pkg/server/http/option.go rename to pkg/server/grpc/option.go index 5712bc5..569480f 100644 --- a/pkg/server/http/option.go +++ b/pkg/server/grpc/option.go @@ -1,12 +1,11 @@ -package http +package grpc import ( "context" - "github.com/micro/cli/v2" + "github.com/owncloud/ocis-pkg/v2/log" "github.com/owncloud/ocis-thumbnails/pkg/config" "github.com/owncloud/ocis-thumbnails/pkg/metrics" - "github.com/owncloud/ocis-pkg/v2/log" ) // Option defines a single option function. @@ -14,12 +13,13 @@ type Option func(o *Options) // Options defines the available options for this package. type Options struct { - Namespace string + Name string + Address string Logger log.Logger Context context.Context Config *config.Config Metrics *metrics.Metrics - Flags []cli.Flag + Namespace string } // newOptions initializes the available default options. @@ -40,6 +40,20 @@ func Logger(val log.Logger) Option { } } +// Name provides a name for the service. +func Name(val string) Option { + return func(o *Options) { + o.Name = val + } +} + +// Address provides an address for the service. +func Address(val string) Option { + return func(o *Options) { + o.Address = val + } +} + // Context provides a function to set the context option. func Context(val context.Context) Option { return func(o *Options) { @@ -61,14 +75,7 @@ func Metrics(val *metrics.Metrics) Option { } } -// Flags provides a function to set the flags option. -func Flags(val []cli.Flag) Option { - return func(o *Options) { - o.Flags = append(o.Flags, val...) - } -} - -// Namespace provides a function to set the Namespace option. +// Namespace provides a function to set the namespace option. func Namespace(val string) Option { return func(o *Options) { o.Namespace = val diff --git a/pkg/server/grpc/server.go b/pkg/server/grpc/server.go new file mode 100644 index 0000000..96c64e1 --- /dev/null +++ b/pkg/server/grpc/server.go @@ -0,0 +1,39 @@ +package grpc + +import ( + "github.com/owncloud/ocis-pkg/v2/service/grpc" + "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" + svc "github.com/owncloud/ocis-thumbnails/pkg/service/v0" + "github.com/owncloud/ocis-thumbnails/pkg/version" +) + +// NewService initializes the grpc service and server. +func NewService(opts ...Option) grpc.Service { + options := newOptions(opts...) + + service := grpc.NewService( + grpc.Logger(options.Logger), + grpc.Namespace(options.Namespace), + grpc.Name(options.Name), + grpc.Version(version.String), + grpc.Address(options.Address), + grpc.Context(options.Context), + ) + + var thumbnail proto.ThumbnailServiceHandler + { + thumbnail = svc.NewService( + svc.Config(options.Config), + ) + thumbnail = svc.NewInstrument(thumbnail, options.Metrics) + thumbnail = svc.NewLogging(thumbnail, options.Logger) + } + + proto.RegisterThumbnailServiceHandler( + service.Server(), + thumbnail, + ) + + service.Init() + return service +} diff --git a/pkg/server/http/server.go b/pkg/server/http/server.go deleted file mode 100644 index 66607a2..0000000 --- a/pkg/server/http/server.go +++ /dev/null @@ -1,56 +0,0 @@ -package http - -import ( - svc "github.com/owncloud/ocis-thumbnails/pkg/service/v0" - "github.com/owncloud/ocis-thumbnails/pkg/version" - "github.com/owncloud/ocis-pkg/v2/middleware" - "github.com/owncloud/ocis-pkg/v2/service/http" -) - -// Server initializes the http service and server. -func Server(opts ...Option) (http.Service, error) { - options := newOptions(opts...) - - service := http.NewService( - http.Logger(options.Logger), - http.Name("thumbnails"), - http.Version(version.String), - http.Namespace(options.Config.HTTP.Namespace), - http.Address(options.Config.HTTP.Addr), - http.Context(options.Context), - http.Flags(options.Flags...), - ) - - handle := svc.NewService( - svc.Logger(options.Logger), - svc.Config(options.Config), - svc.Middleware( - middleware.RealIP, - middleware.RequestID, - middleware.Cache, - middleware.Cors, - middleware.Secure, - middleware.Version( - "thumbnails", - version.String, - ), - middleware.Logger( - options.Logger, - ), - ), - ) - - { - handle = svc.NewInstrument(handle, options.Metrics) - handle = svc.NewLogging(handle, options.Logger) - handle = svc.NewTracing(handle) - } - - service.Handle( - "/", - handle, - ) - - service.Init() - return service, nil -} diff --git a/pkg/service/v0/instrument.go b/pkg/service/v0/instrument.go index 9c3a6d9..86ab4e6 100644 --- a/pkg/service/v0/instrument.go +++ b/pkg/service/v0/instrument.go @@ -1,13 +1,14 @@ package svc import ( - "net/http" + "context" "github.com/owncloud/ocis-thumbnails/pkg/metrics" + v0proto "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" ) // NewInstrument returns a service that instruments metrics. -func NewInstrument(next Service, metrics *metrics.Metrics) Service { +func NewInstrument(next v0proto.ThumbnailServiceHandler, metrics *metrics.Metrics) v0proto.ThumbnailServiceHandler { return instrument{ next: next, metrics: metrics, @@ -15,16 +16,11 @@ func NewInstrument(next Service, metrics *metrics.Metrics) Service { } type instrument struct { - next Service + next v0proto.ThumbnailServiceHandler metrics *metrics.Metrics } -// ServeHTTP implements the Service interface. -func (i instrument) ServeHTTP(w http.ResponseWriter, r *http.Request) { - i.next.ServeHTTP(w, r) -} - -// Dummy implements the Service interface. -func (i instrument) Thumbnails(w http.ResponseWriter, r *http.Request) { - i.next.Thumbnails(w, r) +// GetThumbnail implements the ThumbnailServiceHandler interface. +func (i instrument) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error { + return i.next.GetThumbnail(ctx, req, rsp) } diff --git a/pkg/service/v0/logging.go b/pkg/service/v0/logging.go index a439f1e..90f2916 100644 --- a/pkg/service/v0/logging.go +++ b/pkg/service/v0/logging.go @@ -1,13 +1,14 @@ package svc import ( - "net/http" + "context" "github.com/owncloud/ocis-pkg/v2/log" + v0proto "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" ) // NewLogging returns a service that logs messages. -func NewLogging(next Service, logger log.Logger) Service { +func NewLogging(next v0proto.ThumbnailServiceHandler, logger log.Logger) v0proto.ThumbnailServiceHandler { return logging{ next: next, logger: logger, @@ -15,16 +16,11 @@ func NewLogging(next Service, logger log.Logger) Service { } type logging struct { - next Service + next v0proto.ThumbnailServiceHandler logger log.Logger } -// ServeHTTP implements the Service interface. -func (l logging) ServeHTTP(w http.ResponseWriter, r *http.Request) { - l.next.ServeHTTP(w, r) -} - -// Dummy implements the Service interface. -func (l logging) Thumbnails(w http.ResponseWriter, r *http.Request) { - l.next.Thumbnails(w, r) +// GetThumbnail implements the ThumbnailServiceHandler interface. +func (l logging) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error { + return l.next.GetThumbnail(ctx, req, rsp) } diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 5ae4cb0..b9a6700 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -2,33 +2,20 @@ package svc import ( "context" - "net/http" - "strconv" + "fmt" - "github.com/go-chi/chi" "github.com/owncloud/ocis-pkg/v2/log" - "github.com/owncloud/ocis-thumbnails/pkg/config" + v0proto "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/imgsource" "github.com/owncloud/ocis-thumbnails/pkg/thumbnails/storage" ) -// Service defines the extension handlers. -type Service interface { - ServeHTTP(http.ResponseWriter, *http.Request) - Thumbnails(http.ResponseWriter, *http.Request) -} - // NewService returns a service implementation for Service. -func NewService(opts ...Option) Service { +func NewService(opts ...Option) v0proto.ThumbnailServiceHandler { options := newOptions(opts...) - m := chi.NewMux() - m.Use(options.Middleware...) - svc := Thumbnail{ - config: options.Config, - mux: m, manager: thumbnails.NewSimpleManager( storage.NewFileSystemStorage( options.Config.FileSystemStorage, @@ -40,77 +27,52 @@ func NewService(opts ...Option) Service { logger: options.Logger, } - m.Route(options.Config.HTTP.Root, func(r chi.Router) { - r.Get("/thumbnails", svc.Thumbnails) - }) - return svc } -// Thumbnail implements the business logic for Service. +// Thumbnail implements the GRPC handler. type Thumbnail struct { - config *config.Config - mux *chi.Mux manager thumbnails.Manager source imgsource.Source logger log.Logger } -// ServeHTTP implements the Service interface. -func (g Thumbnail) ServeHTTP(w http.ResponseWriter, r *http.Request) { - g.mux.ServeHTTP(w, r) -} - -// Thumbnails provides the endpoint to retrieve a thumbnail for an image -func (g Thumbnail) Thumbnails(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - width, _ := strconv.Atoi(query.Get("width")) - height, _ := strconv.Atoi(query.Get("height")) - fileType := query.Get("type") - filePath := query.Get("file_path") - etag := query.Get("etag") - - encoder := thumbnails.EncoderForType(fileType) +// GetThumbnail retrieves a thumbnail for an image +func (g Thumbnail) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error { + encoder := thumbnails.EncoderForType(req.Filetype.String()) if encoder == nil { // TODO: better error responses - w.WriteHeader(http.StatusBadRequest) - w.Write([]byte("can't encode that")) - return + return fmt.Errorf("can't be encoded. filetype %s not supported", req.Filetype.String()) } - ctx := thumbnails.Context{ - Width: width, - Height: height, - ImagePath: filePath, + tCtx := thumbnails.Context{ + Width: int(req.Width), + Height: int(req.Height), + ImagePath: req.Filepath, Encoder: encoder, - ETag: etag, + ETag: req.Etag, } - thumbnail := g.manager.GetStored(ctx) + thumbnail := g.manager.GetStored(tCtx) if thumbnail != nil { - w.Write(thumbnail) - return + rsp.Thumbnail = thumbnail + return nil } - auth := r.Header.Get("Authorization") - sCtx := context.WithValue(r.Context(), imgsource.WebDavAuth, auth) + auth := req.Authorization + sCtx := context.WithValue(ctx, imgsource.WebDavAuth, auth) // TODO: clean up error handling - img, err := g.source.Get(sCtx, ctx.ImagePath) + img, err := g.source.Get(sCtx, tCtx.ImagePath) if err != nil { - w.WriteHeader(http.StatusInternalServerError) - w.Write([]byte(err.Error())) - return + return err } if img == nil { - w.WriteHeader(http.StatusInternalServerError) - w.Write([]byte("img is nil")) - return + return fmt.Errorf("could not retrieve image") } - thumbnail, err = g.manager.Get(ctx, img) + thumbnail, err = g.manager.Get(tCtx, img) if err != nil { - w.Write([]byte(err.Error())) - return + return err } - w.WriteHeader(http.StatusCreated) - w.Write(thumbnail) + rsp.Thumbnail = thumbnail + return nil } diff --git a/pkg/service/v0/tracing.go b/pkg/service/v0/tracing.go index 444afd3..33d4f01 100644 --- a/pkg/service/v0/tracing.go +++ b/pkg/service/v0/tracing.go @@ -1,26 +1,23 @@ package svc import ( - "net/http" + "context" + + v0proto "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" ) // NewTracing returns a service that instruments traces. -func NewTracing(next Service) Service { +func NewTracing(next v0proto.ThumbnailServiceHandler) v0proto.ThumbnailServiceHandler { return tracing{ next: next, } } type tracing struct { - next Service -} - -// ServeHTTP implements the Service interface. -func (t tracing) ServeHTTP(w http.ResponseWriter, r *http.Request) { - t.next.ServeHTTP(w, r) + next v0proto.ThumbnailServiceHandler } -// Dummy implements the Service interface. -func (t tracing) Thumbnails(w http.ResponseWriter, r *http.Request) { - t.next.Thumbnails(w, r) +// GetThumbnail implements the ThumbnailServiceHandler interface. +func (t tracing) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error { + return t.next.GetThumbnail(ctx, req, rsp) } From 06151de3f467d731cf3eb8d6aee533e5f374ec36 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Mon, 16 Mar 2020 16:55:10 +0100 Subject: [PATCH 20/21] implement metrics, logging and tracing --- go.mod | 12 +- go.sum | 296 +++-------------------------------- pkg/metrics/metrics.go | 44 ++++-- pkg/service/v0/instrument.go | 15 +- pkg/service/v0/logging.go | 19 ++- pkg/service/v0/tracing.go | 12 ++ tools.go | 3 + 7 files changed, 110 insertions(+), 291 deletions(-) diff --git a/go.mod b/go.mod index 1a9250e..3c986aa 100644 --- a/go.mod +++ b/go.mod @@ -6,19 +6,19 @@ require ( contrib.go.opencensus.io/exporter/jaeger v0.2.0 contrib.go.opencensus.io/exporter/ocagent v0.6.0 contrib.go.opencensus.io/exporter/zipkin v0.1.1 - github.com/UnnoTed/fileb0x v1.1.4 // indirect - github.com/cespare/reflex v0.2.0 // indirect - github.com/go-chi/chi v4.0.2+incompatible + github.com/UnnoTed/fileb0x v1.1.4 + github.com/cespare/reflex v0.2.0 github.com/golang/protobuf v1.3.2 - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect + github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 github.com/micro/cli/v2 v2.1.1 github.com/micro/go-micro/v2 v2.0.0 github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 - github.com/ogier/pflag v0.0.1 // indirect + github.com/ogier/pflag v0.0.1 github.com/oklog/run v1.0.0 github.com/openzipkin/zipkin-go v0.2.2 github.com/owncloud/ocis-pkg/v2 v2.0.1 - github.com/restic/calens v0.2.0 // indirect + github.com/prometheus/client_golang v1.2.1 + github.com/restic/calens v0.2.0 github.com/spf13/viper v1.5.0 go.opencensus.io v0.22.2 ) diff --git a/go.sum b/go.sum index c44798d..bec1dd4 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,6 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= -cloud.google.com/go v0.39.0/go.mod h1:rVLT6fkc8chs9sfPtFc1SBH6em7n+ZoXaG+87tDISts= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= @@ -11,29 +10,16 @@ cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbf cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= -contrib.go.opencensus.io/exporter/aws v0.0.0-20181029163544-2befc13012d0/go.mod h1:uu1P0UCM/6RbsMrgPa98ll8ZcHM858i/AD06a9aLRCA= contrib.go.opencensus.io/exporter/jaeger v0.2.0 h1:nhTv/Ry3lGmqbJ/JGvCjWxBl5ozRfqo86Ngz59UAlfk= contrib.go.opencensus.io/exporter/jaeger v0.2.0/go.mod h1:ukdzwIYYHgZ7QYtwVFQUjiT28BJHiMhTERo32s6qVgM= contrib.go.opencensus.io/exporter/ocagent v0.4.12/go.mod h1:450APlNTSR6FrvC3CTRqYosuDstRB9un7SOx2k/9ckA= -contrib.go.opencensus.io/exporter/ocagent v0.5.0/go.mod h1:ImxhfLRpxoYiSq891pBrLVhN+qmP8BTVvdH2YLs7Gl0= contrib.go.opencensus.io/exporter/ocagent v0.6.0 h1:Z1n6UAyr0QwM284yUuh5Zd8JlvxUGAhFZcgMJkMPrGM= contrib.go.opencensus.io/exporter/ocagent v0.6.0/go.mod h1:zmKjrJcdo0aYcVS7bmEeSEBLPA9YJp5bjrofdU3pIXs= -contrib.go.opencensus.io/exporter/stackdriver v0.12.1/go.mod h1:iwB6wGarfphGGe/e5CWqyUk/cLzKnWsOKPVW3no6OTw= contrib.go.opencensus.io/exporter/zipkin v0.1.1 h1:PR+1zWqY8ceXs1qDQQIlgXe+sdiwCf0n32bH4+Epk8g= contrib.go.opencensus.io/exporter/zipkin v0.1.1/go.mod h1:GMvdSl3eJ2gapOaLKzTKE3qDgUkJ86k9k3yY2eqwkzc= -contrib.go.opencensus.io/integrations/ocsql v0.1.4/go.mod h1:8DsSdjz3F+APR+0z0WkU1aRorQCFfRxvqjUUPMbF3fE= -contrib.go.opencensus.io/resource v0.1.1/go.mod h1:F361eGI91LCmW1I/Saf+rX0+OFcigGlFvXwEGEnkRLA= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/Azure/azure-amqp-common-go/v2 v2.1.0/go.mod h1:R8rea+gJRuJR6QxTir/XuEd+YuKoUiazDC/N96FiDEU= -github.com/Azure/azure-pipeline-go v0.1.8/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= -github.com/Azure/azure-pipeline-go v0.1.9/go.mod h1:XA1kFWRVhSK+KNFiOhfv83Fv8L9achrP7OxIzeTn1Yg= -github.com/Azure/azure-sdk-for-go v29.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v30.1.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-service-bus-go v0.9.1/go.mod h1:yzBx6/BUGfjfeqbRZny9AQIbIe3AcV9WZbAdpkoXOa0= -github.com/Azure/azure-storage-blob-go v0.6.0/go.mod h1:oGfmITT1V6x//CswqY2gtAHND+xIP64/qL7a5QJix0Y= github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8= -github.com/Azure/go-autorest v12.0.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.1.0/go.mod h1:AKyIcETwSUFxIcs/Wnq/C+kwCtlEYGUVd7FPNb2slmg= github.com/Azure/go-autorest/autorest v0.5.0/go.mod h1:9HLKlQjVBH6U3oDfsXOeVc56THsLPw1L03yban4xThw= github.com/Azure/go-autorest/autorest/adal v0.1.0/go.mod h1:MeS4XhScH55IST095THyTxElntu7WqB7pNbZo8Q5G3E= @@ -49,8 +35,6 @@ github.com/Azure/go-autorest/tracing v0.1.0/go.mod h1:ROEEAFwXycQw7Sn3DXNtEedEvd github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/GoogleCloudPlatform/cloudsql-proxy v0.0.0-20190605020000-c4ba1fdf4d36/go.mod h1:aJ4qN3TfrelA6NZ6AXsXRfmEVaYin3EDbSPJrKS8OXo= github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/semver/v3 v3.0.2 h1:tRi7ENs+AaOUCH+j6qwNQgPYfV26dX3JNonq+V4mhqc= @@ -61,19 +45,12 @@ github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jB github.com/Microsoft/go-winio v0.4.15-0.20190919025122-fc70bd9a86b5/go.mod h1:tTuCMEN+UleMWgg9dVx4Hu52b1bJo+59jBh3ajtinzw= github.com/Microsoft/hcsshim v0.8.6/go.mod h1:Op3hHsoHPAvb6lceZHDtd9OkTew38wNoXnJs8iY7rUg= github.com/Microsoft/hcsshim v0.8.7-0.20191101173118-65519b62243c/go.mod h1:7xhjOwRV2+0HXGmM0jxaEu+ZiXJFoVZOTfL/dmqbrD8= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OpenDNS/vegadns2client v0.0.0-20180418235048-a3fa4a771d87/go.mod h1:iGLljf5n9GjT6kc0HBvyI1nOKnGQbNB66VzSNbK5iks= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/RoaringBitmap/roaring v0.4.7/go.mod h1:8khRDP4HmeXns4xIj9oGrKSz7XTQiJx2zgh7AcNke4w= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= -github.com/Shopify/sarama v1.24.1/go.mod h1:fGP8eQ6PugKEI0iUETYYtnP6d1pH/bdDMTel1X5ajsU= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= github.com/UnnoTed/fileb0x v1.1.4 h1:IUgFzgBipF/ujNx9wZgkrKOF3oltUuXMSoaejrBws+A= github.com/UnnoTed/fileb0x v1.1.4/go.mod h1:X59xXT18tdNk/D6j+KZySratBsuKJauMtVuJ9cgOiZs= -github.com/abbot/go-http-auth v0.4.1-0.20181019201920-860ed7f246ff/go.mod h1:Cz6ARTIzApMJDzh5bRMSUou6UMSp0IEXg9km/ci7TJM= -github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/akamai/AkamaiOPEN-edgegrid-golang v0.9.0/go.mod h1:zpDJeKyp9ScW4NNrbdr+Eyxvry3ilGPewKoXw3XGN1k= github.com/alangpierce/go-forceexport v0.0.0-20160317203124-8f1d6941cd75/go.mod h1:uAXEEpARkRhCZfEvy/y0Jcc888f9tHCc1W7/UeEtreE= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= @@ -83,51 +60,27 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190808125512-07798873deee/go.mod h1:myCDvQSzCW+wB1WAlocEru4wMGJxy+vlxHdhegi1CDQ= github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190307165228-86c17b95fcd5/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/anacrolix/envpprof v0.0.0-20180404065416-323002cec2fa/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= -github.com/anacrolix/envpprof v1.0.0/go.mod h1:KgHhUaQMc8cC0+cEflSgCFNFbKwi5h54gqtVn8yhP7c= -github.com/anacrolix/missinggo v1.1.2-0.20190815015349-b888af804467/go.mod h1:MBJu3Sk/k3ZfGYcS7z18gwfu72Ey/xopPFJJbTi5yIo= -github.com/anacrolix/missinggo v1.2.1/go.mod h1:J5cMhif8jPmFoC3+Uvob3OXXNIhOUikzMt+uUjeM21Y= -github.com/anacrolix/missinggo/perf v1.0.0/go.mod h1:ljAFWkBuzkO12MQclXzZrosP5urunoLS0Cbvb4V0uMQ= -github.com/anacrolix/sync v0.2.0/go.mod h1:BbecHL6jDSExojhNtgTFSBcdGerzNc64tz3DCOj/I0g= -github.com/anacrolix/tagflag v0.0.0-20180109131632-2146c8d41bf0/go.mod h1:1m2U/K6ZT+JZG0+bdMK6qauP49QT4wE5pmhJXOKKCHw= -github.com/anacrolix/utp v0.0.0-20180219060659-9e0e1d1d0572/go.mod h1:MDwc+vsGEq7RMw6lr2GKOEqjWny5hO5OZXRVNaBJ2Dk= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= -github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= -github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/ascarter/requestid v0.0.0-20170313220838-5b76ab3d4aee h1:3T/l+vMotQ7cDSLWNAn2Vg1SAQ3mdyLgBWWBitSS3uU= github.com/ascarter/requestid v0.0.0-20170313220838-5b76ab3d4aee/go.mod h1:u7Wtt4WATGGgae9mURNGQQqxAudPKrxfsbSDSGOso+g= -github.com/asim/go-awsxray v0.0.0-20161209120537-0d8a60b6e205/go.mod h1:frVmN4PtXUuL1EbZn0uL4PHSTKNKFnbMpBIhngqMuNQ= -github.com/asim/go-bson v0.0.0-20160318195205-84522947cabd/go.mod h1:L59ZX7HuzTbNzFBt8g3SJkRraj+GBOgvLAfJYJUcQ5w= -github.com/aws/aws-sdk-go v1.15.27/go.mod h1:mFuSZ37Z9YOHbQEwBWztmVzqXrEkub65tZoCYDt7FT0= -github.com/aws/aws-sdk-go v1.19.18/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/aws/aws-sdk-go v1.25.31/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= github.com/beevik/ntp v0.2.0/go.mod h1:hIHWr+l3+/clUnF44zdK+CWW7fO8dR5cIylAQ76NRpg= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitly/go-simplejson v0.5.0/go.mod h1:cXHtHw4XUPsvGaxgjIAn8PhEWG9NfngEKAMDJEczWVA= github.com/blang/semver v3.1.0+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= github.com/bmatcuk/doublestar v1.1.1 h1:YroD6BJCZBYx06yYFEWvUuKVWQn3vLLQAVmDmvTSaiQ= github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869/go.mod h1:Ekp36dRnpXw/yCqJaO+ZrUyxD+3VXMFFr56k5XYrpB4= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= -github.com/boombuler/barcode v1.0.1-0.20190219062509-6c824513bacc/go.mod h1:paBWMcWSl3LHKBqUq+rly7CNSldXjb2rDl3JlRe0mD8= -github.com/bradfitz/gomemcache v0.0.0-20190913173617-a41fca850d0b/go.mod h1:H0wQNHz2YrLsuXOZozoeDmnHXkNCRmMW0gwFWDfEZDA= -github.com/bradfitz/iter v0.0.0-20140124041915-454541ec3da2/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo= -github.com/bradfitz/iter v0.0.0-20190303215204-33e6a9893b0c/go.mod h1:PyRFw1Lt2wKX4ZVSQ2mk+PeDa1rxyObEDlApuIsUKuo= github.com/bwmarrin/discordgo v0.19.0/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/bwmarrin/discordgo v0.20.1/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= github.com/bwmarrin/discordgo v0.20.2/go.mod h1:O9S4p+ofTFwB02em7jkpkV8M3R0/PUVOwN61zSZ0r4Q= -github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v3 v3.0.0/go.mod h1:cIeZDE3IrqwwJl6VUwCN6trj1oXrTS4rc0ij+ULvLYs= github.com/census-instrumentation/opencensus-proto v0.2.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= @@ -140,11 +93,8 @@ github.com/cespare/xxhash/v2 v2.1.0 h1:yTUvW7Vhb89inJ+8irsUqiWjh8iT6sQPZiQzI6ReG github.com/cespare/xxhash/v2 v2.1.0/go.mod h1:dgIUBU3pDso/gPgZ1osOZ0iQf77oPR28Tjxl5dIMyVM= github.com/cheekybits/genny v1.0.0 h1:uGGa4nei+j20rOSeDeP5Of12XVm7TGUd4dJA9RDitfE= github.com/cheekybits/genny v1.0.0/go.mod h1:+tQajlRqAUrPI7DOSpB0XAqZYtQakVtB7wXkRAgjxjQ= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec/go.mod h1:jMjuTZXRI4dUb/I5gc9Hdhagfvm9+RyrPryS/auMzxE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/cloudflare-go v0.10.2/go.mod h1:qhVI5MKwBGhdNU89ZRz2plgYutcJ5PCekLxXn56w6SY= -github.com/cloudflare/cloudflare-go v0.10.6/go.mod h1:dcRl7AXBH5Bf7QFTBVc3TRzwvotSeO4AlnMhuxORAX8= github.com/containerd/cgroups v0.0.0-20190919134610-bf292b21730f/go.mod h1:OApqhQ4XNSNC13gXIwDjhOQxjWa/NxkwZXJ1EvqT0ko= github.com/containerd/console v0.0.0-20180822173158-c12b1e7919c1/go.mod h1:Tj/on1eG8kiEhd0+fhSDzsPAFESxzBBvdyEgyryXffw= github.com/containerd/containerd v1.3.0-beta.2.0.20190828155532-0293cbd26c69/go.mod h1:bC6axHOhabU15QhwfG7w5PipXdVtMXFTttgp+kVtyUA= @@ -156,6 +106,7 @@ github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= +github.com/coreos/bbolt v1.3.3 h1:n6AiVyVRKQFNb6mJlwESEvvLoDyiTzXX7ORAUlkeBdY= github.com/coreos/bbolt v1.3.3/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/etcd v3.3.17+incompatible h1:f/Z3EoDSx1yjaIjLQGo1diYUlQYSBrrAQ5vP8NjwXwo= @@ -165,6 +116,7 @@ github.com/coreos/etcd v3.3.18+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc github.com/coreos/go-oidc v2.1.0+incompatible h1:sdJrfw8akMnCuUlaZU3tE/uYXFgfqom8DBE9so9EBsM= github.com/coreos/go-oidc v2.1.0+incompatible/go.mod h1:CgnwVTmzoESiwO9qyAFEMiHoZ1nMCKZlZ9V6mm3/LKc= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f h1:JOrtw2xFKzlg+cbHpyrpLDmnN1HqhBfnX7WDiW7eG2c= @@ -176,12 +128,11 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d h1:U+s90UTSY github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.7 h1:6pwm8kMQKCmgUg0ZHTm5+/YvRK0s3THD/28+T6/kk4A= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= -github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/decker502/dnspod-go v0.2.0/go.mod h1:qsurYu1FgxcDwfSwXJdLt4kRsBLZeosEb9uq4Sy+08g= -github.com/devigned/tab v0.1.1/go.mod h1:XG9mPq0dFghrYvoBF3xdRrJzSTX1b7IQrvaL9mzjeJY= +github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= @@ -192,42 +143,26 @@ github.com/docker/docker v1.4.2-0.20190710153559-aa8249ae1b8b/go.mod h1:eEKB0N0r github.com/docker/docker v1.4.2-0.20191101170500-ac7306503d23/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/dustin/go-humanize v0.0.0-20180421182945-02af3965c54e/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= -github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts= -github.com/eknkc/basex v1.0.0/go.mod h1:k/F/exNEHFdbs3ZHuasoP2E7zeWwZblG84Y7Z59vQRo= -github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= github.com/envoyproxy/go-control-plane v0.6.9/go.mod h1:SBwIajubJHhxtWwsL9s8ss4safvEdbitLhGGK48rN6g= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/exoscale/egoscale v0.18.1/go.mod h1:Z7OOdzzTOz1Q1PjQXumlz9Wn/CddH0zSYdCF3rnBKXE= -github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/forestgiant/sliceutil v0.0.0-20160425183142-94783f95db6c/go.mod h1:pFdJbAhRf7rh6YYMUdIQGyzne6zYL1tCUW8QV2B3UfY= -github.com/fortytw2/leaktest v1.2.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= -github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8/go.mod h1:ZhphrRTfi2rbfLwlschooIH4+wKKDR4Pdxhh+TRoA20= -github.com/frankban/quicktest v1.4.1/go.mod h1:36zfPVQyHxymz4cH7wlDmVwDrJuljRB60qkgn7rorfQ= 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/fsouza/go-dockerclient v1.4.4/go.mod h1:PrwszSL5fbmsESocROrOGq/NULMXRw+bajY0ltzD6MA= github.com/fsouza/go-dockerclient v1.6.0/go.mod h1:YWwtNPuL4XTX1SKJQk86cWPmmqwx+4np9qfPbb+znGc= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gizak/termui/v3 v3.1.0 h1:ZZmVDgwHl7gR7elfKf1xc4IudXZ5qqfDh4wExk4Iajc= github.com/gizak/termui/v3 v3.1.0/go.mod h1:bXQEBkJpzxUAKf0+xq9MSWAvWZlE7c+aidmyFlkYTrY= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= -github.com/glycerine/goconvey v0.0.0-20180728074245-46e3a41ad493/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-acme/lego/v3 v3.1.0/go.mod h1:074uqt+JS6plx+c9Xaiz6+L+GBb+7itGtzfcDM2AhEE= github.com/go-acme/lego/v3 v3.3.0/go.mod h1:iGSY2vQrvQs3WezicSB/oVbO2eCrD88dpWPwb1qLqu0= github.com/go-chi/chi v4.0.2+incompatible h1:maB6vn6FqCxrpz4FqWdh4+lwpyZIQS7YEAUcHlgXVRs= @@ -235,32 +170,21 @@ github.com/go-chi/chi v4.0.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxm github.com/go-cmd/cmd v1.0.5/go.mod h1:y8q8qlK5wQibcw63djSl/ntiHUHXHGdCkPk0j4QeW4s= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-ini/ini v1.25.4/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-ini/ini v1.44.0/go.mod h1:ByCAeIL28uOIIG0E3PJtZPDL8WnHpFKFOtgjp+3Ies8= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-ldap/ldap v3.0.2+incompatible/go.mod h1:qfd9rJvER9Q0/D/Sqn1DfHRoBp40uXYvFoEVrNEPqRc= github.com/go-log/log v0.1.0 h1:wudGTNsiGzrD5ZjgIkVZ517ugi2XRe9Q/xRCzwEO4/U= github.com/go-log/log v0.1.0/go.mod h1:4mBwpdRMFLiuXZDCwU2lKQFsoSCo72j3HqBK9d81N2M= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= github.com/go-playground/locales v0.12.1/go.mod h1:IUMDtCfWo/w/mtMfIE/IG2K+Ey3ygWanZIBtBW0W2TM= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.16.0/go.mod h1:1AnU7NaIRDWWzGEKwgtJRd2xk99HeFyHw3yid4rvQIY= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= -github.com/go-redsync/redsync v1.3.1/go.mod h1:qxZwM5JOimfq8y98Wk2+c8dKtxJgG5/yIl2ODz2E5Dk= -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-stomp/stomp v2.0.3+incompatible/go.mod h1:VqCtqNZv1226A1/79yh+rMiFUcfY3R109np+7ke4n0c= github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible/go.mod h1:qf9acutJ8cwBUhm1bqgz6Bei9/C/c93FPDljKWwsOgM= github.com/go-test/deep v1.0.1 h1:UQhStjbkDClarlmv0am7OXXO4/GaPdCGiUiMTvi28sg= github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/go-test/deep v1.0.2-0.20181118220953-042da051cf31/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/godbus/dbus v0.0.0-20190422162347-ade71ed3457e/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= @@ -268,11 +192,9 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1 h1:/s5zKNz0uPFCZ5hddgPdo2TK2TVrUNMn0OOX8/aZMTE= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= -github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191002201903-404acd9df4cc h1:55rEp52jU6bkyslZ1+C/7NGfpQsEc6pxGLAGDOctqbw= @@ -282,120 +204,73 @@ github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4er github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/gomodule/redigo v2.0.0+incompatible/go.mod h1:B4C85qUVwatsJoIUNIfCRsp7qO0iAmpGFZ4EELWSbC4= -github.com/google/btree v0.0.0-20180124185431-e89373fe6b4a/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-replayers/grpcreplay v0.1.0/go.mod h1:8Ig2Idjpr6gifRd6pNVggX6TC1Zw6Jx74AKp7QNH2QE= -github.com/google/go-replayers/httpreplay v0.1.0/go.mod h1:YKZViNhiGgqdBlUbI2MwGpq4pXxNmhJLPHQ7cv2b5no= -github.com/google/gofuzz v0.0.0-20161122191042-44d81051d367/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= -github.com/google/martian v2.1.1-0.20190517191504-25dcb96d9e51+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/subcommands v1.0.1/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk= -github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/wire v0.3.0/go.mod h1:i1DMg/Lu8Sz5yYl25iOdmc5CT5qusaa+zmRWs16741s= -github.com/googleapis/gax-go v2.0.2+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.3.1/go.mod h1:on+2t9HRStVgn95RSsFWFz+6Q0Snyqv1awfrALZdbtU= github.com/gophercloud/gophercloud v0.3.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gopherjs/gopherjs v0.0.0-20181103185306-d547d1d9531e/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/handlers v1.4.2/go.mod h1:Qkdc/uu4tH4g6mTK6auzZ766c4CA0Ng8+o/OAirnOIQ= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= +github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/websocket v1.2.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= +github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM= github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= +github.com/grpc-ecosystem/go-grpc-middleware v1.1.0 h1:THDBEeQ9xZ8JEaCLyLQqXMMdRqNr0QAUJTIkQAUtFjg= github.com/grpc-ecosystem/go-grpc-middleware v1.1.0/go.mod h1:f5nM7jw/oeRSadq3xCzHAvxcr8HZnzsqU6ILg/0NiiE= +github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 h1:Ovs26xHkKqVztRpIrF/92BcuyuQ/YW4NSIpoGtfXNho= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/grpc-ecosystem/grpc-gateway v1.9.2/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.4 h1:5xLhQjsk4zqPf9EHCrja2qFZMx+yBqkO3XgJ14bNnU0= github.com/grpc-ecosystem/grpc-gateway v1.9.4/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= -github.com/hako/branca v0.0.0-20180808000428-10b799466ada/go.mod h1:tOPn4gvKEUWqIJNE+zpTeTALaRAXnrRqqSnPlO3VpEo= -github.com/hashicorp/consul/api v1.2.0/go.mod h1:1SIkFYi2ZTXUE5Kgt179+4hH33djo11+0Eo2XgTAtkw= -github.com/hashicorp/consul/sdk v0.2.0/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.8.0/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v0.0.0-20161216184304-ed905158d874/go.mod h1:JMRHfdO9jKNzS/+BTlxCjKNQHg/jZAft8U7LloJvN7I= -github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.4/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= -github.com/hashicorp/go-rootcerts v1.0.1/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= -github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-sockaddr v1.0.2/go.mod h1:rB4wwRAUzs07qva3c5SdrY/NEtAUjGlgmH/UkBUC97A= -github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= -github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= -github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.3/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= -github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= -github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/memberlist v0.1.5/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= -github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= -github.com/hashicorp/vault/api v1.0.4/go.mod h1:gDcqh3WGcR1cpF5AJz/B1UFheUEneMoIospckxBxk6Q= -github.com/hashicorp/vault/sdk v0.1.13/go.mod h1:B+hVj7TpuQY1Y/GPbCpffmgd+tSEwvhkWnjtSYCaS2M= -github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= -github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5 h1:FdBGmSkD2QpQzRWup//SGObvWf2nq89zj9+ta9OvI3A= github.com/haya14busa/goverage v0.0.0-20180129164344-eec3514a20b5/go.mod h1:0YZ2wQSuwviXXXGUiK6zXzskyBLAbLXhamxzcFHSLoM= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= -github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= github.com/huandu/xstrings v1.2.0 h1:yPeWdRnmynF7p+lLYz0H2tthW9lqhMJrQV/U7yy4wX0= github.com/huandu/xstrings v1.2.0/go.mod h1:DvyZB1rfVYsBIigL8HwpZgxHwXozlTgGqn63UyNX5k4= -github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/iij/doapi v0.0.0-20190504054126-0bbf12d6d7df/go.mod h1:QMZY7/J/KSQEhKWFeDesPjMj+wCHReeknARU3wqlyN4= github.com/ijc/Gotty v0.0.0-20170406111628-a8b993ba6abd/go.mod h1:3LVOLeyx9XVvwPgrt2be44XgSqndprz1G18rSk8KD84= github.com/imdario/mergo v0.3.7/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/imdario/mergo v0.3.8 h1:CGgOkSJeqMRmt0D9XLWExdT4m4F1vd3FV3VPt+0VxkQ= github.com/imdario/mergo v0.3.8/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= -github.com/jcmturner/gofork v0.0.0-20190328161633-dc7c13fece03/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg= +github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= github.com/joncalhoun/qson v0.0.0-20170526102502-8a9cab3a62b1/go.mod h1:DFXrEwSRX0p/aSvxE21319menCBFeQO0jXpRj7LEZUA= -github.com/json-iterator/go v0.0.0-20180612202835-f2b4162afba3/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= @@ -404,9 +279,7 @@ github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/juju/ratelimit v1.0.1/go.mod h1:qapgC/Gy+xNh9UxzV13HGGl/6UXNN+ct+vwSgWNm/qk= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/justinas/alice v1.2.0 h1:+MHSA/vccVCF4Uq37S42jwlkvI2Xzl7zTPCN5BnZNVo= github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNEe7i7qA= @@ -416,18 +289,19 @@ github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNU github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.8.2/go.mod h1:RyIbtBH6LamlWaDj8nUwkbUhJ87Yi3uG0guNDohfE1A= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/kolo/xmlrpc v0.0.0-20190717152603-07c4ee3fd181/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.8 h1:AkaSdXYQOWeaO3neb8EM634ahkXXe3jYbVh/F9lq+GI= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/labbsr0x/bindman-dns-webhook v1.0.2/go.mod h1:p6b+VCXIR8NYKpDr8/dg1HKfQoRHCdcsROXKvmoehKA= github.com/labbsr0x/goh v1.0.1/go.mod h1:8K2UhVoaWXcCU7Lxoa2omWnC8gyW8px7/lmO61c027w= @@ -437,7 +311,6 @@ github.com/labstack/gommon v0.2.7 h1:2qOPq/twXDrQ6ooBGrn3mrmVOC+biLlatwgIu8lbzRM github.com/labstack/gommon v0.2.7/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4= github.com/leodido/go-urn v1.1.0/go.mod h1:+cyI34gQWZcE1eQU7NVgKkkzdXDQHr1dBMtdAPozLkw= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= -github.com/lib/pq v1.1.1/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.2.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/linode/linodego v0.10.0/go.mod h1:cziNP7pbvE3mXIPneHj0oRY8L1WtGEIKlZ8LANE4eXA= @@ -450,8 +323,6 @@ github.com/lucas-clemente/quic-go v0.14.1/go.mod h1:Vn3/Fb0/77b02SGhQk36KzOUmXgV github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20180730094502-03f2033d19d5/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/chacha20 v0.2.0 h1:f40vqzzx+3GdOmzQoItkLX5WLvHgPgyYqFFIO5Gh4hQ= github.com/marten-seemann/chacha20 v0.2.0/go.mod h1:HSdjFau7GzYRj+ahFNwsO3ouVJr1HFkWoEwNDb4TMtE= github.com/marten-seemann/qpack v0.1.0/go.mod h1:LFt1NU/Ptjip0C2CPkhimBz5CGE3WGDAUWqna+CNTrI= @@ -460,11 +331,9 @@ github.com/marten-seemann/qtls v0.4.1 h1:YlT8QP3WCCvvok7MGEZkMldXbyqgr8oFg5/n8Gt github.com/marten-seemann/qtls v0.4.1/go.mod h1:pxVXcHHw1pNIt8Qo0pwSYQEoZ8yYOOPXTCZLQQunvRc= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= -github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= 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= @@ -480,45 +349,30 @@ github.com/micro/cli v0.2.0/go.mod h1:jRT9gmfVKWSS6pkKcXQ8YhUyj6bzwxK8Fp5b0Y7qNn github.com/micro/cli/v2 v2.1.1 h1:uFw0SMIKmGuyHIm8lXns/NOn7V62bM5y7DnlxUM+BEQ= github.com/micro/cli/v2 v2.1.1/go.mod h1:EguNh6DAoWKm9nmk+k/Rg0H3lQnDxqzu5x5srOtGtYg= github.com/micro/go-micro v1.16.0/go.mod h1:A0F58bHLh2m0LAI9QyhvmbN8c1cxhAZo3cM6s+iDsrM= -github.com/micro/go-micro v1.17.1 h1:BhwC4Lnwr3hdci9T8kN5MEabKS+CT0QT0YH4hinTdNs= -github.com/micro/go-micro v1.17.1/go.mod h1:klwUJL1gkdY1MHFyz+fFJXn52dKcty4hoe95Mp571AA= github.com/micro/go-micro v1.18.0 h1:gP70EZVHpJuUIT0YWth192JmlIci+qMOEByHm83XE9E= github.com/micro/go-micro v1.18.0/go.mod h1:klwUJL1gkdY1MHFyz+fFJXn52dKcty4hoe95Mp571AA= github.com/micro/go-micro/v2 v2.0.0 h1:bMx549RwJ9Yuiui8cDVlfYhVNP8I8KBJTMyLthEXpRw= github.com/micro/go-micro/v2 v2.0.0/go.mod h1:v7QP5UhKRt37ixjJe8DouWmg0/eE6dltr5h0idJ9BpE= -github.com/micro/go-plugins v1.5.1/go.mod h1:jcxejzJCAMH731cQHbS/hncyKe0rxAbzKkibj8glad4= github.com/micro/go-plugins/wrapper/trace/opencensus/v2 v2.0.1 h1:7IkXfl94MdLZQwk0lNmu9Cg5WP42Zak9EtQMeN4SvVs= github.com/micro/go-plugins/wrapper/trace/opencensus/v2 v2.0.1/go.mod h1:QrkcwcDtIs2hIJpIEhozekyf6Rfz5C36kFI8+zzCpX0= github.com/micro/mdns v0.3.0 h1:bYycYe+98AXR3s8Nq5qvt6C573uFTDPIYzJemWON0QE= github.com/micro/mdns v0.3.0/go.mod h1:KJ0dW7KmicXU2BV++qkLlmHYcVv7/hHnbtguSWt9Aoc= -github.com/micro/micro v1.16.0/go.mod h1:TO5Ng0KidbfRYIxVM4Q3deZ0A+qwRyP9WeXp+k2fWNA= github.com/micro/protoc-gen-micro v1.0.0/go.mod h1:C8ij4DJhapBmypcT00AXdb0cZ675/3PqUO02buWWqbE= -github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.3/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.15/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= github.com/miekg/dns v1.1.22 h1:Jm64b3bO9kP43ddLjL2EY3Io6bmy1qGb9Xxz6TqS6rc= github.com/miekg/dns v1.1.22/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.27 h1:aEH/kqUzUxGJ/UHcEKdJY+ugH6WEzsEBBSPa8zuy1aM= github.com/miekg/dns v1.1.27/go.mod h1:KNUDUusw/aVsxyTYZM1oqvCicbwhgbNgztCETuNZ7xM= -github.com/minio/highwayhash v1.0.0/go.mod h1:xQboMTeM9nY9v/LlAOxFctujiv5+Aq2hR5dxBpaMbdc= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= -github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-vnc v0.0.0-20150629162542-723ed9867aed/go.mod h1:3rdaFaCv4AyBgu5ALFM0+tSuHrBh6v692nyQe3ikrq0= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/gox v0.4.0 h1:lfGJxY7ToLJQjHHwi0EX6uYBdK78egf954SQl13PQJc= -github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= -github.com/mitchellh/iochan v1.0.0 h1:C+X3KsSTLFVBr/tK1eYN/vs4rJcvsiLU338UhYPJWeY= -github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= -github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= @@ -526,15 +380,11 @@ github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v0.0.0-20180320133207-05fbef0ca5da/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/morikuni/aec v0.0.0-20170113033406-39771216ff4c/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= -github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/namedotcom/go v0.0.0-20180403034216-08470befbe04/go.mod h1:5sN+Lt1CaY4wsPvgQH/jsuJi4XO2ssZbdsIizr4CVC8= github.com/nats-io/jwt v0.3.0 h1:xdnzwFETV++jNc4W1mw//qFyJGb2ABOombmZJQS4+Qo= github.com/nats-io/jwt v0.3.0/go.mod h1:fRYCDE99xlTsqUzISS1Bi75UBJ6ljOJQOAAu5VglpSg= @@ -553,7 +403,6 @@ github.com/nats-io/nkeys v0.1.3 h1:6JrEfig+HzTH85yxzhSVbjHRJv9cn0p6n3IngIcM5/k= github.com/nats-io/nkeys v0.1.3/go.mod h1:xpnFELMwJABBLVhffcfd1MZx6VsNRFpEugbxziKVo7w= github.com/nats-io/nuid v1.0.1 h1:5iA8DT8V7q8WK2EScv2padNa/rTESc1KdnPw4TC2paw= github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OSON2c= -github.com/nats-io/stan.go v0.5.0/go.mod h1:dYqB+vMN3C2F9pT1FRQpg9eHbjPj6mP0yYuyBNuXHZE= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 h1:zYyBkD/k9seD2A7fsi6Oo2LfFZAehjjQMERAvZLEDnQ= github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8= @@ -565,21 +414,15 @@ github.com/nrdcg/goinwx v0.6.1/go.mod h1:XPiut7enlbEdntAqalBIqcYcTEVhpv/dKWgDCX2 github.com/nrdcg/namesilo v0.2.1/go.mod h1:lwMvfQTyYq+BbjJd30ylEG4GPSS6PII0Tia4rRpRiyw= github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d h1:x3S6kxmy49zXVVyhcnrFqxvNVCBPb2KZ9hV2RBdS840= github.com/nsf/termbox-go v0.0.0-20190121233118-02980233997d/go.mod h1:IuKpRQcYE1Tfu+oAQqaLisqDeXgjyyltCfsaoYN18NQ= -github.com/nsqio/go-nsq v1.0.7/go.mod h1:XP5zaUs3pqf+Q71EqUJs3HYfBIqfK6G83WQMdNN+Ito= github.com/ogier/pflag v0.0.1 h1:RW6JSWSu/RkSatfcLtogGfFgpim5p7ARQ10ECk5O750= github.com/ogier/pflag v0.0.1/go.mod h1:zkFki7tvTa0tafRvTBIZTvzYyAu6kQhPZFnshFFPE+g= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.1/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= -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/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo v1.10.1/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.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/op/go-logging v0.0.0-20160315200505-970db520ece7/go.mod h1:HzydrMdWErDVzsI23lYNej1Htcns9BCg93Dk0bBINWk= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/image-spec v1.0.1/go.mod h1:BtxoFyWECRxE4U/7sNtV5W15zMzWCbyJoFRP3s7yZA0= @@ -593,40 +436,25 @@ github.com/openzipkin/zipkin-go v0.2.2 h1:nY8Hti+WKaP0cRsSeQ026wU03QsM762XBeCXBb github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4= github.com/oracle/oci-go-sdk v7.0.0+incompatible/go.mod h1:VQb79nF8Z2cwLkLS35ukwStZIg5F66tcBccjip/j888= github.com/ovh/go-ovh v0.0.0-20181109152953-ba5adb4cf014/go.mod h1:joRatxRJaZBsY3JAOEMcoOp05CnZzsx4scTxi95DHyQ= -github.com/owncloud/ocis-pkg v1.1.0 h1:cwhzqQAHLA8fz94YKdmqSJguSCswx5TBNkgLAU8DbJI= -github.com/owncloud/ocis-pkg v1.1.0/go.mod h1:EfbeXoe60Me2lB/AWjYl8UFNv4isqCPP6lokd5R7nyM= -github.com/owncloud/ocis-pkg v1.3.0 h1:2fkgvfd/spTjschuulYMHRuzxkCGGXae9ocebVYkm74= -github.com/owncloud/ocis-pkg v1.3.0/go.mod h1:Wo0QfOmhadh2vNcUoQIsw2yaOT3zeftk+xaOOwP3y88= -github.com/owncloud/ocis-pkg/v2 v2.0.0 h1:RJAe5wYsNZrDjbRX8iKpVf5pnzKbFAoVa23oApv4mEE= -github.com/owncloud/ocis-pkg/v2 v2.0.0/go.mod h1:7bVnn3VUaqdmvpMkXF0QVEF1fRugs35hSkuVTAq9yjk= github.com/owncloud/ocis-pkg/v2 v2.0.1 h1:3ISEtfjAz4pDFczTggIJwKuft3bVsAp1C7dFY9BBPEs= github.com/owncloud/ocis-pkg/v2 v2.0.1/go.mod h1:7bVnn3VUaqdmvpMkXF0QVEF1fRugs35hSkuVTAq9yjk= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c h1:rp5dCmg/yLR3mgFuSOe4oEnDDmGLROTvMragMUXpTQw= github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c/go.mod h1:X07ZCGwUbLaax7L0S3Tw4hpejzu63ZrrQiUe6W0hcy0= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= -github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k= github.com/pelletier/go-buffruneio v0.2.0/go.mod h1:JkE26KsDizTr40EUHkXVtNPvgGtbSNq5BcowyYOWdKo= github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= -github.com/pierrec/lz4 v2.2.6+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= 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/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= -github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35 h1:J9b7z+QKAmPf4YLrFg6oQUotqHQeUNWwkvo7jZp1GLU= github.com/pquerna/cachecontrol v0.0.0-20180517163645-1555304b9b35/go.mod h1:prYjPmNq4d1NPVmpShWobRqXY3q7Vp+80DqgxxUrUIA= -github.com/pquerna/otp v1.2.0/go.mod h1:dkJfzwRKNiegxyNb54X/3fLwhCynbMspSyWKnvi1AEg= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso= @@ -662,44 +490,32 @@ github.com/restic/calens v0.2.0 h1:LVNAtmFc+Pb4ODX66qdX1T3Di1P0OTLyUsVyvM/xD7E= github.com/restic/calens v0.2.0/go.mod h1:UXwyAKS4wsgUZGEc7NrzzygJbLsQZIo3wl+62Q1wvmU= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/zerolog v1.17.2 h1:RMRHFw2+wF7LO0QqtELQwo8hqSmqISyCJeFeAAuWcRo= github.com/rs/zerolog v1.17.2/go.mod h1:9nvC1axdVrAHcu/s9taAVfBuIdTZLVQmKQyvrUjF5+I= github.com/russross/blackfriday/v2 v2.0.1 h1:lPqVAte+HuHNfhJ/0LC98ESWRz8afy9tM/0RK8m9o+Q= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc= -github.com/ryszard/goskiplist v0.0.0-20150312221310-2dfbae5fcf46/go.mod h1:uAQ5PCi+MFsC7HjREoAz1BU+Mq60+05gifQSsHSDG/8= github.com/sacloud/libsacloud v1.26.1/go.mod h1:79ZwATmHLIFZIMd7sxA3LwzVy/B77uj3LDoToVTxDoQ= -github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/serenize/snaker v0.0.0-20171204205717-a683aaf2d516/go.mod h1:Yow6lPLSAXx2ifx470yD/nUe22Dv5vBvxK/UK9UUTVs= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/sanitized_anchor_name v1.0.0 h1:PdmoCO6wvbs+7yrJyMORt4/BmY5IYyJwS/kOiWx8mHo= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= +github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/skratchdot/open-golang v0.0.0-20160302144031-75fb7ed4208c/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/go-aws-auth v0.0.0-20180515143844-0c1422d1fdb9/go.mod h1:SnhjPscd9TpLiy1LpzGSKh3bXCfxxXuqd9xmQJy3slM= -github.com/smartystreets/goconvey v0.0.0-20181108003508-044398e4856c/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= github.com/smartystreets/goconvey v0.0.0-20190330032615-68dc04aab96a/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/soheilhy/cmux v0.1.4 h1:0HKaf1o97UwFjHH9o5XsHUOF+tqmdA7KEzXLpiyaw0E= github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/sony/gobreaker v0.4.1/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -707,25 +523,20 @@ github.com/spf13/viper v1.5.0 h1:GpsTwfsQ27oS/Aha/6d1oD7tpKIqWnOA6tgOX9HHkt4= github.com/spf13/viper v1.5.0/go.mod h1:AkYRkVJF8TkSG/xet6PzXX+l39KhhXa2pdqVSxnTcn4= github.com/src-d/gcfg v1.4.0/go.mod h1:p/UMsR43ujA89BJY9duynAwIpvqEujIH/jFlfL7jWoI= github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= -github.com/streadway/amqp v0.0.0-20190827072141-edfb9018d271/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw= 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 v0.0.0-20151208002404-e3a8ff8ce365/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stvp/tempredis v0.0.0-20181119212430-b82af8480203/go.mod h1:oqN97ltKNihBbwlX8dLpwxCl3+HnXKV/R0e+sRLd9C8= github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/syndtr/gocapability v0.0.0-20170704070218-db04d3cc01c8/go.mod h1:hkRG7XYTFWNJGYcbNJQlaLq0fg1yr4J4t/NcTQtrfww= github.com/technoweenie/multipartstreamer v1.0.1/go.mod h1:jNVxdtShOxzAsukZwTSw6MDx5eUJoiEBsSvzDU9uzog= github.com/timewasted/linode v0.0.0-20160829202747-37e84520dcf7/go.mod h1:imsgLplxEC/etjIhdr3dNzV3JeT27LbVu5pYWm0JCBY= -github.com/tinylib/msgp v1.0.2/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= -github.com/tinylib/msgp v1.1.0/go.mod h1:+d+yLhGm8mzTaHzB+wgMYrodPfmZrzkirds8fDWklFE= github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= +github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc h1:yUaosFVTJwnltaHbSNC3i82I92quFs+OFPRl8kNMVwo= github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce h1:fb190+cK2Xz/dvi9Hv8eCYJYvIGUTN2/KLq1pT6CjEc= github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4= @@ -741,21 +552,18 @@ github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyC github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4 h1:gKMu1Bf6QINDnvyZuTaACm9ofY+PRh+5vFz4oxBZeF8= github.com/valyala/fasttemplate v0.0.0-20170224212429-dcecefd839c4/go.mod h1:50wTf68f99/Zt14pr046Tgt3Lp2vLyFZKzbFXTOabXw= github.com/vultr/govultr v0.1.4/go.mod h1:9H008Uxr/C4vFNGLqKx232C206GL0PBHzOP0809bGNA= -github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPySAYV4= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I= -github.com/xdg/stringprep v1.0.0/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v0.0.0-20180618132009-1d523034197f/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= github.com/xeipuuv/gojsonschema v1.1.0/go.mod h1:5yf86TLmAcydyeJq5YvxkGPE2fm/u4myDekKRoLuqhs= +github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20181112141820-a009c3971eca/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/zenazn/goji v0.9.0/go.mod h1:7S9M489iMyHBNxwZnk9/EHS098H4/F6TATF2mIxtB1Q= go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= +go.etcd.io/bbolt v1.3.3 h1:MUGmc65QhB3pIlaQ5bB4LwqSj6GIonVJXpZiaKNyaKk= go.etcd.io/bbolt v1.3.3/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU= -go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -771,19 +579,16 @@ go.uber.org/multierr v1.2.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/ go.uber.org/multierr v1.3.0 h1:sFPn2GLc3poCkfrpIXGhBD2X0CMIo4Q/zSULXrj/+uc= go.uber.org/multierr v1.3.0/go.mod h1:VgVr7evmIr6uPjLBxg28wmKNXyqE9akIJ5XnfpiKl+4= go.uber.org/ratelimit v0.0.0-20180316092928-c15da0234277/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= -go.uber.org/ratelimit v0.1.0/go.mod h1:2X8KaoNd1J0lZV+PxJk/5+DGbO/tpwLR1m++a7FnB/Y= +go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4= go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee/go.mod h1:vJERXedbb3MVM5f9Ejo0C68/HhF8uaILCdgjnY+goOA= go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.12.0 h1:dySoUQPFBGj6xwjmBzageVL8jGi8uxc6bEmJQjA06bw= go.uber.org/zap v1.12.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.13.0 h1:nR6NoDBgAf67s68NhaXbsojM+2gxp3S1hWkHDl27pVU= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= -gocloud.dev v0.17.0/go.mod h1:tIHTRdR1V5dlD8sTkzYdTGizBJ314BDykJ8KmadEXwo= -gocloud.dev/pubsub/rabbitpubsub v0.17.0/go.mod h1:7o1XYDiIC+b0mmcwJuofsDg08t0DtU2ubfn7C/Uz7Y0= golang.org/x/crypto v0.0.0-20180621125126-a49355c7e3f8/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180910181607-0e37d006457b/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181030102418-4d3f4d9ffa16/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -791,7 +596,6 @@ golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190404164418-38d8ce5564a5/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190418165655-df01cb2cc480/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -827,15 +631,12 @@ golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCc golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180611182652-db08ff08e862/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= golang.org/x/net v0.0.0-20180921000356-2f5d2388922f/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -848,24 +649,19 @@ golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190619014844-b5b0513f8c1b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190930134127-c5a3c61f89f3/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191011234655-491137f69257/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191014212845-da9a3fd4c582/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191027093000-83d349e8ac1a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20191028085509-fe3aa8a45271/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191109021931-daa7c04131f5 h1:bHNaocaoJxYBo5cw41UyTMLjYlb8wPY7+WFrnklbHOM= golang.org/x/net v0.0.0-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa h1:F+8P+gmewFQYRk6JoLQLwjBCTu3mcIURZfNkVweuRKA= golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -876,23 +672,18 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEha golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180622082034-63fc586f45fe/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/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= golang.org/x/sys v0.0.0-20181019160139-8e24a49d80f8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190130150945-aca44879d564/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/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-20190228124157-a34e9553db1e/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= @@ -902,13 +693,11 @@ golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190514135907-3a4b5fb9f71f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190620070143-6f217b454f45/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190826190057-c7b8b68b1456/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -916,27 +705,23 @@ golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20191010194322-b09406accb47/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4 h1:Hynbrlo6LbYI3H1IqXpkVDOcX/3HiPdhVEuyj5a59RM= golang.org/x/sys v0.0.0-20191110163157-d32e6e3b99c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/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/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 h1:xQwXv67TxFo9nC1GJFyab5eq/5B590r6RlnL/G8Sz7w= golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20181011042414-1f849cf54d09/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-20190114222345-bf090417da8b/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-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190422233926-fe54fb35175b/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= @@ -960,13 +745,9 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.5.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= -google.golang.org/api v0.6.0/go.mod h1:btoxGiFvQNVUZQ8W08zLtrVS08CNpINPEfxXxgJL1Q4= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= -google.golang.org/api v0.13.0 h1:Q3Ui3V3/CVinFWFiW39Iw0kMuVrRzYX0wN6OPFp0lTA= -google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/api v0.14.0 h1:uMf5uLi4eQMRrMKhCplNik4U4H8Z6C1br3zOtAa/aDE= google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= @@ -976,13 +757,9 @@ google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190508193815-b515fa19cec8/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= -google.golang.org/genproto v0.0.0-20190530194941-fb225487d101/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= -google.golang.org/genproto v0.0.0-20190620144150-6af8c5fc6601/go.mod h1:z3L6/3dTEVtUr6QSP8miRzeRqwQOioJ9I66odjN4I7s= google.golang.org/genproto v0.0.0-20190716160619-c506a9f90610/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= @@ -992,7 +769,6 @@ google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvx google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba h1:pRj9OXZbwNtbtZtOB4dLwfK4u+EVRMvP+e9zKkg2grM= google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= 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= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= @@ -1007,34 +783,19 @@ google.golang.org/grpc v1.25.1 h1:wdKvqQk7IttEw92GoRyKG2IDrUIpgpj6H6m81yfeMW0= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= google.golang.org/grpc v1.26.0 h1:2dTRdpdFEEhJYQD8EMLB61nnrzSCTbG38PhqdhvOltg= google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -gopkg.in/DataDog/dd-trace-go.v1 v1.19.0/go.mod h1:DVp8HmDh8PuTu2Z0fVVlBsyWaC++fzwVCaGWylTe3tg= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= -gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= -gopkg.in/asn1-ber.v1 v1.0.0-20181015200546-f715ec2f112d/go.mod h1:cuepJuh7vyXfUyUwEgHQXw849cJrilpS5NeIjOWESAw= -gopkg.in/bsm/ratelimit.v1 v1.0.0-20160220154919-db14e161995a/go.mod h1:KF9sEfUPAXdG8Oev9e99iLGnl2uJMjc5B+4y3O7x610= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= 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/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/go-playground/assert.v1 v1.2.1/go.mod h1:9RXL0bg/zibRAgZUYszZSwO/z8Y/a8bDuhia5mkpMnE= gopkg.in/go-playground/validator.v9 v9.30.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= gopkg.in/go-playground/validator.v9 v9.31.0/go.mod h1:+c9/zcJMFNgbLvly1L1V+PpxWdVbfP1avr/N00E2vyQ= -gopkg.in/gomail.v2 v2.0.0-20160411212932-81ebce5c23df/go.mod h1:LRQQ+SO6ZHR7tOkpBDuZnXENFzX8qRjMDMyPD6BRkCw= gopkg.in/h2non/gock.v1 v1.0.15/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= -gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/ini.v1 v1.44.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/jcmturner/aescts.v1 v1.0.1/go.mod h1:nsR8qBOg+OucoIW+WMhB3GspUQXq9XorLnQb9XtvcOo= -gopkg.in/jcmturner/dnsutils.v1 v1.0.1/go.mod h1:m3v+5svpVOhtFAP/wSz+yzh4Mc0Fg7eRhxkJMWSIz9Q= -gopkg.in/jcmturner/goidentity.v3 v3.0.0/go.mod h1:oG2kH0IvSYNIu80dVAyu/yoefjq1mNfM5bm88whjWx4= -gopkg.in/jcmturner/gokrb5.v7 v7.2.3/go.mod h1:l8VISx+WGYp+Fp7KRbsiUuXTTOnxIc3Tuvyavf11/WM= -gopkg.in/jcmturner/rpc.v1 v1.1.0/go.mod h1:YIdkC4XfD6GXbzje11McwsDuOlZQSb9W4vfLvuNnlv8= -gopkg.in/ldap.v3 v3.1.0/go.mod h1:dQjCc0R0kfyFjIlWNMH1DORwUASZyDxo2Ry1B51dXaQ= gopkg.in/ns1/ns1-go.v2 v2.0.0-20190730140822-b51389932cbc/go.mod h1:VV+3haRsgDiVLxyifmMBrBIuCWFBPYKbRssXB9z67Hw= -gopkg.in/olivere/elastic.v5 v5.0.82/go.mod h1:uhHoB4o3bvX5sorxBU29rPcmBQdV2Qfg0FBrx5D6pV0= -gopkg.in/redis.v3 v3.6.4/go.mod h1:6XeGv/CrsUFDU9aVbUdNykN7k1zVmoeg83KC9RbQfiU= gopkg.in/resty.v1 v1.9.1/go.mod h1:vo52Hzryw9PnPHcJfPsBiFW62XhNx5OczbV9y+IMpgc= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/square/go-jose.v2 v2.3.1 h1:SK5KegNXmKmqE342YYN2qPHEnUYeoMiXXl1poUlI+o4= @@ -1058,18 +819,7 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.1-2019.2.3 h1:3JgtbtFHMiCmsznwGVTUWbgGov+pVqnlf1dEJTNAXeM= honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= -k8s.io/api v0.0.0-20191109101513-0171b7c15da1/go.mod h1:VJq7+38rpM4TSUbRiZX4P5UVAKK2UQpNQLZClkFQkpE= -k8s.io/apimachinery v0.0.0-20191109100837-dffb012825f2/go.mod h1:+6CX7hP4aLfX2sb91JYDMIp0VqDSog2kZu0BHe+lP+s= -k8s.io/apimachinery v0.0.0-20191111054156-6eb29fdf75dc/go.mod h1:+6CX7hP4aLfX2sb91JYDMIp0VqDSog2kZu0BHe+lP+s= -k8s.io/client-go v11.0.0+incompatible/go.mod h1:7vJpHMYJwNQCWgzmNV+VYUl1zCObLyodBc8nIyt8L5s= -k8s.io/gengo v0.0.0-20190128074634-0689ccc1d7d6/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= -k8s.io/klog v0.0.0-20181102134211-b9b56d5dfc92/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v0.3.0/go.mod h1:Gq+BEi5rUBO/HRz0bTSXDUcqjScdoY3a9IHpCEIOOfk= -k8s.io/klog v1.0.0/go.mod h1:4Bi6QPql/J/LkTDqv7R/cd3hPo4k2DG6Ptcz060Ez5I= -k8s.io/kube-openapi v0.0.0-20191107075043-30be4d16710a/go.mod h1:1TqjTSzOxsLGIKfj0lK8EeCP7K1iUG65v09OM0/WG5E= k8s.io/kubernetes v1.13.0/go.mod h1:ocZa8+6APFNC2tX1DZASIbocyYT5jHzqFVsY5aoB7Jk= -k8s.io/utils v0.0.0-20191030222137-2b95a09bc58d/go.mod h1:sZAwmy6armz5eXlNoLmJcl4F1QuKu7sr+mFQ0byX7Ew= -pack.ag/amqp v0.11.2/go.mod h1:4/cbmt4EJXSKlG6LCfWHoqmN0uFdy5i/+YFz+fTfhV4= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= -sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e/go.mod h1:wWxsB5ozmmv/SG7nM11ayaAW51xMvak/t1r0CSlcokI= +sigs.k8s.io/yaml v1.1.0 h1:4A07+ZFc2wgJwo8YNlQpr1rVlgUDlxXHhPJciaPY5gs= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= diff --git a/pkg/metrics/metrics.go b/pkg/metrics/metrics.go index f08a93a..0ecf2f5 100644 --- a/pkg/metrics/metrics.go +++ b/pkg/metrics/metrics.go @@ -1,5 +1,7 @@ package metrics +import "github.com/prometheus/client_golang/prometheus" + var ( // Namespace defines the namespace for the defines metrics. Namespace = "ocis" @@ -10,23 +12,45 @@ var ( // Metrics defines the available metrics of this service. type Metrics struct { - // Counter *prometheus.CounterVec + Counter *prometheus.CounterVec + Latency *prometheus.SummaryVec + Duration *prometheus.HistogramVec } // New initializes the available metrics. func New() *Metrics { m := &Metrics{ - // Counter: prometheus.NewCounterVec(prometheus.CounterOpts{ - // Namespace: Namespace, - // Subsystem: Subsystem, - // Name: "greet_total", - // Help: "How many greeting requests processed", - // }, []string{}), + Counter: prometheus.NewCounterVec(prometheus.CounterOpts{ + Namespace: Namespace, + Subsystem: Subsystem, + Name: "getthumbnail_total", + Help: "How many GetThumbnail requests processed", + }, []string{}), + Latency: prometheus.NewSummaryVec(prometheus.SummaryOpts{ + Namespace: Namespace, + Subsystem: Subsystem, + Name: "getthumbnail_latency_microseconds", + Help: "GetThumbnail request latencies in microseconds", + }, []string{}), + Duration: prometheus.NewHistogramVec(prometheus.HistogramOpts{ + Namespace: Namespace, + Subsystem: Subsystem, + Name: "getthumbnail_duration_seconds", + Help: "GetThumbnail method requests time in seconds", + }, []string{}), } - // prometheus.Register( - // m.Counter, - // ) + prometheus.Register( + m.Counter, + ) + + prometheus.Register( + m.Latency, + ) + + prometheus.Register( + m.Duration, + ) return m } diff --git a/pkg/service/v0/instrument.go b/pkg/service/v0/instrument.go index 86ab4e6..dbd9026 100644 --- a/pkg/service/v0/instrument.go +++ b/pkg/service/v0/instrument.go @@ -5,6 +5,7 @@ import ( "github.com/owncloud/ocis-thumbnails/pkg/metrics" v0proto "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" + "github.com/prometheus/client_golang/prometheus" ) // NewInstrument returns a service that instruments metrics. @@ -22,5 +23,17 @@ type instrument struct { // GetThumbnail implements the ThumbnailServiceHandler interface. func (i instrument) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error { - return i.next.GetThumbnail(ctx, req, rsp) + timer := prometheus.NewTimer(prometheus.ObserverFunc(func(v float64) { + us := v * 1000_000 + i.metrics.Latency.WithLabelValues().Observe(us) + i.metrics.Duration.WithLabelValues().Observe(v) + })) + defer timer.ObserveDuration() + + err := i.next.GetThumbnail(ctx, req, rsp) + + if err != nil { + i.metrics.Counter.WithLabelValues().Inc() + } + return err } diff --git a/pkg/service/v0/logging.go b/pkg/service/v0/logging.go index 90f2916..0972efa 100644 --- a/pkg/service/v0/logging.go +++ b/pkg/service/v0/logging.go @@ -2,6 +2,7 @@ package svc import ( "context" + "time" "github.com/owncloud/ocis-pkg/v2/log" v0proto "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" @@ -22,5 +23,21 @@ type logging struct { // GetThumbnail implements the ThumbnailServiceHandler interface. func (l logging) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error { - return l.next.GetThumbnail(ctx, req, rsp) + start := time.Now() + err := l.next.GetThumbnail(ctx, req, rsp) + + logger := l.logger.With(). + Str("method", "Thumbnails.GetThumbnail"). + Dur("duration", time.Since(start)). + Logger() + + if err != nil { + logger.Warn(). + Err(err). + Msg("Failed to execute") + } else { + logger.Debug(). + Msg("") + } + return err } diff --git a/pkg/service/v0/tracing.go b/pkg/service/v0/tracing.go index 33d4f01..cf88e0f 100644 --- a/pkg/service/v0/tracing.go +++ b/pkg/service/v0/tracing.go @@ -4,6 +4,7 @@ import ( "context" v0proto "github.com/owncloud/ocis-thumbnails/pkg/proto/v0" + "go.opencensus.io/trace" ) // NewTracing returns a service that instruments traces. @@ -19,5 +20,16 @@ type tracing struct { // GetThumbnail implements the ThumbnailServiceHandler interface. func (t tracing) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error { + ctx, span := trace.StartSpan(ctx, "Thumbnails.GetThumbnail") + defer span.End() + + span.Annotate([]trace.Attribute{ + trace.StringAttribute("filepath", req.Filepath), + trace.StringAttribute("filetype", req.Filetype.String()), + trace.StringAttribute("etag", req.Etag), + trace.Int64Attribute("width", int64(req.Width)), + trace.Int64Attribute("height", int64(req.Height)), + }, "Execute Thumbnails.GetThumbnail handler") + return t.next.GetThumbnail(ctx, req, rsp) } diff --git a/tools.go b/tools.go index 8a77af6..2d5012c 100644 --- a/tools.go +++ b/tools.go @@ -4,5 +4,8 @@ package main import ( _ "github.com/UnnoTed/fileb0x" + _ "github.com/cespare/reflex" + _ "github.com/kballard/go-shellquote" + _ "github.com/ogier/pflag" _ "github.com/restic/calens" ) From 024e4661e2b07bcdc5843699929a5e81764b4a7a Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 18 Mar 2020 11:13:09 +0100 Subject: [PATCH 21/21] add mimetype to service response --- pkg/proto/v0/thumbnails.pb.go | 45 +++++++++++++++++++++-------------- pkg/proto/v0/thumbnails.proto | 1 + pkg/service/v0/service.go | 2 ++ pkg/thumbnails/encoding.go | 12 ++++++++++ 4 files changed, 42 insertions(+), 18 deletions(-) diff --git a/pkg/proto/v0/thumbnails.pb.go b/pkg/proto/v0/thumbnails.pb.go index 8fb6ad6..db7c910 100644 --- a/pkg/proto/v0/thumbnails.pb.go +++ b/pkg/proto/v0/thumbnails.pb.go @@ -126,6 +126,7 @@ func (m *GetRequest) GetAuthorization() string { type GetResponse struct { Thumbnail []byte `protobuf:"bytes,1,opt,name=thumbnail,proto3" json:"thumbnail,omitempty"` + Mimetype string `protobuf:"bytes,2,opt,name=mimetype,proto3" json:"mimetype,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -163,6 +164,13 @@ func (m *GetResponse) GetThumbnail() []byte { return nil } +func (m *GetResponse) GetMimetype() string { + if m != nil { + return m.Mimetype + } + return "" +} + func init() { proto.RegisterEnum("com.owncloud.ocis.thumbnails.v0.GetRequest_FileType", GetRequest_FileType_name, GetRequest_FileType_value) proto.RegisterType((*GetRequest)(nil), "com.owncloud.ocis.thumbnails.v0.GetRequest") @@ -172,24 +180,25 @@ func init() { func init() { proto.RegisterFile("pkg/proto/v0/thumbnails.proto", fileDescriptor_e354cb4f8a62b6c2) } var fileDescriptor_e354cb4f8a62b6c2 = []byte{ - // 300 bytes of a gzipped FileDescriptorProto + // 309 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x4f, 0x4f, 0xc2, 0x40, - 0x10, 0xc5, 0x2d, 0x50, 0xfe, 0x8c, 0x68, 0xc8, 0xc4, 0x98, 0x86, 0x60, 0x24, 0xc4, 0x03, 0x09, + 0x10, 0xc5, 0x2d, 0x50, 0xfe, 0x8c, 0x68, 0xc8, 0xc4, 0x98, 0x86, 0x60, 0x24, 0xc4, 0x03, 0x89, 0x66, 0x21, 0xe8, 0x27, 0xf0, 0x60, 0x13, 0x0f, 0x86, 0x54, 0x4e, 0xde, 0x4a, 0x19, 0xd9, 0x8d, - 0xa5, 0xbb, 0xd2, 0x29, 0x04, 0x13, 0x13, 0x3f, 0xba, 0x71, 0x2b, 0x45, 0x4f, 0xea, 0x69, 0xe7, - 0xfd, 0x76, 0xf2, 0x66, 0xf6, 0x2d, 0x9c, 0x99, 0xe7, 0xc5, 0xd0, 0xac, 0x34, 0xeb, 0xe1, 0x7a, - 0x34, 0x64, 0x99, 0x2d, 0x67, 0x49, 0xa8, 0xe2, 0x54, 0x58, 0x86, 0xe7, 0x91, 0x5e, 0x0a, 0xbd, - 0x49, 0xa2, 0x58, 0x67, 0x73, 0xa1, 0x23, 0x95, 0x8a, 0x6f, 0x3d, 0xeb, 0x51, 0xef, 0xbd, 0x04, - 0xe0, 0x13, 0x07, 0xf4, 0x92, 0x51, 0xca, 0xd8, 0x86, 0xfa, 0x93, 0x8a, 0xc9, 0x84, 0x2c, 0x3d, - 0xa7, 0xeb, 0xf4, 0x1b, 0x41, 0xa1, 0x71, 0x92, 0xdf, 0xf1, 0xd6, 0x90, 0x57, 0xea, 0x3a, 0xfd, - 0xe3, 0xf1, 0xb5, 0xf8, 0xc5, 0x5e, 0xec, 0xad, 0xc5, 0xad, 0x8a, 0x69, 0xba, 0x35, 0x14, 0x14, - 0x2e, 0x88, 0x50, 0x21, 0x0e, 0x17, 0x5e, 0xd9, 0x4e, 0xb2, 0x35, 0x9e, 0x80, 0xbb, 0x51, 0x73, - 0x96, 0x5e, 0xa5, 0xeb, 0xf4, 0xdd, 0x20, 0x17, 0x78, 0x0a, 0x55, 0x49, 0x6a, 0x21, 0xd9, 0x73, - 0x2d, 0xfe, 0x52, 0x78, 0x01, 0x47, 0x61, 0xc6, 0x52, 0xaf, 0xd4, 0x6b, 0xc8, 0x4a, 0x27, 0x5e, - 0xd5, 0x5a, 0xfd, 0x84, 0xbd, 0x0e, 0xd4, 0x77, 0xd3, 0xb1, 0x06, 0xe5, 0xc9, 0xbd, 0xdf, 0x3a, - 0xf8, 0x2c, 0xee, 0x26, 0x7e, 0xcb, 0xe9, 0x0d, 0xe0, 0xd0, 0xae, 0x99, 0x1a, 0x9d, 0xa4, 0x84, - 0x1d, 0x68, 0x14, 0x6f, 0xb0, 0x19, 0x34, 0x83, 0x3d, 0x18, 0xbf, 0x41, 0x6b, 0xba, 0x13, 0x0f, - 0xb4, 0x5a, 0xab, 0x88, 0x50, 0x41, 0xd3, 0x27, 0x2e, 0x30, 0x0e, 0xfe, 0x11, 0x4b, 0xfb, 0xf2, - 0x6f, 0xcd, 0xf9, 0x72, 0x37, 0xb5, 0x47, 0xd7, 0x7e, 0xec, 0xac, 0x6a, 0x8f, 0xab, 0x8f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x54, 0x8e, 0xdc, 0xb1, 0x00, 0x02, 0x00, 0x00, + 0x6d, 0x77, 0xa5, 0x53, 0x08, 0x26, 0x26, 0x7e, 0x74, 0xc3, 0x22, 0x45, 0x4f, 0xea, 0x69, 0xe7, + 0xfd, 0x76, 0xf2, 0x66, 0xf6, 0x2d, 0x9c, 0x99, 0x97, 0xf9, 0xc0, 0x2c, 0x34, 0xeb, 0xc1, 0x72, + 0x38, 0x60, 0x99, 0x27, 0xd3, 0x34, 0x54, 0x71, 0x26, 0x2c, 0xc3, 0xf3, 0x48, 0x27, 0x42, 0xaf, + 0xd2, 0x28, 0xd6, 0xf9, 0x4c, 0xe8, 0x48, 0x65, 0xe2, 0x5b, 0xcf, 0x72, 0xd8, 0xfb, 0x28, 0x01, + 0xf8, 0xc4, 0x01, 0xbd, 0xe6, 0x94, 0x31, 0xb6, 0xa1, 0xfe, 0xac, 0x62, 0x32, 0x21, 0x4b, 0xcf, + 0xe9, 0x3a, 0xfd, 0x46, 0x50, 0x68, 0x1c, 0x6f, 0xef, 0x78, 0x6d, 0xc8, 0x2b, 0x75, 0x9d, 0xfe, + 0xf1, 0xe8, 0x46, 0xfc, 0x62, 0x2f, 0xf6, 0xd6, 0xe2, 0x4e, 0xc5, 0x34, 0x59, 0x1b, 0x0a, 0x0a, + 0x17, 0x44, 0xa8, 0x10, 0x87, 0x73, 0xaf, 0x6c, 0x27, 0xd9, 0x1a, 0x4f, 0xc0, 0x5d, 0xa9, 0x19, + 0x4b, 0xaf, 0xd2, 0x75, 0xfa, 0x6e, 0xb0, 0x15, 0x78, 0x0a, 0x55, 0x49, 0x6a, 0x2e, 0xd9, 0x73, + 0x2d, 0xfe, 0x52, 0x78, 0x01, 0x47, 0x61, 0xce, 0x52, 0x2f, 0xd4, 0x5b, 0xc8, 0x4a, 0xa7, 0x5e, + 0xd5, 0x5a, 0xfd, 0x84, 0xbd, 0x0e, 0xd4, 0x77, 0xd3, 0xb1, 0x06, 0xe5, 0xf1, 0x83, 0xdf, 0x3a, + 0xd8, 0x14, 0xf7, 0x63, 0xbf, 0xe5, 0xf4, 0x7c, 0x38, 0xb4, 0x6b, 0x66, 0x46, 0xa7, 0x19, 0x61, + 0x07, 0x1a, 0xc5, 0x1b, 0x6c, 0x06, 0xcd, 0x60, 0x0f, 0x36, 0x01, 0x25, 0x2a, 0xd9, 0x87, 0xd0, + 0x08, 0x0a, 0x3d, 0x7a, 0x87, 0xd6, 0x64, 0xd7, 0xf8, 0x48, 0x8b, 0xa5, 0x8a, 0x08, 0x15, 0x34, + 0x7d, 0xe2, 0x02, 0xe3, 0xe5, 0x3f, 0x22, 0x6b, 0x5f, 0xfd, 0xad, 0x79, 0xbb, 0xf8, 0x6d, 0xed, + 0xc9, 0xb5, 0x9f, 0x3e, 0xad, 0xda, 0xe3, 0xfa, 0x33, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x29, 0x25, + 0xcc, 0x1c, 0x02, 0x00, 0x00, } diff --git a/pkg/proto/v0/thumbnails.proto b/pkg/proto/v0/thumbnails.proto index 94f2529..261a65b 100644 --- a/pkg/proto/v0/thumbnails.proto +++ b/pkg/proto/v0/thumbnails.proto @@ -22,4 +22,5 @@ message GetRequest { message GetResponse { bytes thumbnail = 1; + string mimetype = 2; } \ No newline at end of file diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index b9a6700..3a2f973 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -55,6 +55,7 @@ func (g Thumbnail) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rs thumbnail := g.manager.GetStored(tCtx) if thumbnail != nil { rsp.Thumbnail = thumbnail + rsp.Mimetype = tCtx.Encoder.MimeType() return nil } @@ -74,5 +75,6 @@ func (g Thumbnail) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rs } rsp.Thumbnail = thumbnail + rsp.Mimetype = tCtx.Encoder.MimeType() return nil } diff --git a/pkg/thumbnails/encoding.go b/pkg/thumbnails/encoding.go index 8deb128..a4d4647 100644 --- a/pkg/thumbnails/encoding.go +++ b/pkg/thumbnails/encoding.go @@ -14,6 +14,8 @@ type Encoder interface { Encode(io.Writer, image.Image) error // Types returns the formats suffixes. Types() []string + // MimeType returns the mimetype used by the encoder. + MimeType() string } // PngEncoder encodes to png @@ -29,6 +31,11 @@ func (e PngEncoder) Types() []string { return []string{"png"} } +// MimeType returns the mimetype for png files. +func (e PngEncoder) MimeType() string { + return "image/png" +} + // JpegEncoder encodes to jpg. type JpegEncoder struct{} @@ -42,6 +49,11 @@ func (e JpegEncoder) Types() []string { return []string{"jpeg", "jpg"} } +// MimeType returns the mimetype for jpg files. +func (e JpegEncoder) MimeType() string { + return "image/jpeg" +} + // EncoderForType returns the encoder for a given file type // or nil if the type is not supported. func EncoderForType(fileType string) Encoder {