From e675eccd509df718dc2fbba9fba1c433d6bc8c40 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Mon, 22 Aug 2022 10:13:57 +0300 Subject: [PATCH 01/21] Update changelog --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95ebe204..6801c2b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Core +### Core v16.9.1 > v16.10.0 + +- Fix wrong path for swagger definition +- Fix process cleanup on delete +- Add process id and reference glob pattern matching +- Fix SRT blocking port on restart (upgrade datarhei/gosrt) +- Fix RTMP communication (datarhei/restreamer#385) +- Fix injecting commit, branch, and build info +- Add cache block list for extensions not to cache + #### Core v16.9.0 > v16.9.1 - Fix v1 import app From 6ee565b3c9f1f1e81d8a123d70f663776cb2fe75 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Fri, 26 Aug 2022 07:56:29 +0300 Subject: [PATCH 02/21] Fix correct output of purge_on_delete value --- http/api/process.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/http/api/process.go b/http/api/process.go index 7ed4eb39..7365e176 100644 --- a/http/api/process.go +++ b/http/api/process.go @@ -175,9 +175,10 @@ func (cfg *ProcessConfig) Unmarshal(c *app.Config) { for _, c := range x.Cleanup { io.Cleanup = append(io.Cleanup, ProcessConfigIOCleanup{ - Pattern: c.Pattern, - MaxFiles: c.MaxFiles, - MaxFileAge: c.MaxFileAge, + Pattern: c.Pattern, + MaxFiles: c.MaxFiles, + MaxFileAge: c.MaxFileAge, + PurgeOnDelete: c.PurgeOnDelete, }) } From f1141d1ad909b3dc823b7b8a5a24d402bf7efd2a Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Fri, 26 Aug 2022 08:17:17 +0300 Subject: [PATCH 03/21] Fix assigning cleanup rules for diskfs --- restream/restream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/restream/restream.go b/restream/restream.go index 50577bc6..e58eaf00 100644 --- a/restream/restream.go +++ b/restream/restream.go @@ -128,7 +128,7 @@ func New(config Config) (Restreamer, error) { if config.DiskFS != nil { r.fs.diskfs = rfs.New(rfs.Config{ FS: config.DiskFS, - Logger: r.logger.WithComponent("DiskFS"), + Logger: r.logger.WithComponent("Cleanup").WithField("type", "diskfs"), }) } else { r.fs.diskfs = rfs.New(rfs.Config{ @@ -139,7 +139,7 @@ func New(config Config) (Restreamer, error) { if config.MemFS != nil { r.fs.memfs = rfs.New(rfs.Config{ FS: config.MemFS, - Logger: r.logger.WithComponent("MemFS"), + Logger: r.logger.WithComponent("Cleanup").WithField("type", "memfs"), }) } else { r.fs.memfs = rfs.New(rfs.Config{ @@ -478,7 +478,7 @@ func (r *restream) setCleanup(id string, config *app.Config) { }, }) } else if strings.HasPrefix(c.Pattern, "diskfs:") { - r.fs.memfs.SetCleanup(id, []rfs.Pattern{ + r.fs.diskfs.SetCleanup(id, []rfs.Pattern{ { Pattern: strings.TrimPrefix(c.Pattern, "diskfs:"), MaxFiles: c.MaxFiles, From 5cb05928548021f3017806c22e197d8345caccf3 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Fri, 26 Aug 2022 11:35:56 +0300 Subject: [PATCH 04/21] Exclude .m3u8 and .mpd files from disk cache by default --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 3af347dc..ef1f3e1a 100644 --- a/config/config.go +++ b/config/config.go @@ -190,7 +190,7 @@ func (d *Config) init() { d.val(newInt64Value(&d.Storage.Disk.Cache.TTL, 300), "storage.disk.cache.ttl_seconds", "CORE_STORAGE_DISK_CACHE_TTLSECONDS", nil, "Seconds to keep files in cache", false, false) d.val(newUint64Value(&d.Storage.Disk.Cache.FileSize, 1), "storage.disk.cache.max_file_size_mbytes", "CORE_STORAGE_DISK_CACHE_MAXFILESIZEMBYTES", nil, "Max. file size to put in cache", false, false) d.val(newStringListValue(&d.Storage.Disk.Cache.Types.Allow, []string{}, " "), "storage.disk.cache.type.allow", "CORE_STORAGE_DISK_CACHE_TYPES_ALLOW", []string{"CORE_STORAGE_DISK_CACHE_TYPES"}, "File extensions to cache, empty for all", false, false) - d.val(newStringListValue(&d.Storage.Disk.Cache.Types.Block, []string{}, " "), "storage.disk.cache.type.block", "CORE_STORAGE_DISK_CACHE_TYPES_BLOCK", nil, "File extensions not to cache, empty for none", false, false) + d.val(newStringListValue(&d.Storage.Disk.Cache.Types.Block, []string{".m3u8", ".mpd"}, " "), "storage.disk.cache.type.block", "CORE_STORAGE_DISK_CACHE_TYPES_BLOCK", nil, "File extensions not to cache, empty for none", false, false) // Storage (Memory) d.val(newBoolValue(&d.Storage.Memory.Auth.Enable, true), "storage.memory.auth.enable", "CORE_STORAGE_MEMORY_AUTH_ENABLE", nil, "Enable basic auth for PUT,POST, and DELETE on /memfs", false, false) From 2d754b4212064b2e8317c6f27fe8982f5d968d82 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Wed, 7 Sep 2022 13:53:26 +0200 Subject: [PATCH 05/21] Log HTTP request and response body sizes --- http/middleware/bodysize/bodysize.go | 65 ------------------ http/middleware/log/log.go | 99 +++++++++++++++++++++------- http/server.go | 2 - 3 files changed, 76 insertions(+), 90 deletions(-) delete mode 100644 http/middleware/bodysize/bodysize.go diff --git a/http/middleware/bodysize/bodysize.go b/http/middleware/bodysize/bodysize.go deleted file mode 100644 index d631d909..00000000 --- a/http/middleware/bodysize/bodysize.go +++ /dev/null @@ -1,65 +0,0 @@ -// Package bodysize is an echo middleware that fixes the final number of body bytes sent on the wire -package bodysize - -import ( - "net/http" - - "github.com/labstack/echo/v4" - "github.com/labstack/echo/v4/middleware" -) - -type Config struct { - Skipper middleware.Skipper -} - -var DefaultConfig = Config{ - Skipper: middleware.DefaultSkipper, -} - -func New() echo.MiddlewareFunc { - return NewWithConfig(DefaultConfig) -} - -// New return a new bodysize middleware handler -func NewWithConfig(config Config) echo.MiddlewareFunc { - if config.Skipper == nil { - config.Skipper = DefaultConfig.Skipper - } - - return func(next echo.HandlerFunc) echo.HandlerFunc { - return func(c echo.Context) error { - if config.Skipper(c) { - return next(c) - } - - res := c.Response() - - writer := res.Writer - w := &fakeWriter{ - ResponseWriter: res.Writer, - } - res.Writer = w - - defer func() { - res.Writer = writer - res.Size = w.size - }() - - return next(c) - } - } -} - -type fakeWriter struct { - http.ResponseWriter - - size int64 -} - -func (w *fakeWriter) Write(body []byte) (int, error) { - n, err := w.ResponseWriter.Write(body) - - w.size += int64(n) - - return n, err -} diff --git a/http/middleware/log/log.go b/http/middleware/log/log.go index 3abf9ee1..ef8eb5ce 100644 --- a/http/middleware/log/log.go +++ b/http/middleware/log/log.go @@ -2,6 +2,7 @@ package log import ( + "io" "net/http" "time" @@ -45,40 +46,92 @@ func NewWithConfig(config Config) echo.MiddlewareFunc { start := time.Now() req := c.Request() + + var reader io.ReadCloser + r := &sizeReadCloser{} + + if req.Body != nil { + reader = req.Body + r.ReadCloser = req.Body + req.Body = r + } + res := c.Response() + writer := res.Writer + w := &sizeWriter{ + ResponseWriter: res.Writer, + } + res.Writer = w + path := req.URL.Path raw := req.URL.RawQuery - if err := next(c); err != nil { - c.Error(err) - } + defer func() { + res.Writer = writer + req.Body = reader - latency := time.Since(start) + latency := time.Since(start) - if raw != "" { - path = path + "?" + raw - } + if raw != "" { + path = path + "?" + raw + } - logger := config.Logger.WithFields(log.Fields{ - "client": c.RealIP(), - "method": req.Method, - "path": path, - "proto": req.Proto, - "status": res.Status, - "status_text": http.StatusText(res.Status), - "size_bytes": res.Size, - "latency_ms": latency.Milliseconds(), - "user_agent": req.Header.Get("User-Agent"), - }) + logger := config.Logger.WithFields(log.Fields{ + "client": c.RealIP(), + "method": req.Method, + "path": path, + "proto": req.Proto, + "status": res.Status, + "status_text": http.StatusText(res.Status), + "tx_size_bytes": w.size, + "rx_size_bytes": r.size, + "latency_ms": latency.Milliseconds(), + "user_agent": req.Header.Get("User-Agent"), + }) - if res.Status >= 400 { - logger.Warn().Log("") - } + if res.Status >= 400 { + logger.Warn().Log("") + } - logger.Debug().Log("") + logger.Debug().Log("") + }() - return nil + return next(c) } } } + +type sizeWriter struct { + http.ResponseWriter + + size int64 +} + +func (w *sizeWriter) Write(body []byte) (int, error) { + n, err := w.ResponseWriter.Write(body) + + w.size += int64(n) + + return n, err +} + +type sizeReadCloser struct { + io.ReadCloser + + size int64 +} + +func (r *sizeReadCloser) Read(p []byte) (int, error) { + n, err := r.ReadCloser.Read(p) + + r.size += int64(n) + + return n, err +} + +func (r *sizeReadCloser) Close() error { + err := r.ReadCloser.Close() + + return err +} diff --git a/http/server.go b/http/server.go index 439df8ab..a3dfcdad 100644 --- a/http/server.go +++ b/http/server.go @@ -51,7 +51,6 @@ import ( "github.com/datarhei/core/v16/session" "github.com/datarhei/core/v16/srt" - mwbodysize "github.com/datarhei/core/v16/http/middleware/bodysize" mwcache "github.com/datarhei/core/v16/http/middleware/cache" mwcors "github.com/datarhei/core/v16/http/middleware/cors" mwgzip "github.com/datarhei/core/v16/http/middleware/gzip" @@ -341,7 +340,6 @@ func NewServer(config Config) (Server, error) { return nil }, })) - s.router.Use(mwbodysize.New()) s.router.Use(mwsession.NewHTTPWithConfig(mwsession.HTTPConfig{ Collector: config.Sessions.Collector("http"), })) From 285ef797168b93cc9bb36a8e4734c6b0bf24f28a Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 8 Sep 2022 13:50:53 +0200 Subject: [PATCH 06/21] Add /v3/metrics (get) endpoint to list all known metrics --- docs/docs.go | 41 +++++++++++++++++++++++++ docs/swagger.json | 41 +++++++++++++++++++++++++ docs/swagger.yaml | 26 ++++++++++++++++ http/api/metrics.go | 6 ++++ http/handler/api/metrics.go | 29 ++++++++++++++++++ http/server.go | 3 +- monitor/cpu.go | 10 +++--- monitor/disk.go | 4 +-- monitor/ffmpeg.go | 2 +- monitor/filesystem.go | 6 ++-- monitor/mem.go | 4 +-- monitor/metric/metric.go | 12 ++++++++ monitor/monitor.go | 61 ++++++++++++++++++++++++++----------- monitor/net.go | 4 +-- monitor/restream.go | 8 ++--- monitor/session.go | 18 +++++------ monitor/uptime.go | 2 +- 17 files changed, 229 insertions(+), 48 deletions(-) diff --git a/docs/docs.go b/docs/docs.go index 9baa93ac..06030b97 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -839,6 +839,30 @@ const docTemplate = `{ } }, "/api/v3/metrics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "List all known metrics with their description and labels", + "produces": [ + "application/json" + ], + "summary": "List all known metrics with their description and labels", + "operationId": "metrics-3-describe", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/api.MetricsDescription" + } + } + } + } + }, "post": { "security": [ { @@ -2926,6 +2950,23 @@ const docTemplate = `{ } } }, + "api.MetricsDescription": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + } + } + }, "api.MetricsQuery": { "type": "object", "properties": { diff --git a/docs/swagger.json b/docs/swagger.json index 35c2db46..9d81a348 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -831,6 +831,30 @@ } }, "/api/v3/metrics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "List all known metrics with their description and labels", + "produces": [ + "application/json" + ], + "summary": "List all known metrics with their description and labels", + "operationId": "metrics-3-describe", + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/api.MetricsDescription" + } + } + } + } + }, "post": { "security": [ { @@ -2918,6 +2942,23 @@ } } }, + "api.MetricsDescription": { + "type": "object", + "properties": { + "description": { + "type": "string" + }, + "labels": { + "type": "array", + "items": { + "type": "string" + } + }, + "name": { + "type": "string" + } + } + }, "api.MetricsQuery": { "type": "object", "properties": { diff --git a/docs/swagger.yaml b/docs/swagger.yaml index c4990b87..4bfe0b0d 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -462,6 +462,17 @@ definitions: - password - username type: object + api.MetricsDescription: + properties: + description: + type: string + labels: + items: + type: string + type: array + name: + type: string + type: object api.MetricsQuery: properties: interval_sec: @@ -2264,6 +2275,21 @@ paths: - ApiKeyAuth: [] summary: Add JSON metadata under the given key /api/v3/metrics: + get: + description: List all known metrics with their description and labels + operationId: metrics-3-describe + produces: + - application/json + responses: + "200": + description: OK + schema: + items: + $ref: '#/definitions/api.MetricsDescription' + type: array + security: + - ApiKeyAuth: [] + summary: List all known metrics with their description and labels post: consumes: - application/json diff --git a/http/api/metrics.go b/http/api/metrics.go index add30c43..49b184f9 100644 --- a/http/api/metrics.go +++ b/http/api/metrics.go @@ -7,6 +7,12 @@ import ( "github.com/datarhei/core/v16/monitor" ) +type MetricsDescription struct { + Name string `json:"name"` + Description string `json:"description"` + Labels []string `json:"labels"` +} + type MetricsQueryMetric struct { Name string `json:"name"` Labels map[string]string `json:"labels"` diff --git a/http/handler/api/metrics.go b/http/handler/api/metrics.go index 03d4fc5b..d1356686 100644 --- a/http/handler/api/metrics.go +++ b/http/handler/api/metrics.go @@ -2,6 +2,7 @@ package api import ( "net/http" + "sort" "time" "github.com/datarhei/core/v16/http/api" @@ -28,6 +29,34 @@ func NewMetrics(config MetricsConfig) *MetricsHandler { } } +// Describe the known metrics +// @Summary List all known metrics with their description and labels +// @Description List all known metrics with their description and labels +// @ID metrics-3-describe +// @Produce json +// @Success 200 {array} api.MetricsDescription +// @Security ApiKeyAuth +// @Router /api/v3/metrics [get] +func (r *MetricsHandler) Describe(c echo.Context) error { + response := []api.MetricsDescription{} + + descriptors := r.metrics.Describe() + + for _, d := range descriptors { + response = append(response, api.MetricsDescription{ + Name: d.Name(), + Description: d.Description(), + Labels: d.Labels(), + }) + } + + sort.Slice(response, func(i, j int) bool { + return response[i].Name < response[j].Name + }) + + return c.JSON(http.StatusOK, response) +} + // Query the collected metrics // @Summary Query the collected metrics // @Description Query the collected metrics diff --git a/http/server.go b/http/server.go index a3dfcdad..4503a7b0 100644 --- a/http/server.go +++ b/http/server.go @@ -640,6 +640,7 @@ func (s *server) setRoutesV3(v3 *echo.Group) { // v3 Log v3.GET("/log", s.v3handler.log.Log) - // v3 Resources + // v3 Metrics + v3.GET("/metrics", s.v3handler.resources.Describe) v3.POST("/metrics", s.v3handler.resources.Metrics) } diff --git a/monitor/cpu.go b/monitor/cpu.go index 4ee4fd89..60b70ba9 100644 --- a/monitor/cpu.go +++ b/monitor/cpu.go @@ -20,11 +20,11 @@ func NewCPUCollector() metric.Collector { ncpu: 1, } - c.ncpuDescr = metric.NewDesc("cpu_ncpu", "", nil) - c.systemDescr = metric.NewDesc("cpu_system", "", nil) - c.userDescr = metric.NewDesc("cpu_user", "", nil) - c.idleDescr = metric.NewDesc("cpu_idle", "", nil) - c.otherDescr = metric.NewDesc("cpu_other", "", nil) + c.ncpuDescr = metric.NewDesc("cpu_ncpu", "Number of logical CPUs in the system", nil) + c.systemDescr = metric.NewDesc("cpu_system", "Percentage of CPU used for the system", nil) + c.userDescr = metric.NewDesc("cpu_user", "Percentage of CPU used for the user", nil) + c.idleDescr = metric.NewDesc("cpu_idle", "Percentage of idle CPU", nil) + c.otherDescr = metric.NewDesc("cpu_other", "Percentage of CPU used for other subsystems", nil) if ncpu, err := psutil.CPUCounts(true); err == nil { c.ncpu = ncpu diff --git a/monitor/disk.go b/monitor/disk.go index 03ce8bf1..7e1ba86d 100644 --- a/monitor/disk.go +++ b/monitor/disk.go @@ -17,8 +17,8 @@ func NewDiskCollector(path string) metric.Collector { path: path, } - c.totalDescr = metric.NewDesc("disk_total", "", []string{"path"}) - c.usageDescr = metric.NewDesc("disk_usage", "", []string{"path"}) + c.totalDescr = metric.NewDesc("disk_total", "Total size of the disk in bytes", []string{"path"}) + c.usageDescr = metric.NewDesc("disk_usage", "Number of used bytes on the disk", []string{"path"}) return c } diff --git a/monitor/ffmpeg.go b/monitor/ffmpeg.go index 2b6edbd1..a447901a 100644 --- a/monitor/ffmpeg.go +++ b/monitor/ffmpeg.go @@ -17,7 +17,7 @@ func NewFFmpegCollector(f ffmpeg.FFmpeg) metric.Collector { ffmpeg: f, } - c.processDescr = metric.NewDesc("ffmpeg_process", "", []string{"state"}) + c.processDescr = metric.NewDesc("ffmpeg_process", "State of the ffmpeg process", []string{"state"}) return c } diff --git a/monitor/filesystem.go b/monitor/filesystem.go index fa40020b..507dcc6f 100644 --- a/monitor/filesystem.go +++ b/monitor/filesystem.go @@ -19,9 +19,9 @@ func NewFilesystemCollector(name string, fs fs.Filesystem) metric.Collector { name: name, } - c.limitDescr = metric.NewDesc("filesystem_limit", "", []string{"name"}) - c.usageDescr = metric.NewDesc("filesystem_usage", "", []string{"name"}) - c.filesDescr = metric.NewDesc("filesystem_files", "", []string{"name"}) + c.limitDescr = metric.NewDesc("filesystem_limit", "Total size of the filesystem in bytes, negative if unlimited", []string{"name"}) + c.usageDescr = metric.NewDesc("filesystem_usage", "Number of used bytes on the filesystem", []string{"name"}) + c.filesDescr = metric.NewDesc("filesystem_files", "Number of files on the filesystem (excluding directories)", []string{"name"}) return c } diff --git a/monitor/mem.go b/monitor/mem.go index 8a6c8958..04fb8465 100644 --- a/monitor/mem.go +++ b/monitor/mem.go @@ -13,8 +13,8 @@ type memCollector struct { func NewMemCollector() metric.Collector { c := &memCollector{} - c.totalDescr = metric.NewDesc("mem_total", "", nil) - c.freeDescr = metric.NewDesc("mem_free", "", nil) + c.totalDescr = metric.NewDesc("mem_total", "Total available memory in bytes", nil) + c.freeDescr = metric.NewDesc("mem_free", "Free memory in bytes", nil) return c } diff --git a/monitor/metric/metric.go b/monitor/metric/metric.go index f1c81f97..a327c6d0 100644 --- a/monitor/metric/metric.go +++ b/monitor/metric/metric.go @@ -4,6 +4,7 @@ import ( "fmt" "regexp" "sort" + "strings" ) type Pattern interface { @@ -304,6 +305,10 @@ func NewDesc(name, description string, labels []string) *Description { } } +func (d *Description) String() string { + return fmt.Sprintf("%s: %s (%s)", d.name, d.description, strings.Join(d.labels, ",")) +} + func (d *Description) Name() string { return d.name } @@ -312,6 +317,13 @@ func (d *Description) Description() string { return d.description } +func (d *Description) Labels() []string { + labels := make([]string, len(d.labels)) + copy(labels, d.labels) + + return labels +} + type Collector interface { Prefix() string Describe() []*Description diff --git a/monitor/monitor.go b/monitor/monitor.go index d4985c98..47631781 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -10,9 +10,26 @@ import ( "github.com/datarhei/core/v16/monitor/metric" ) -type Monitor interface { - Register(c metric.Collector) +type Reader interface { Collect(patterns []metric.Pattern) metric.Metrics + Describe() []*metric.Description +} + +type Monitor interface { + Reader + Register(c metric.Collector) + UnregisterAll() +} + +type HistoryReader interface { + Reader + History(timerange, interval time.Duration, patterns []metric.Pattern) []HistoryMetrics + Resolution() (timerange, interval time.Duration) +} + +type HistoryMonitor interface { + HistoryReader + Register(c metric.Collector) UnregisterAll() } @@ -75,6 +92,26 @@ func (m *monitor) Collect(patterns []metric.Pattern) metric.Metrics { return metrics } +func (m *monitor) Describe() []*metric.Description { + descriptors := []*metric.Description{} + collectors := map[metric.Collector]struct{}{} + + m.lock.RLock() + defer m.lock.RUnlock() + + for _, c := range m.collectors { + if _, ok := collectors[c]; ok { + continue + } + + collectors[c] = struct{}{} + + descriptors = append(descriptors, c.Describe()...) + } + + return descriptors +} + func (m *monitor) UnregisterAll() { m.lock.Lock() defer m.lock.Unlock() @@ -86,12 +123,6 @@ func (m *monitor) UnregisterAll() { m.collectors = make(map[string]metric.Collector) } -type HistoryMonitor interface { - Monitor - History(timerange, interval time.Duration, patterns []metric.Pattern) []HistoryMetrics - Resolution() (timerange, interval time.Duration) -} - type historyMonitor struct { monitor Monitor @@ -209,6 +240,10 @@ func (m *historyMonitor) Collect(patterns []metric.Pattern) metric.Metrics { return m.monitor.Collect(patterns) } +func (m *historyMonitor) Describe() []*metric.Description { + return m.monitor.Describe() +} + func (m *historyMonitor) UnregisterAll() { m.monitor.UnregisterAll() @@ -327,13 +362,3 @@ func (m *historyMonitor) resample(values []HistoryMetrics, timerange, interval t return v } - -type Reader interface { - Collect(patterns []metric.Pattern) metric.Metrics -} - -type HistoryReader interface { - Reader - History(timerange, interval time.Duration, patterns []metric.Pattern) []HistoryMetrics - Resolution() (timerange, interval time.Duration) -} diff --git a/monitor/net.go b/monitor/net.go index 9f97cc86..87b2b8a3 100644 --- a/monitor/net.go +++ b/monitor/net.go @@ -13,8 +13,8 @@ type netCollector struct { func NewNetCollector() metric.Collector { c := &netCollector{} - c.rxDescr = metric.NewDesc("net_rx", "", []string{"interface"}) - c.txDescr = metric.NewDesc("net_tx", "", []string{"interface"}) + c.rxDescr = metric.NewDesc("net_rx", "Number of received bytes", []string{"interface"}) + c.txDescr = metric.NewDesc("net_tx", "Number of transmitted bytes", []string{"interface"}) return c } diff --git a/monitor/restream.go b/monitor/restream.go index 3d61fb3d..cfd069f4 100644 --- a/monitor/restream.go +++ b/monitor/restream.go @@ -22,10 +22,10 @@ func NewRestreamCollector(r restream.Restreamer) metric.Collector { r: r, } - c.restreamProcessDescr = metric.NewDesc("restream_process", "", []string{"processid", "state", "order", "name"}) - c.restreamProcessStatesDescr = metric.NewDesc("restream_process_states", "", []string{"processid", "state"}) - c.restreamProcessIODescr = metric.NewDesc("restream_io", "", []string{"processid", "type", "id", "address", "index", "stream", "media", "name"}) - c.restreamStatesDescr = metric.NewDesc("restream_state", "", []string{"state"}) + c.restreamProcessDescr = metric.NewDesc("restream_process", "Current process values by name", []string{"processid", "state", "order", "name"}) + c.restreamProcessStatesDescr = metric.NewDesc("restream_process_states", "Current process state", []string{"processid", "state"}) + c.restreamProcessIODescr = metric.NewDesc("restream_io", "Current process IO values by name", []string{"processid", "type", "id", "address", "index", "stream", "media", "name"}) + c.restreamStatesDescr = metric.NewDesc("restream_state", "Summarized process states", []string{"state"}) return c } diff --git a/monitor/session.go b/monitor/session.go index d2ac15b9..1447d4d5 100644 --- a/monitor/session.go +++ b/monitor/session.go @@ -31,17 +31,17 @@ func NewSessionCollector(r session.RegistryReader, collectors []string) metric.C c.collectors = r.Collectors() } - c.totalDescr = metric.NewDesc("session_total", "", []string{"collector"}) - c.limitDescr = metric.NewDesc("session_limit", "", []string{"collector"}) - c.activeDescr = metric.NewDesc("session_active", "", []string{"collector"}) - c.rxBytesDescr = metric.NewDesc("session_rxbytes", "", []string{"collector"}) - c.txBytesDescr = metric.NewDesc("session_txbytes", "", []string{"collector"}) + c.totalDescr = metric.NewDesc("session_total", "Total sessions", []string{"collector"}) + c.limitDescr = metric.NewDesc("session_limit", "Max. number of concurrent sessions", []string{"collector"}) + c.activeDescr = metric.NewDesc("session_active", "Number of current sessions", []string{"collector"}) + c.rxBytesDescr = metric.NewDesc("session_rxbytes", "Number of received bytes", []string{"collector"}) + c.txBytesDescr = metric.NewDesc("session_txbytes", "Number of transmitted bytes", []string{"collector"}) - c.rxBitrateDescr = metric.NewDesc("session_rxbitrate", "", []string{"collector"}) - c.txBitrateDescr = metric.NewDesc("session_txbitrate", "", []string{"collector"}) + c.rxBitrateDescr = metric.NewDesc("session_rxbitrate", "Current receiving bitrate in bit per second", []string{"collector"}) + c.txBitrateDescr = metric.NewDesc("session_txbitrate", "Current transmitting bitrate in bit per second", []string{"collector"}) - c.maxTxBitrateDescr = metric.NewDesc("session_maxtxbitrate", "", []string{"collector"}) - c.maxRxBitrateDescr = metric.NewDesc("session_maxrxbitrate", "", []string{"collector"}) + c.maxRxBitrateDescr = metric.NewDesc("session_maxrxbitrate", "Max. allowed receiving bitrate in bit per second", []string{"collector"}) + c.maxTxBitrateDescr = metric.NewDesc("session_maxtxbitrate", "Max. allowed transmitting bitrate in bit per second", []string{"collector"}) return c } diff --git a/monitor/uptime.go b/monitor/uptime.go index 8c65a0e8..b5e89425 100644 --- a/monitor/uptime.go +++ b/monitor/uptime.go @@ -16,7 +16,7 @@ func NewUptimeCollector() metric.Collector { t: time.Now(), } - c.uptimeDescr = metric.NewDesc("uptime_uptime", "", nil) + c.uptimeDescr = metric.NewDesc("uptime_uptime", "Current uptime in seconds", nil) return c } From ed36f45f5f383fedc5a373ae0b5b4aa26d2f470c Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 8 Sep 2022 14:54:48 +0200 Subject: [PATCH 07/21] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6801c2b9..80250a2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ### Core v16.9.1 > v16.10.0 +- Add /v3/metrics (get) endpoint to list all known metrics +- Add logging HTTP request and response body sizes +- Exclude .m3u8 and .mpd files from disk cache by default +- Fix assigning cleanup rules for diskfs - Fix wrong path for swagger definition - Fix process cleanup on delete - Add process id and reference glob pattern matching From f1d71c202b2a2020a9863d1b3ae38da9df8aeb5a Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 8 Sep 2022 15:00:09 +0200 Subject: [PATCH 08/21] Fix HLS streaming and cleanup on diskfs --- CHANGELOG.md | 3 +- http/handler/api/diskfs.go | 12 +- http/middleware/hlsrewrite/hlsrewrite.go | 164 +++++++++++++++++++++++ http/middleware/session/HLS.go | 2 +- http/server.go | 10 ++ io/fs/disk.go | 9 ++ restream/fs/fs.go | 98 ++++++++------ 7 files changed, 248 insertions(+), 50 deletions(-) create mode 100644 http/middleware/hlsrewrite/hlsrewrite.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 80250a2f..d74ecdd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,12 +2,13 @@ ### Core v16.9.1 > v16.10.0 +- Add HLS session middleware to diskfs - Add /v3/metrics (get) endpoint to list all known metrics - Add logging HTTP request and response body sizes - Exclude .m3u8 and .mpd files from disk cache by default - Fix assigning cleanup rules for diskfs - Fix wrong path for swagger definition -- Fix process cleanup on delete +- Fix process cleanup on delete, remove empty directories from disk - Add process id and reference glob pattern matching - Fix SRT blocking port on restart (upgrade datarhei/gosrt) - Fix RTMP communication (datarhei/restreamer#385) diff --git a/http/handler/api/diskfs.go b/http/handler/api/diskfs.go index c143619d..b4bc7fb7 100644 --- a/http/handler/api/diskfs.go +++ b/http/handler/api/diskfs.go @@ -193,14 +193,18 @@ func (h *DiskFSHandler) ListFiles(c echo.Context) error { sort.Slice(files, sortFunc) - var fileinfos []api.FileInfo = make([]api.FileInfo, len(files)) + fileinfos := []api.FileInfo{} - for i, f := range files { - fileinfos[i] = api.FileInfo{ + for _, f := range files { + if f.IsDir() { + continue + } + + fileinfos = append(fileinfos, api.FileInfo{ Name: f.Name(), Size: f.Size(), LastMod: f.ModTime().Unix(), - } + }) } return c.JSON(http.StatusOK, fileinfos) diff --git a/http/middleware/hlsrewrite/hlsrewrite.go b/http/middleware/hlsrewrite/hlsrewrite.go new file mode 100644 index 00000000..674228bf --- /dev/null +++ b/http/middleware/hlsrewrite/hlsrewrite.go @@ -0,0 +1,164 @@ +package hlsrewrite + +import ( + "bufio" + "bytes" + "net/http" + "strings" + + "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" +) + +type HLSRewriteConfig struct { + // Skipper defines a function to skip middleware. + Skipper middleware.Skipper + PathPrefix string +} + +var DefaultHLSRewriteConfig = HLSRewriteConfig{ + Skipper: func(c echo.Context) bool { + req := c.Request() + + return !strings.HasSuffix(req.URL.Path, ".m3u8") + }, + PathPrefix: "", +} + +// NewHTTP returns a new HTTP session middleware with default config +func NewHLSRewrite() echo.MiddlewareFunc { + return NewHLSRewriteWithConfig(DefaultHLSRewriteConfig) +} + +type hlsrewrite struct { + pathPrefix string +} + +func NewHLSRewriteWithConfig(config HLSRewriteConfig) echo.MiddlewareFunc { + if config.Skipper == nil { + config.Skipper = DefaultHLSRewriteConfig.Skipper + } + + pathPrefix := config.PathPrefix + if len(pathPrefix) != 0 { + if !strings.HasSuffix(pathPrefix, "/") { + pathPrefix += "/" + } + } + + hls := hlsrewrite{ + pathPrefix: pathPrefix, + } + + return func(next echo.HandlerFunc) echo.HandlerFunc { + return func(c echo.Context) error { + if config.Skipper(c) { + return next(c) + } + + req := c.Request() + + if req.Method == "GET" || req.Method == "HEAD" { + return hls.rewrite(c, next) + } + + return next(c) + } + } +} + +func (h *hlsrewrite) rewrite(c echo.Context, next echo.HandlerFunc) error { + req := c.Request() + res := c.Response() + + path := req.URL.Path + + isM3U8 := strings.HasSuffix(path, ".m3u8") + + rewrite := false + + if isM3U8 { + rewrite = true + } + + var rewriter *hlsRewriter + + // Keep the current writer for later + writer := res.Writer + + if rewrite { + // Put the session rewriter in the middle. This will collect + // the data that we need to rewrite. + rewriter = &hlsRewriter{ + ResponseWriter: res.Writer, + } + + res.Writer = rewriter + } + + if err := next(c); err != nil { + c.Error(err) + } + + // Restore the original writer + res.Writer = writer + + if rewrite { + if res.Status != 200 { + res.Write(rewriter.buffer.Bytes()) + return nil + } + + // Rewrite the data befor sending it to the client + rewriter.rewrite(h.pathPrefix) + + res.Header().Set("Cache-Control", "private") + res.Write(rewriter.buffer.Bytes()) + } + + return nil +} + +type hlsRewriter struct { + http.ResponseWriter + buffer bytes.Buffer +} + +func (g *hlsRewriter) Write(data []byte) (int, error) { + // Write the data into internal buffer for later rewrite + w, err := g.buffer.Write(data) + + return w, err +} + +func (g *hlsRewriter) rewrite(pathPrefix string) { + var buffer bytes.Buffer + + // Find all URLS in the .m3u8 and add the session ID to the query string + scanner := bufio.NewScanner(&g.buffer) + for scanner.Scan() { + line := scanner.Text() + + // Write empty lines unmodified + if len(line) == 0 { + buffer.WriteString(line + "\n") + continue + } + + // Write comments unmodified + if strings.HasPrefix(line, "#") { + buffer.WriteString(line + "\n") + continue + } + + // Rewrite + line = strings.TrimPrefix(line, pathPrefix) + buffer.WriteString(line + "\n") + } + + if err := scanner.Err(); err != nil { + return + } + + g.buffer = buffer +} diff --git a/http/middleware/session/HLS.go b/http/middleware/session/HLS.go index 3de73be4..cb0768ca 100644 --- a/http/middleware/session/HLS.go +++ b/http/middleware/session/HLS.go @@ -51,7 +51,7 @@ type hls struct { // NewHLS returns a new HLS session middleware func NewHLSWithConfig(config HLSConfig) echo.MiddlewareFunc { if config.Skipper == nil { - config.Skipper = DefaultHTTPConfig.Skipper + config.Skipper = DefaultHLSConfig.Skipper } if config.EgressCollector == nil { diff --git a/http/server.go b/http/server.go index 4503a7b0..00ce8896 100644 --- a/http/server.go +++ b/http/server.go @@ -54,6 +54,7 @@ import ( mwcache "github.com/datarhei/core/v16/http/middleware/cache" mwcors "github.com/datarhei/core/v16/http/middleware/cors" mwgzip "github.com/datarhei/core/v16/http/middleware/gzip" + mwhlsrewrite "github.com/datarhei/core/v16/http/middleware/hlsrewrite" mwiplimit "github.com/datarhei/core/v16/http/middleware/iplimit" mwlog "github.com/datarhei/core/v16/http/middleware/log" mwmime "github.com/datarhei/core/v16/http/middleware/mime" @@ -144,6 +145,7 @@ type server struct { cors echo.MiddlewareFunc cache echo.MiddlewareFunc session echo.MiddlewareFunc + hlsrewrite echo.MiddlewareFunc } memfs struct { @@ -184,6 +186,10 @@ func NewServer(config Config) (Server, error) { config.Cache, ) + s.middleware.hlsrewrite = mwhlsrewrite.NewHLSRewriteWithConfig(mwhlsrewrite.HLSRewriteConfig{ + PathPrefix: config.DiskFS.Base(), + }) + s.memfs.enableAuth = config.MemFS.EnableAuth s.memfs.username = config.MemFS.Username s.memfs.password = config.MemFS.Password @@ -445,6 +451,10 @@ func (s *server) setRoutes() { if s.middleware.cache != nil { fs.Use(s.middleware.cache) } + fs.Use(s.middleware.hlsrewrite) + if s.middleware.session != nil { + fs.Use(s.middleware.session) + } fs.GET("", s.handler.diskfs.GetFile) fs.HEAD("", s.handler.diskfs.GetFile) diff --git a/io/fs/disk.go b/io/fs/disk.go index 6d4c09ab..bf9e1843 100644 --- a/io/fs/disk.go +++ b/io/fs/disk.go @@ -291,11 +291,19 @@ func (fs *diskFilesystem) List(pattern string) []FileInfo { files := []FileInfo{} fs.walk(func(path string, info os.FileInfo) { + if path == fs.dir { + return + } + name := strings.TrimPrefix(path, fs.dir) if name[0] != os.PathSeparator { name = string(os.PathSeparator) + name } + if info.IsDir() { + name += "/" + } + if len(pattern) != 0 { if ok, _ := glob.Match(pattern, name, '/'); !ok { return @@ -319,6 +327,7 @@ func (fs *diskFilesystem) walk(walkfn func(path string, info os.FileInfo)) { } if info.IsDir() { + walkfn(path, info) return nil } diff --git a/restream/fs/fs.go b/restream/fs/fs.go index 4769597f..29216aa9 100644 --- a/restream/fs/fs.go +++ b/restream/fs/fs.go @@ -53,52 +53,52 @@ type filesystem struct { } func New(config Config) Filesystem { - fs := &filesystem{ + rfs := &filesystem{ Filesystem: config.FS, logger: config.Logger, } - if fs.logger == nil { - fs.logger = log.New("") + if rfs.logger == nil { + rfs.logger = log.New("") } - fs.cleanupPatterns = make(map[string][]Pattern) + rfs.cleanupPatterns = make(map[string][]Pattern) // already drain the stop - fs.stopOnce.Do(func() {}) + rfs.stopOnce.Do(func() {}) - return fs + return rfs } -func (fs *filesystem) Start() { - fs.startOnce.Do(func() { +func (rfs *filesystem) Start() { + rfs.startOnce.Do(func() { ctx, cancel := context.WithCancel(context.Background()) - fs.stopTicker = cancel - go fs.cleanupTicker(ctx, time.Second) + rfs.stopTicker = cancel + go rfs.cleanupTicker(ctx, time.Second) - fs.stopOnce = sync.Once{} + rfs.stopOnce = sync.Once{} - fs.logger.Debug().Log("Starting cleanup") + rfs.logger.Debug().Log("Starting cleanup") }) } -func (fs *filesystem) Stop() { - fs.stopOnce.Do(func() { - fs.stopTicker() +func (rfs *filesystem) Stop() { + rfs.stopOnce.Do(func() { + rfs.stopTicker() - fs.startOnce = sync.Once{} + rfs.startOnce = sync.Once{} - fs.logger.Debug().Log("Stopping cleanup") + rfs.logger.Debug().Log("Stopping cleanup") }) } -func (fs *filesystem) SetCleanup(id string, patterns []Pattern) { +func (rfs *filesystem) SetCleanup(id string, patterns []Pattern) { if len(patterns) == 0 { return } for _, p := range patterns { - fs.logger.Debug().WithFields(log.Fields{ + rfs.logger.Debug().WithFields(log.Fields{ "id": id, "pattern": p.Pattern, "max_files": p.MaxFiles, @@ -106,38 +106,47 @@ func (fs *filesystem) SetCleanup(id string, patterns []Pattern) { }).Log("Add pattern") } - fs.cleanupLock.Lock() - defer fs.cleanupLock.Unlock() + rfs.cleanupLock.Lock() + defer rfs.cleanupLock.Unlock() - fs.cleanupPatterns[id] = append(fs.cleanupPatterns[id], patterns...) + rfs.cleanupPatterns[id] = append(rfs.cleanupPatterns[id], patterns...) } -func (fs *filesystem) UnsetCleanup(id string) { - fs.logger.Debug().WithField("id", id).Log("Remove pattern group") +func (rfs *filesystem) UnsetCleanup(id string) { + rfs.logger.Debug().WithField("id", id).Log("Remove pattern group") - fs.cleanupLock.Lock() - defer fs.cleanupLock.Unlock() + rfs.cleanupLock.Lock() + defer rfs.cleanupLock.Unlock() - patterns := fs.cleanupPatterns[id] - delete(fs.cleanupPatterns, id) + patterns := rfs.cleanupPatterns[id] + delete(rfs.cleanupPatterns, id) - fs.purge(patterns) + rfs.purge(patterns) } -func (fs *filesystem) cleanup() { - fs.cleanupLock.RLock() - defer fs.cleanupLock.RUnlock() +func (rfs *filesystem) cleanup() { + rfs.cleanupLock.RLock() + defer rfs.cleanupLock.RUnlock() - for _, patterns := range fs.cleanupPatterns { + for _, patterns := range rfs.cleanupPatterns { for _, pattern := range patterns { - files := fs.Filesystem.List(pattern.Pattern) + filesAndDirs := rfs.Filesystem.List(pattern.Pattern) + + files := []fs.FileInfo{} + for _, f := range filesAndDirs { + if f.IsDir() { + continue + } + + files = append(files, f) + } sort.Slice(files, func(i, j int) bool { return files[i].ModTime().Before(files[j].ModTime()) }) if pattern.MaxFiles > 0 && uint(len(files)) > pattern.MaxFiles { for i := uint(0); i < uint(len(files))-pattern.MaxFiles; i++ { - fs.logger.Debug().WithField("path", files[i].Name()).Log("Remove file because MaxFiles is exceeded") - fs.Filesystem.Delete(files[i].Name()) + rfs.logger.Debug().WithField("path", files[i].Name()).Log("Remove file because MaxFiles is exceeded") + rfs.Filesystem.Delete(files[i].Name()) } } @@ -146,8 +155,8 @@ func (fs *filesystem) cleanup() { for _, f := range files { if f.ModTime().Before(bestBefore) { - fs.logger.Debug().WithField("path", f.Name()).Log("Remove file because MaxFileAge is exceeded") - fs.Filesystem.Delete(f.Name()) + rfs.logger.Debug().WithField("path", f.Name()).Log("Remove file because MaxFileAge is exceeded") + rfs.Filesystem.Delete(f.Name()) } } } @@ -155,16 +164,17 @@ func (fs *filesystem) cleanup() { } } -func (fs *filesystem) purge(patterns []Pattern) (nfiles uint64) { +func (rfs *filesystem) purge(patterns []Pattern) (nfiles uint64) { for _, pattern := range patterns { if !pattern.PurgeOnDelete { continue } - files := fs.Filesystem.List(pattern.Pattern) + files := rfs.Filesystem.List(pattern.Pattern) + sort.Slice(files, func(i, j int) bool { return len(files[i].Name()) > len(files[j].Name()) }) for _, f := range files { - fs.logger.Debug().WithField("path", f.Name()).Log("Purging file") - fs.Filesystem.Delete(f.Name()) + rfs.logger.Debug().WithField("path", f.Name()).Log("Purging file") + rfs.Filesystem.Delete(f.Name()) nfiles++ } } @@ -172,7 +182,7 @@ func (fs *filesystem) purge(patterns []Pattern) (nfiles uint64) { return } -func (fs *filesystem) cleanupTicker(ctx context.Context, interval time.Duration) { +func (rfs *filesystem) cleanupTicker(ctx context.Context, interval time.Duration) { ticker := time.NewTicker(interval) defer ticker.Stop() @@ -181,7 +191,7 @@ func (fs *filesystem) cleanupTicker(ctx context.Context, interval time.Duration) case <-ctx.Done(): return case <-ticker.C: - fs.cleanup() + rfs.cleanup() } } } From c522de043d8376f5d104e0d44be4ec28fa8d6a82 Mon Sep 17 00:00:00 2001 From: Ingo Oppermann Date: Thu, 8 Sep 2022 15:39:56 +0200 Subject: [PATCH 09/21] Upgrade dependencies --- go.mod | 44 +- go.sum | 82 +- vendor/github.com/99designs/gqlgen/.gitignore | 1 + .../github.com/99designs/gqlgen/CHANGELOG.md | 152 +- vendor/github.com/99designs/gqlgen/README.md | 1 + .../99designs/gqlgen/codegen/config/binder.go | 1 - .../99designs/gqlgen/codegen/config/config.go | 8 +- .../99designs/gqlgen/codegen/field.go | 2 +- .../gqlgen/codegen/templates/templates.go | 219 +- .../99designs/gqlgen/graphql/errcode/codes.go | 9 +- .../99designs/gqlgen/graphql/error.go | 3 +- .../gqlgen/graphql/executor/executor.go | 21 +- .../gqlgen/graphql/handler/server.go | 3 +- .../gqlgen/graphql/playground/playground.go | 41 +- .../99designs/gqlgen/graphql/version.go | 2 +- .../99designs/gqlgen/internal/code/imports.go | 25 +- .../plugin/federation/fieldset/fieldset.go | 12 - .../gqlgen/plugin/modelgen/models.go | 256 +- .../gqlgen/plugin/modelgen/models.gotpl | 48 +- .../gqlgen/plugin/resolvergen/resolver.go | 2 +- vendor/github.com/99designs/gqlgen/tools.go | 8 - vendor/github.com/go-openapi/spec/.travis.yml | 31 - .../github.com/go-openapi/spec/normalizer.go | 11 +- .../go-openapi/spec/normalizer_nonwindows.go | 3 +- .../go-openapi/spec/normalizer_windows.go | 4 +- vendor/github.com/go-openapi/spec/schema.go | 3 +- vendor/github.com/go-openapi/spec/url_go18.go | 8 + vendor/github.com/go-openapi/spec/url_go19.go | 14 + .../github.com/go-openapi/swag/.golangci.yml | 4 + vendor/github.com/go-openapi/swag/doc.go | 15 +- vendor/github.com/go-openapi/swag/loading.go | 11 +- vendor/github.com/go-openapi/swag/util.go | 17 +- vendor/github.com/go-openapi/swag/yaml.go | 254 +- .../github.com/labstack/echo/v4/CHANGELOG.md | 43 + vendor/github.com/labstack/echo/v4/Makefile | 6 +- vendor/github.com/labstack/echo/v4/README.md | 19 +- vendor/github.com/labstack/echo/v4/binder.go | 197 +- .../github.com/labstack/echo/v4/context_fs.go | 42 +- .../labstack/echo/v4/context_fs_go1.16.go | 52 - vendor/github.com/labstack/echo/v4/echo.go | 20 +- vendor/github.com/labstack/echo/v4/echo_fs.go | 183 +- .../labstack/echo/v4/echo_fs_go1.16.go | 169 - vendor/github.com/labstack/echo/v4/group.go | 7 + .../github.com/labstack/echo/v4/group_fs.go | 31 +- .../labstack/echo/v4/group_fs_go1.16.go | 33 - .../labstack/echo/v4/middleware/basic_auth.go | 6 +- .../labstack/echo/v4/middleware/csrf.go | 18 +- .../labstack/echo/v4/middleware/logger.go | 8 + .../echo/v4/middleware/request_logger.go | 6 +- .../labstack/echo/v4/middleware/static.go | 5 +- vendor/github.com/labstack/echo/v4/router.go | 323 +- vendor/github.com/matryer/moq/.gitignore | 30 - vendor/github.com/matryer/moq/.goreleaser.yml | 34 - vendor/github.com/matryer/moq/LICENSE | 21 - vendor/github.com/matryer/moq/README.md | 135 - .../moq/internal/registry/method_scope.go | 135 - .../matryer/moq/internal/registry/package.go | 93 - .../matryer/moq/internal/registry/registry.go | 190 - .../matryer/moq/internal/registry/var.go | 146 - .../matryer/moq/internal/template/template.go | 190 - .../moq/internal/template/template_data.go | 125 - vendor/github.com/matryer/moq/main.go | 109 - .../github.com/matryer/moq/moq-logo-small.png | Bin 32570 -> 0 bytes vendor/github.com/matryer/moq/moq-logo.png | Bin 29562 -> 0 bytes .../matryer/moq/pkg/moq/formatter.go | 31 - vendor/github.com/matryer/moq/pkg/moq/moq.go | 171 - vendor/github.com/matryer/moq/preview.png | Bin 743543 -> 0 bytes vendor/github.com/matryer/moq/releasing.md | 36 - .../client_golang/prometheus/collector.go | 6 +- .../client_golang/prometheus/counter.go | 2 +- .../client_golang/prometheus/desc.go | 5 +- .../client_golang/prometheus/get_pid.go | 26 + .../prometheus/get_pid_gopherjs.go | 23 + .../client_golang/prometheus/go_collector.go | 12 +- .../prometheus/go_collector_latest.go | 249 +- .../client_golang/prometheus/histogram.go | 2 +- .../prometheus/internal/difflib.go | 651 ++ .../internal/go_collector_options.go | 32 + .../prometheus/internal/go_runtime_metrics.go | 4 +- .../prometheus/internal/metric.go | 28 +- .../client_golang/prometheus/labels.go | 6 +- .../client_golang/prometheus/metric.go | 112 +- .../client_golang/prometheus/num_threads.go | 25 + .../prometheus/num_threads_gopherjs.go | 22 + .../client_golang/prometheus/observer.go | 2 +- .../prometheus/process_collector.go | 10 +- .../prometheus/process_collector_js.go | 26 + .../prometheus/process_collector_other.go | 4 +- .../prometheus/promhttp/delegator.go | 18 +- .../client_golang/prometheus/promhttp/http.go | 20 +- .../prometheus/promhttp/instrument_client.go | 39 +- .../prometheus/promhttp/instrument_server.go | 119 +- .../prometheus/promhttp/option.go | 39 +- .../client_golang/prometheus/registry.go | 118 +- .../client_golang/prometheus/value.go | 47 +- .../client_golang/prometheus/vec.go | 88 +- .../client_golang/prometheus/wrap.go | 4 +- .../github.com/prometheus/procfs/.gitignore | 3 +- .../prometheus/procfs/.golangci.yml | 10 +- .../prometheus/procfs/CODE_OF_CONDUCT.md | 4 +- .../prometheus/procfs/CONTRIBUTING.md | 4 +- vendor/github.com/prometheus/procfs/Makefile | 10 +- .../prometheus/procfs/Makefile.common | 89 +- .../github.com/prometheus/procfs/SECURITY.md | 2 +- vendor/github.com/prometheus/procfs/arp.go | 45 +- .../github.com/prometheus/procfs/cpuinfo.go | 5 +- .../prometheus/procfs/cpuinfo_armx.go | 1 + .../prometheus/procfs/cpuinfo_mipsx.go | 1 + .../prometheus/procfs/cpuinfo_others.go | 4 +- .../prometheus/procfs/cpuinfo_ppcx.go | 1 + .../prometheus/procfs/cpuinfo_riscvx.go | 1 + .../prometheus/procfs/cpuinfo_s390x.go | 1 + .../prometheus/procfs/cpuinfo_x86.go | 1 + .../prometheus/procfs/fixtures.ttar | 7673 ----------------- .../prometheus/procfs/internal/fs/fs.go | 2 +- .../prometheus/procfs/internal/util/parse.go | 6 +- .../procfs/internal/util/readfile.go | 11 +- .../procfs/internal/util/sysreadfile.go | 8 +- .../internal/util/sysreadfile_compat.go | 3 +- vendor/github.com/prometheus/procfs/ipvs.go | 3 +- .../prometheus/procfs/kernel_random.go | 1 + .../github.com/prometheus/procfs/loadavg.go | 2 +- vendor/github.com/prometheus/procfs/mdstat.go | 10 +- .../prometheus/procfs/net_conntrackstat.go | 12 +- .../github.com/prometheus/procfs/net_dev.go | 8 +- .../prometheus/procfs/net_ip_socket.go | 2 +- .../prometheus/procfs/net_protocols.go | 4 +- .../prometheus/procfs/net_softnet.go | 8 +- .../procfs/{xfrm.go => net_xfrm.go} | 9 +- .../github.com/prometheus/procfs/netstat.go | 8 +- vendor/github.com/prometheus/procfs/proc.go | 10 +- .../prometheus/procfs/proc_cgroup.go | 6 +- .../prometheus/procfs/proc_cgroups.go | 98 + .../prometheus/procfs/proc_environ.go | 2 +- .../prometheus/procfs/proc_fdinfo.go | 3 +- .../prometheus/procfs/proc_limits.go | 2 +- .../github.com/prometheus/procfs/proc_maps.go | 12 +- .../prometheus/procfs/proc_netstat.go | 440 + .../github.com/prometheus/procfs/proc_psi.go | 14 +- .../prometheus/procfs/proc_smaps.go | 23 +- .../github.com/prometheus/procfs/proc_snmp.go | 353 + .../prometheus/procfs/proc_snmp6.go | 381 + .../github.com/prometheus/procfs/proc_stat.go | 11 +- .../prometheus/procfs/proc_status.go | 32 +- .../github.com/prometheus/procfs/proc_sys.go | 51 + .../github.com/prometheus/procfs/schedstat.go | 6 +- vendor/github.com/prometheus/procfs/slab.go | 2 +- .../github.com/prometheus/procfs/softirqs.go | 160 + vendor/github.com/prometheus/procfs/stat.go | 10 +- vendor/github.com/prometheus/procfs/vm.go | 6 +- .../github.com/prometheus/procfs/zoneinfo.go | 5 +- .../github.com/shirou/gopsutil/v3/cpu/cpu.go | 21 +- .../shirou/gopsutil/v3/disk/iostat_darwin.c | 4 +- .../shirou/gopsutil/v3/disk/iostat_darwin.h | 4 - .../gopsutil/v3/internal/common/common.go | 9 + .../v3/internal/common/common_linux.go | 6 + .../gopsutil/v3/internal/common/endian.go | 10 + .../shirou/gopsutil/v3/mem/mem_darwin_cgo.go | 5 +- .../shirou/gopsutil/v3/net/net_linux.go | 8 +- .../gopsutil/v3/process/process_darwin_386.go | 236 - .../gopsutil/v3/process/process_linux.go | 6 +- .../testify/assert/assertion_format.go | 10 + .../testify/assert/assertion_forward.go | 20 + .../stretchr/testify/assert/assertions.go | 71 +- .../stretchr/testify/require/require.go | 26 + .../testify/require/require_forward.go | 20 + .../github.com/swaggo/echo-swagger/swagger.go | 1 - vendor/github.com/swaggo/files/filebox.go | 12 + vendor/github.com/swaggo/swag/.goreleaser.yml | 2 + vendor/github.com/swaggo/swag/README.md | 32 +- vendor/github.com/swaggo/swag/README_zh-CN.md | 6 + vendor/github.com/swaggo/swag/field_parser.go | 13 +- vendor/github.com/swaggo/swag/formatter.go | 2 +- vendor/github.com/swaggo/swag/generics.go | 243 +- .../github.com/swaggo/swag/generics_other.go | 11 +- vendor/github.com/swaggo/swag/operation.go | 10 +- vendor/github.com/swaggo/swag/packages.go | 61 +- vendor/github.com/swaggo/swag/parser.go | 43 +- vendor/github.com/swaggo/swag/schema.go | 47 +- vendor/github.com/swaggo/swag/swagger.go | 9 + vendor/github.com/swaggo/swag/types.go | 11 +- vendor/github.com/swaggo/swag/version.go | 2 +- .../vektah/gqlparser/v2/ast/decode.go | 216 + .../vektah/gqlparser/v2/gqlparser.go | 5 +- .../vektah/gqlparser/v2/lexer/lexer.go | 25 +- .../vektah/gqlparser/v2/lexer/lexer_test.yml | 20 + .../vektah/gqlparser/v2/parser/parser.go | 4 +- .../vektah/gqlparser/v2/parser/query.go | 3 +- .../vektah/gqlparser/v2/parser/schema.go | 5 +- .../gqlparser/v2/parser/schema_test.yml | 2 +- .../vektah/gqlparser/v2/validator/schema.go | 4 +- .../vektah/gqlparser/v2/validator/vars.go | 2 +- vendor/golang.org/x/crypto/acme/acme.go | 6 +- vendor/golang.org/x/net/AUTHORS | 3 - vendor/golang.org/x/net/CONTRIBUTORS | 3 - vendor/golang.org/x/net/http2/frame.go | 22 +- vendor/golang.org/x/net/http2/hpack/encode.go | 2 +- vendor/golang.org/x/net/http2/hpack/hpack.go | 16 +- vendor/golang.org/x/net/http2/http2.go | 8 +- vendor/golang.org/x/net/http2/server.go | 12 + vendor/golang.org/x/net/http2/transport.go | 51 +- vendor/golang.org/x/sys/AUTHORS | 3 - vendor/golang.org/x/sys/CONTRIBUTORS | 3 - vendor/golang.org/x/sys/cpu/cpu_arm64.go | 12 +- .../golang.org/x/sys/cpu/cpu_openbsd_arm64.go | 65 + .../golang.org/x/sys/cpu/cpu_openbsd_arm64.s | 11 + .../golang.org/x/sys/cpu/cpu_other_arm64.go | 4 +- .../golang.org/x/sys/unix/asm_bsd_riscv64.s | 29 + vendor/golang.org/x/sys/unix/ioctl_linux.go | 20 +- vendor/golang.org/x/sys/unix/mkall.sh | 27 +- vendor/golang.org/x/sys/unix/mkerrors.sh | 7 +- vendor/golang.org/x/sys/unix/str.go | 27 - vendor/golang.org/x/sys/unix/syscall_aix.go | 57 +- vendor/golang.org/x/sys/unix/syscall_bsd.go | 2 +- .../x/sys/unix/syscall_freebsd_386.go | 2 +- .../x/sys/unix/syscall_freebsd_amd64.go | 2 +- .../x/sys/unix/syscall_freebsd_arm.go | 2 +- .../x/sys/unix/syscall_freebsd_arm64.go | 2 +- .../x/sys/unix/syscall_freebsd_riscv64.go | 63 + vendor/golang.org/x/sys/unix/syscall_linux.go | 32 +- .../x/sys/unix/syscall_linux_386.go | 4 - .../x/sys/unix/syscall_linux_amd64.go | 4 - .../x/sys/unix/syscall_linux_arm.go | 4 - .../x/sys/unix/syscall_linux_arm64.go | 4 - .../x/sys/unix/syscall_linux_loong64.go | 4 - .../x/sys/unix/syscall_linux_mips64x.go | 4 - .../x/sys/unix/syscall_linux_mipsx.go | 4 - .../x/sys/unix/syscall_linux_ppc.go | 4 - .../x/sys/unix/syscall_linux_ppc64x.go | 4 - .../x/sys/unix/syscall_linux_riscv64.go | 4 - .../x/sys/unix/syscall_linux_s390x.go | 4 - .../x/sys/unix/syscall_linux_sparc64.go | 4 - .../x/sys/unix/syscall_openbsd_libc.go | 27 + .../golang.org/x/sys/unix/syscall_solaris.go | 2 +- .../x/sys/unix/zerrors_freebsd_riscv64.go | 2148 +++++ vendor/golang.org/x/sys/unix/zerrors_linux.go | 350 + .../x/sys/unix/zerrors_linux_386.go | 4 +- .../x/sys/unix/zerrors_linux_amd64.go | 4 +- .../x/sys/unix/zerrors_linux_arm.go | 4 +- .../x/sys/unix/zerrors_linux_arm64.go | 4 +- .../x/sys/unix/zerrors_linux_loong64.go | 4 +- .../x/sys/unix/zerrors_linux_mips.go | 4 +- .../x/sys/unix/zerrors_linux_mips64.go | 4 +- .../x/sys/unix/zerrors_linux_mips64le.go | 4 +- .../x/sys/unix/zerrors_linux_mipsle.go | 4 +- .../x/sys/unix/zerrors_linux_ppc.go | 4 +- .../x/sys/unix/zerrors_linux_ppc64.go | 4 +- .../x/sys/unix/zerrors_linux_ppc64le.go | 4 +- .../x/sys/unix/zerrors_linux_riscv64.go | 4 +- .../x/sys/unix/zerrors_linux_s390x.go | 4 +- .../x/sys/unix/zerrors_linux_sparc64.go | 4 +- .../x/sys/unix/zsyscall_darwin_amd64.1_13.s | 2 +- .../x/sys/unix/zsyscall_darwin_amd64.s | 2 +- .../x/sys/unix/zsyscall_darwin_arm64.1_13.s | 2 +- .../x/sys/unix/zsyscall_darwin_arm64.s | 2 +- .../x/sys/unix/zsyscall_freebsd_riscv64.go | 1889 ++++ .../x/sys/unix/zsyscall_linux_386.go | 40 - .../x/sys/unix/zsyscall_linux_amd64.go | 40 - .../x/sys/unix/zsyscall_linux_arm.go | 40 - .../x/sys/unix/zsyscall_linux_arm64.go | 40 - .../x/sys/unix/zsyscall_linux_loong64.go | 40 - .../x/sys/unix/zsyscall_linux_mips.go | 40 - .../x/sys/unix/zsyscall_linux_mips64.go | 40 - .../x/sys/unix/zsyscall_linux_mips64le.go | 40 - .../x/sys/unix/zsyscall_linux_mipsle.go | 40 - .../x/sys/unix/zsyscall_linux_ppc.go | 40 - .../x/sys/unix/zsyscall_linux_ppc64.go | 40 - .../x/sys/unix/zsyscall_linux_ppc64le.go | 40 - .../x/sys/unix/zsyscall_linux_riscv64.go | 40 - .../x/sys/unix/zsyscall_linux_s390x.go | 40 - .../x/sys/unix/zsyscall_linux_sparc64.go | 40 - .../x/sys/unix/zsyscall_openbsd_386.go | 798 +- .../x/sys/unix/zsyscall_openbsd_386.s | 796 ++ .../x/sys/unix/zsyscall_openbsd_amd64.go | 798 +- .../x/sys/unix/zsyscall_openbsd_amd64.s | 796 ++ .../x/sys/unix/zsyscall_openbsd_arm.go | 798 +- .../x/sys/unix/zsyscall_openbsd_arm.s | 796 ++ .../x/sys/unix/zsyscall_openbsd_arm64.go | 798 +- .../x/sys/unix/zsyscall_openbsd_arm64.s | 796 ++ .../x/sys/unix/zsysnum_freebsd_riscv64.go | 394 + .../x/sys/unix/zsysnum_linux_386.go | 2 +- .../x/sys/unix/zsysnum_linux_amd64.go | 2 +- .../x/sys/unix/zsysnum_linux_arm.go | 2 +- .../x/sys/unix/zsysnum_linux_arm64.go | 2 +- .../x/sys/unix/zsysnum_linux_loong64.go | 2 +- .../x/sys/unix/zsysnum_linux_mips.go | 2 +- .../x/sys/unix/zsysnum_linux_mips64.go | 2 +- .../x/sys/unix/zsysnum_linux_mips64le.go | 2 +- .../x/sys/unix/zsysnum_linux_mipsle.go | 2 +- .../x/sys/unix/zsysnum_linux_ppc.go | 2 +- .../x/sys/unix/zsysnum_linux_ppc64.go | 2 +- .../x/sys/unix/zsysnum_linux_ppc64le.go | 2 +- .../x/sys/unix/zsysnum_linux_riscv64.go | 2 +- .../x/sys/unix/zsysnum_linux_s390x.go | 2 +- .../x/sys/unix/zsysnum_linux_sparc64.go | 2 +- .../x/sys/unix/zsysnum_openbsd_386.go | 1 + .../x/sys/unix/zsysnum_openbsd_amd64.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm.go | 1 + .../x/sys/unix/zsysnum_openbsd_arm64.go | 1 + .../x/sys/unix/ztypes_freebsd_386.go | 17 +- .../x/sys/unix/ztypes_freebsd_amd64.go | 18 +- .../x/sys/unix/ztypes_freebsd_arm.go | 18 +- .../x/sys/unix/ztypes_freebsd_arm64.go | 18 +- .../x/sys/unix/ztypes_freebsd_riscv64.go | 638 ++ vendor/golang.org/x/sys/unix/ztypes_linux.go | 13 + .../golang.org/x/sys/unix/ztypes_linux_386.go | 2 +- .../x/sys/unix/ztypes_linux_amd64.go | 2 +- .../golang.org/x/sys/unix/ztypes_linux_arm.go | 2 +- .../x/sys/unix/ztypes_linux_arm64.go | 2 +- .../x/sys/unix/ztypes_linux_loong64.go | 2 +- .../x/sys/unix/ztypes_linux_mips.go | 2 +- .../x/sys/unix/ztypes_linux_mips64.go | 2 +- .../x/sys/unix/ztypes_linux_mips64le.go | 2 +- .../x/sys/unix/ztypes_linux_mipsle.go | 2 +- .../golang.org/x/sys/unix/ztypes_linux_ppc.go | 2 +- .../x/sys/unix/ztypes_linux_ppc64.go | 2 +- .../x/sys/unix/ztypes_linux_ppc64le.go | 2 +- .../x/sys/unix/ztypes_linux_riscv64.go | 2 +- .../x/sys/unix/ztypes_linux_s390x.go | 2 +- .../x/sys/unix/ztypes_linux_sparc64.go | 2 +- .../x/sys/windows/setupapi_windows.go | 2 +- .../x/sys/windows/syscall_windows.go | 95 + .../x/sys/windows/zsyscall_windows.go | 9 + vendor/golang.org/x/time/AUTHORS | 3 - vendor/golang.org/x/time/CONTRIBUTORS | 3 - vendor/golang.org/x/tools/AUTHORS | 3 - vendor/golang.org/x/tools/CONTRIBUTORS | 3 - .../x/tools/go/gcexportdata/gcexportdata.go | 48 +- .../x/tools/go/gcexportdata/importer.go | 3 + .../go/internal/gcimporter/gcimporter.go | 28 +- .../x/tools/go/internal/gcimporter/iimport.go | 60 +- .../go/internal/gcimporter/unified_no.go | 10 + .../go/internal/gcimporter/unified_yes.go | 10 + .../go/internal/gcimporter/ureader_no.go | 19 + .../go/internal/gcimporter/ureader_yes.go | 612 ++ .../x/tools/go/internal/pkgbits/codes.go | 77 + .../x/tools/go/internal/pkgbits/decoder.go | 433 + .../x/tools/go/internal/pkgbits/doc.go | 32 + .../x/tools/go/internal/pkgbits/encoder.go | 379 + .../x/tools/go/internal/pkgbits/flags.go | 9 + .../x/tools/go/internal/pkgbits/frames_go1.go | 21 + .../tools/go/internal/pkgbits/frames_go17.go | 28 + .../x/tools/go/internal/pkgbits/reloc.go | 42 + .../x/tools/go/internal/pkgbits/support.go | 17 + .../x/tools/go/internal/pkgbits/sync.go | 113 + .../go/internal/pkgbits/syncmarker_string.go | 89 + .../golang.org/x/tools/go/packages/golist.go | 7 +- .../x/tools/internal/imports/fix.go | 4 +- .../x/tools/internal/imports/mod.go | 14 +- vendor/google.golang.org/protobuf/AUTHORS | 3 - .../google.golang.org/protobuf/CONTRIBUTORS | 3 - .../protobuf/encoding/prototext/decode.go | 116 +- .../protobuf/encoding/prototext/encode.go | 39 +- .../protobuf/encoding/protowire/wire.go | 4 + .../protobuf/internal/descfmt/stringer.go | 66 +- .../internal/encoding/defval/default.go | 78 +- .../encoding/messageset/messageset.go | 7 +- .../protobuf/internal/encoding/tag/tag.go | 96 +- .../protobuf/internal/encoding/text/decode.go | 30 +- .../internal/encoding/text/decode_number.go | 6 +- .../protobuf/internal/encoding/text/doc.go | 4 +- .../protobuf/internal/filedesc/build.go | 19 +- .../protobuf/internal/filedesc/desc.go | 378 +- .../protobuf/internal/filedesc/desc_init.go | 36 +- .../protobuf/internal/filedesc/desc_lazy.go | 80 +- .../protobuf/internal/filedesc/desc_list.go | 167 +- .../protobuf/internal/filedesc/placeholder.go | 136 +- .../protobuf/internal/filetype/build.go | 87 +- .../protobuf/internal/impl/api_export.go | 42 +- .../protobuf/internal/impl/checkinit.go | 12 +- .../protobuf/internal/impl/codec_extension.go | 36 +- .../protobuf/internal/impl/codec_field.go | 90 +- .../protobuf/internal/impl/codec_map.go | 20 +- .../protobuf/internal/impl/codec_message.go | 30 +- .../protobuf/internal/impl/codec_tables.go | 290 +- .../protobuf/internal/impl/convert.go | 228 +- .../protobuf/internal/impl/convert_list.go | 42 +- .../protobuf/internal/impl/convert_map.go | 32 +- .../protobuf/internal/impl/decode.go | 21 +- .../protobuf/internal/impl/enum.go | 10 +- .../protobuf/internal/impl/extension.go | 26 +- .../protobuf/internal/impl/legacy_enum.go | 57 +- .../protobuf/internal/impl/legacy_export.go | 18 +- .../internal/impl/legacy_extension.go | 100 +- .../protobuf/internal/impl/legacy_message.go | 122 +- .../protobuf/internal/impl/merge.go | 32 +- .../protobuf/internal/impl/message.go | 41 +- .../protobuf/internal/impl/message_reflect.go | 74 +- .../internal/impl/message_reflect_field.go | 118 +- .../protobuf/internal/impl/validate.go | 50 +- .../protobuf/internal/impl/weak.go | 16 +- .../protobuf/internal/order/order.go | 16 +- .../protobuf/internal/order/range.go | 22 +- .../protobuf/internal/strs/strings_unsafe.go | 6 +- .../protobuf/internal/version/version.go | 54 +- .../protobuf/proto/decode.go | 3 +- .../google.golang.org/protobuf/proto/doc.go | 21 +- .../protobuf/proto/encode.go | 5 +- .../google.golang.org/protobuf/proto/equal.go | 50 +- .../reflect/protodesc/desc_resolve.go | 6 +- .../protobuf/reflect/protoreflect/proto.go | 30 +- .../protobuf/reflect/protoreflect/source.go | 1 + .../protobuf/reflect/protoreflect/type.go | 1 + .../reflect/protoreflect/value_union.go | 2 + .../reflect/protoregistry/registry.go | 2 + .../protobuf/runtime/protoimpl/version.go | 8 +- vendor/gopkg.in/yaml.v2/.travis.yml | 17 - vendor/gopkg.in/yaml.v2/LICENSE | 201 - vendor/gopkg.in/yaml.v2/LICENSE.libyaml | 31 - vendor/gopkg.in/yaml.v2/NOTICE | 13 - vendor/gopkg.in/yaml.v2/README.md | 133 - vendor/gopkg.in/yaml.v2/apic.go | 744 -- vendor/gopkg.in/yaml.v2/decode.go | 815 -- vendor/gopkg.in/yaml.v2/emitterc.go | 1685 ---- vendor/gopkg.in/yaml.v2/encode.go | 390 - vendor/gopkg.in/yaml.v2/parserc.go | 1095 --- vendor/gopkg.in/yaml.v2/readerc.go | 412 - vendor/gopkg.in/yaml.v2/resolve.go | 258 - vendor/gopkg.in/yaml.v2/scannerc.go | 2711 ------ vendor/gopkg.in/yaml.v2/sorter.go | 113 - vendor/gopkg.in/yaml.v2/writerc.go | 26 - vendor/gopkg.in/yaml.v2/yaml.go | 478 - vendor/gopkg.in/yaml.v2/yamlh.go | 739 -- vendor/gopkg.in/yaml.v2/yamlprivateh.go | 173 - vendor/modules.txt | 64 +- 425 files changed, 21220 insertions(+), 23815 deletions(-) delete mode 100644 vendor/github.com/99designs/gqlgen/tools.go delete mode 100644 vendor/github.com/go-openapi/spec/.travis.yml create mode 100644 vendor/github.com/go-openapi/spec/url_go18.go create mode 100644 vendor/github.com/go-openapi/spec/url_go19.go delete mode 100644 vendor/github.com/labstack/echo/v4/context_fs_go1.16.go delete mode 100644 vendor/github.com/labstack/echo/v4/echo_fs_go1.16.go delete mode 100644 vendor/github.com/labstack/echo/v4/group_fs_go1.16.go delete mode 100644 vendor/github.com/matryer/moq/.gitignore delete mode 100644 vendor/github.com/matryer/moq/.goreleaser.yml delete mode 100644 vendor/github.com/matryer/moq/LICENSE delete mode 100644 vendor/github.com/matryer/moq/README.md delete mode 100644 vendor/github.com/matryer/moq/internal/registry/method_scope.go delete mode 100644 vendor/github.com/matryer/moq/internal/registry/package.go delete mode 100644 vendor/github.com/matryer/moq/internal/registry/registry.go delete mode 100644 vendor/github.com/matryer/moq/internal/registry/var.go delete mode 100644 vendor/github.com/matryer/moq/internal/template/template.go delete mode 100644 vendor/github.com/matryer/moq/internal/template/template_data.go delete mode 100644 vendor/github.com/matryer/moq/main.go delete mode 100644 vendor/github.com/matryer/moq/moq-logo-small.png delete mode 100644 vendor/github.com/matryer/moq/moq-logo.png delete mode 100644 vendor/github.com/matryer/moq/pkg/moq/formatter.go delete mode 100644 vendor/github.com/matryer/moq/pkg/moq/moq.go delete mode 100644 vendor/github.com/matryer/moq/preview.png delete mode 100644 vendor/github.com/matryer/moq/releasing.md create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/get_pid.go create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/get_pid_gopherjs.go create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/internal/difflib.go create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/internal/go_collector_options.go create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/num_threads.go create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/num_threads_gopherjs.go create mode 100644 vendor/github.com/prometheus/client_golang/prometheus/process_collector_js.go delete mode 100644 vendor/github.com/prometheus/procfs/fixtures.ttar rename vendor/github.com/prometheus/procfs/{xfrm.go => net_xfrm.go} (96%) create mode 100644 vendor/github.com/prometheus/procfs/proc_cgroups.go create mode 100644 vendor/github.com/prometheus/procfs/proc_netstat.go create mode 100644 vendor/github.com/prometheus/procfs/proc_snmp.go create mode 100644 vendor/github.com/prometheus/procfs/proc_snmp6.go create mode 100644 vendor/github.com/prometheus/procfs/proc_sys.go create mode 100644 vendor/github.com/prometheus/procfs/softirqs.go create mode 100644 vendor/github.com/shirou/gopsutil/v3/internal/common/endian.go delete mode 100644 vendor/github.com/shirou/gopsutil/v3/process/process_darwin_386.go create mode 100644 vendor/github.com/swaggo/files/filebox.go create mode 100644 vendor/github.com/vektah/gqlparser/v2/ast/decode.go delete mode 100644 vendor/golang.org/x/net/AUTHORS delete mode 100644 vendor/golang.org/x/net/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/sys/AUTHORS delete mode 100644 vendor/golang.org/x/sys/CONTRIBUTORS create mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.go create mode 100644 vendor/golang.org/x/sys/cpu/cpu_openbsd_arm64.s create mode 100644 vendor/golang.org/x/sys/unix/asm_bsd_riscv64.s delete mode 100644 vendor/golang.org/x/sys/unix/str.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/syscall_openbsd_libc.go create mode 100644 vendor/golang.org/x/sys/unix/zerrors_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_386.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_amd64.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm.s create mode 100644 vendor/golang.org/x/sys/unix/zsyscall_openbsd_arm64.s create mode 100644 vendor/golang.org/x/sys/unix/zsysnum_freebsd_riscv64.go create mode 100644 vendor/golang.org/x/sys/unix/ztypes_freebsd_riscv64.go delete mode 100644 vendor/golang.org/x/time/AUTHORS delete mode 100644 vendor/golang.org/x/time/CONTRIBUTORS delete mode 100644 vendor/golang.org/x/tools/AUTHORS delete mode 100644 vendor/golang.org/x/tools/CONTRIBUTORS create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/unified_no.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/unified_yes.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/ureader_no.go create mode 100644 vendor/golang.org/x/tools/go/internal/gcimporter/ureader_yes.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/codes.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/decoder.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/doc.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/encoder.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/flags.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/frames_go1.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/frames_go17.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/reloc.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/support.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/sync.go create mode 100644 vendor/golang.org/x/tools/go/internal/pkgbits/syncmarker_string.go delete mode 100644 vendor/google.golang.org/protobuf/AUTHORS delete mode 100644 vendor/google.golang.org/protobuf/CONTRIBUTORS delete mode 100644 vendor/gopkg.in/yaml.v2/.travis.yml delete mode 100644 vendor/gopkg.in/yaml.v2/LICENSE delete mode 100644 vendor/gopkg.in/yaml.v2/LICENSE.libyaml delete mode 100644 vendor/gopkg.in/yaml.v2/NOTICE delete mode 100644 vendor/gopkg.in/yaml.v2/README.md delete mode 100644 vendor/gopkg.in/yaml.v2/apic.go delete mode 100644 vendor/gopkg.in/yaml.v2/decode.go delete mode 100644 vendor/gopkg.in/yaml.v2/emitterc.go delete mode 100644 vendor/gopkg.in/yaml.v2/encode.go delete mode 100644 vendor/gopkg.in/yaml.v2/parserc.go delete mode 100644 vendor/gopkg.in/yaml.v2/readerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/resolve.go delete mode 100644 vendor/gopkg.in/yaml.v2/scannerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/sorter.go delete mode 100644 vendor/gopkg.in/yaml.v2/writerc.go delete mode 100644 vendor/gopkg.in/yaml.v2/yaml.go delete mode 100644 vendor/gopkg.in/yaml.v2/yamlh.go delete mode 100644 vendor/gopkg.in/yaml.v2/yamlprivateh.go diff --git a/go.mod b/go.mod index f49cf95b..9c9ce3ca 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/datarhei/core/v16 go 1.18 require ( - github.com/99designs/gqlgen v0.17.12 + github.com/99designs/gqlgen v0.17.16 github.com/atrox/haikunatorgo/v2 v2.0.1 github.com/datarhei/gosrt v0.2.1-0.20220817080252-d44df04a3845 github.com/datarhei/joy4 v0.0.0-20220728180719-f752080f4a36 @@ -13,18 +13,18 @@ require ( github.com/google/uuid v1.3.0 github.com/invopop/jsonschema v0.4.0 github.com/joho/godotenv v1.4.0 - github.com/labstack/echo/v4 v4.7.2 + github.com/labstack/echo/v4 v4.9.0 github.com/lithammer/shortuuid/v4 v4.0.0 - github.com/mattn/go-isatty v0.0.14 + github.com/mattn/go-isatty v0.0.16 github.com/prep/average v0.0.0-20200506183628-d26c465f48c3 - github.com/prometheus/client_golang v1.12.2 - github.com/shirou/gopsutil/v3 v3.22.6 - github.com/stretchr/testify v1.7.5 - github.com/swaggo/echo-swagger v1.3.3 - github.com/swaggo/swag v1.8.3 - github.com/vektah/gqlparser/v2 v2.4.6 + github.com/prometheus/client_golang v1.13.0 + github.com/shirou/gopsutil/v3 v3.22.8 + github.com/stretchr/testify v1.8.0 + github.com/swaggo/echo-swagger v1.3.4 + github.com/swaggo/swag v1.8.5 + github.com/vektah/gqlparser/v2 v2.5.0 github.com/xeipuuv/gojsonschema v1.2.0 - golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa + golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 ) @@ -39,8 +39,8 @@ require ( github.com/go-ole/go-ole v1.2.6 // indirect github.com/go-openapi/jsonpointer v0.19.5 // indirect github.com/go-openapi/jsonreference v0.20.0 // indirect - github.com/go-openapi/spec v0.20.6 // indirect - github.com/go-openapi/swag v0.21.1 // indirect + github.com/go-openapi/spec v0.20.7 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/go-playground/locales v0.14.0 // indirect github.com/go-playground/universal-translator v0.18.0 // indirect github.com/golang-jwt/jwt v3.2.2+incompatible // indirect @@ -53,17 +53,16 @@ require ( github.com/leodido/go-urn v1.2.1 // indirect github.com/lufia/plan9stats v0.0.0-20220517141722-cf486979b281 // indirect github.com/mailru/easyjson v0.7.7 // indirect - github.com/matryer/moq v0.2.7 // indirect - github.com/mattn/go-colorable v0.1.12 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/power-devops/perfstat v0.0.0-20220216144756-c35f1ee13d7c // indirect github.com/prometheus/client_model v0.2.0 // indirect - github.com/prometheus/common v0.35.0 // indirect - github.com/prometheus/procfs v0.7.3 // indirect + github.com/prometheus/common v0.37.0 // indirect + github.com/prometheus/procfs v0.8.0 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe // indirect + github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a // indirect github.com/tklauser/go-sysconf v0.3.10 // indirect github.com/tklauser/numcpus v0.5.0 // indirect github.com/urfave/cli/v2 v2.8.1 // indirect @@ -73,12 +72,11 @@ require ( github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect github.com/yusufpapurcu/wmi v1.2.2 // indirect - golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 // indirect - golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d // indirect + golang.org/x/net v0.0.0-20220907135653-1e95f45603a7 // indirect + golang.org/x/sys v0.0.0-20220907062415-87db552b00fd // indirect golang.org/x/text v0.3.7 // indirect - golang.org/x/time v0.0.0-20220609170525-579cf78fd858 // indirect - golang.org/x/tools v0.1.11 // indirect - google.golang.org/protobuf v1.28.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 // indirect + golang.org/x/tools v0.1.12 // indirect + google.golang.org/protobuf v1.28.1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 58802caf..fe2d545c 100644 --- a/go.sum +++ b/go.sum @@ -31,8 +31,8 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/99designs/gqlgen v0.17.12 h1:lH/H5dTYCY5eLNRKXeq22l0wFMavpOnN6v9GAIw+fxY= -github.com/99designs/gqlgen v0.17.12/go.mod h1:w1brbeOdqVyNJI553BGwtwdVcYu1LKeYE1opLWN9RgQ= +github.com/99designs/gqlgen v0.17.16 h1:tTIw/cQ/uvf3iXIb2I6YSkdaDkmHmH2W2eZkVe0IVLA= +github.com/99designs/gqlgen v0.17.16/go.mod h1:dnJdUkgfh8iw8CEx2hhTdgTQO/GvVWKLcm/kult5gwI= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.1.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -108,12 +108,12 @@ github.com/go-openapi/jsonreference v0.19.6/go.mod h1:diGHMEHg2IqXZGKxqyvWdfWU/a github.com/go-openapi/jsonreference v0.20.0 h1:MYlu0sBgChmCfJxxUKZ8g1cPWFOB37YSZqewK7OKeyA= github.com/go-openapi/jsonreference v0.20.0/go.mod h1:Ag74Ico3lPc+zR+qjn4XBUmXymS4zJbYVCZmcgkasdo= github.com/go-openapi/spec v0.20.4/go.mod h1:faYFR1CvsJZ0mNsmsphTMSoRrNV3TEDoAM7FOEWeq8I= -github.com/go-openapi/spec v0.20.6 h1:ich1RQ3WDbfoeTqTAb+5EIxNmpKVJZWBNah9RAT0jIQ= -github.com/go-openapi/spec v0.20.6/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= +github.com/go-openapi/spec v0.20.7 h1:1Rlu/ZrOCCob0n+JKKJAWhNWMPW8bOZRg8FJaY+0SKI= +github.com/go-openapi/spec v0.20.7/go.mod h1:2OpW+JddWPrpXSCIX8eOx7lZ5iyuWj3RYR6VaaBKcWA= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.15/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= -github.com/go-openapi/swag v0.21.1 h1:wm0rhTb5z7qpJRHBdPOMuY4QjVUMbF6/kwoYeRAOrKU= -github.com/go-openapi/swag v0.21.1/go.mod h1:QYRuS/SOXUCsnplDa677K7+DxSOj6IPNl/eQntq43wQ= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= @@ -227,8 +227,9 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/labstack/echo/v4 v4.7.2 h1:Kv2/p8OaQ+M6Ex4eGimg9b9e6icoxA42JSlOR3msKtI= github.com/labstack/echo/v4 v4.7.2/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks= +github.com/labstack/echo/v4 v4.9.0 h1:wPOF1CE6gvt/kmbMR4dGzWvHMPT+sAEUJOwOTtvITVY= +github.com/labstack/echo/v4 v4.9.0/go.mod h1:xkCDAdFCIf8jsFQ5NnbK7oqaF/yU1A1X20Ltm0OvSks= github.com/labstack/gommon v0.3.1 h1:OomWaJXm7xR6L1HmEtGyQf26TEn7V6X88mktX9kee9o= github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= @@ -244,13 +245,14 @@ github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/matryer/moq v0.2.7 h1:RtpiPUM8L7ZSCbSwK+QcZH/E9tgqAkFjKQxsRs25b4w= github.com/matryer/moq v0.2.7/go.mod h1:kITsx543GOENm48TUAQyJ9+SAvFSr7iGQXPoth/VUBk= github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= -github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mitchellh/mapstructure v1.3.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= @@ -286,8 +288,8 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= -github.com/prometheus/client_golang v1.12.2 h1:51L9cDoUHVrXx4zWYlcLQIZ+d+VXHgqnYKkIuq4g/34= -github.com/prometheus/client_golang v1.12.2/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_golang v1.13.0 h1:b71QUfeo5M8gq2+evJdTPfZhYMAU0uKPkyPJ7TPsloU= +github.com/prometheus/client_golang v1.13.0/go.mod h1:vTeo+zgvILHsnnj/39Ou/1fPN5nJFOEMgftOUOmlvYQ= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -297,14 +299,15 @@ github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y8 github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= -github.com/prometheus/common v0.35.0 h1:Eyr+Pw2VymWejHqCugNaQXkAi6KayVNxaHeu6khmFBE= -github.com/prometheus/common v0.35.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= +github.com/prometheus/common v0.37.0 h1:ccBbHCgIiT9uSoFY0vX8H3zsNR5eLt17/RQLUvn8pXE= +github.com/prometheus/common v0.37.0/go.mod h1:phzohg0JFMnBEFGxTDbfu3QyL5GI8gTQJFhYO5B3mfA= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= -github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= +github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= @@ -314,8 +317,8 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/shirou/gopsutil/v3 v3.22.6 h1:FnHOFOh+cYAM0C30P+zysPISzlknLC5Z1G4EAElznfQ= -github.com/shirou/gopsutil/v3 v3.22.6/go.mod h1:EdIubSnZhbAvBS1yJ7Xi+AShB/hxwLHOMz4MCYz7yMs= +github.com/shirou/gopsutil/v3 v3.22.8 h1:a4s3hXogo5mE2PfdfJIonDbstO/P+9JszdfhAHSzD9Y= +github.com/shirou/gopsutil/v3 v3.22.8/go.mod h1:s648gW4IywYzUfE/KjXxUsqrqx/T2xO5VqOXxONeRfI= 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.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= @@ -333,15 +336,15 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.7.5 h1:s5PTfem8p8EbKQOctVV53k6jCJt3UX4IEJzwh+C324Q= -github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/swaggo/echo-swagger v1.3.3 h1:Fx8kQ8IcIIEL3ZE20wzvcT8gFnPo/4U+fsnS3I1wvCw= -github.com/swaggo/echo-swagger v1.3.3/go.mod h1:vbKcEBeJgOexLuPcsdZhrRAV508fsE79xaKIqmvse98= -github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe h1:K8pHPVoTgxFJt1lXuIzzOX7zZhZFldJQK/CgKx9BFIc= -github.com/swaggo/files v0.0.0-20220610200504-28940afbdbfe/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= +github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/swaggo/echo-swagger v1.3.4 h1:8B+yVqjVm7cMy4QBLRUuRaOzrTVAqZahcrgrOSdpC5I= +github.com/swaggo/echo-swagger v1.3.4/go.mod h1:vh8QAdbHtTXwTSaWzc1Nby7zMYJd/g0FwQyArmrFHA8= +github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a h1:kAe4YSu0O0UFn1DowNo2MY5p6xzqtJ/wQ7LZynSvGaY= +github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a/go.mod h1:lKJPbtWzJ9JhsTN1k1gZgleJWY/cqq0psdoMmaThG3w= github.com/swaggo/swag v1.8.1/go.mod h1:ugemnJsPZm/kRwFUnzBlbHRd0JY9zE1M4F+uy2pAaPQ= -github.com/swaggo/swag v1.8.3 h1:3pZSSCQ//gAH88lfmxM3Cd1+JCsxV8Md6f36b9hrZ5s= -github.com/swaggo/swag v1.8.3/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= +github.com/swaggo/swag v1.8.5 h1:7NgtfXsXE+jrcOwRyiftGKW7Ppydj7tZiVenuRf1fE4= +github.com/swaggo/swag v1.8.5/go.mod h1:jMLeXOOmYyjk8PvHTsXBdrubsNd9gUJTTCzL5iBnseg= github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.4.0/go.mod h1:1+UI3pD8NW14VMwdgJNJ1ESk2UnwhAnz5hMwiKKqXCQ= @@ -354,8 +357,8 @@ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6Kllzaw github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vektah/gqlparser/v2 v2.4.6 h1:Yjzp66g6oVq93Jihbi0qhGnf/6zIWjcm8H6gA27zstE= -github.com/vektah/gqlparser/v2 v2.4.6/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= +github.com/vektah/gqlparser/v2 v2.5.0 h1:GwEwy7AJsqPWrey0bHnn+3JLaHLZVT66wY/+O+Tf9SU= +github.com/vektah/gqlparser/v2 v2.5.0/go.mod h1:mPgqFBu/woKTVYWyNk8cO3kh4S/f4aRFZrvOnp3hmCs= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -387,8 +390,9 @@ golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5y golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa h1:zuSxTR4o9y82ebqCUJYNGJbGPo6sKVl54f/TVDObg1c= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90 h1:Y/gsMcFOcR+6S6f3YeMKl5g+dZMEWqcz5Czj/GWYbkM= +golang.org/x/crypto v0.0.0-20220829220503-c86fa9a7ed90/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -420,7 +424,6 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= @@ -461,8 +464,8 @@ golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60 h1:8NSylCMxLW4JvserAndSgFL7aPli6A68yf0bYFTcWCM= -golang.org/x/net v0.0.0-20220706163947-c90051bbdb60/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.0.0-20220907135653-1e95f45603a7 h1:1WGATo9HAhkWMbfyuVU0tEFP88OIkUvwaHFveQPvzCQ= +golang.org/x/net v0.0.0-20220907135653-1e95f45603a7/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= 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-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -531,8 +534,9 @@ golang.org/x/sys v0.0.0-20220128215802-99c3d69c2c27/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220422013727-9388b58f7150/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220503163025-988cb79eb6c6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d h1:/m5NbqQelATgoSPVC2Z23sR4kVNokFwDDyWh/3rGY+I= -golang.org/x/sys v0.0.0-20220708085239-5a0f0661e09d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220907062415-87db552b00fd h1:AZeIEzg+8RCELJYq8w+ODLVxFgLMMigSwO/ffKPEd9U= +golang.org/x/sys v0.0.0-20220907062415-87db552b00fd/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -547,8 +551,8 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858 h1:Dpdu/EMxGMFgq0CeYMh4fazTD2vtlZRYE7wyynxJb9U= -golang.org/x/time v0.0.0-20220609170525-579cf78fd858/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9 h1:ftMN5LMiBFjbzleLqtoBZk7KdJwhuybIU+FckUHgoyQ= +golang.org/x/time v0.0.0-20220722155302-e5dcc9cfc0b9/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/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= @@ -591,10 +595,9 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo= -golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11 h1:loJ25fNOEhSXfHrpoGj91eCUThwdNX6u24rO1xnNteY= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= +golang.org/x/tools v0.1.12 h1:VveCTK38A2rkS8ZqFY25HIDFscX5X9OoEhJd3quQmXU= +golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= 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= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -674,8 +677,9 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= +google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/99designs/gqlgen/.gitignore b/vendor/github.com/99designs/gqlgen/.gitignore index 31346424..cbc986fb 100644 --- a/vendor/github.com/99designs/gqlgen/.gitignore +++ b/vendor/github.com/99designs/gqlgen/.gitignore @@ -15,3 +15,4 @@ *.test *.out gqlgen +*.exe diff --git a/vendor/github.com/99designs/gqlgen/CHANGELOG.md b/vendor/github.com/99designs/gqlgen/CHANGELOG.md index ed091a2b..a50f8012 100644 --- a/vendor/github.com/99designs/gqlgen/CHANGELOG.md +++ b/vendor/github.com/99designs/gqlgen/CHANGELOG.md @@ -5,10 +5,160 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/99designs/gqlgen/compare/v0.17.11...HEAD) +## [Unreleased](https://github.com/99designs/gqlgen/compare/v0.17.14...HEAD) + +## [v0.17.14](https://github.com/99designs/gqlgen/compare/v0.17.13...v0.17.14) - 2022-08-18 +- 581bf6eb release v0.17.14 + +- d3384377 Update gqlparser + +- c2d02d35 More descriptive `not implemented` stubs (#2328) (closes #2327) + +
9f919d2c Avoid GraphQL to Go Naming Collision with "ToGoModelName" func (#2322) (closes #2321) + +* using ReplaceAllStringLiteral + +* fixing wordInfo template test + +* bumping linter timeout to 5m + +* comment cleanup + +* some cleanup, adding "ToGoPrivateModelName" func + +* adding "ToGoPrivateModelName" func + +* refactoring word walker impl and tests + +* hopefully making linter happy + +
+ +- 2304c104 Include docstrings on interface getters (#2317) + +- f5d60326 Leverage (*Imports).LookupType when generating interface field getters (#2315) + +
242c3ba2 Generate getters for interface fields (#2314) + +* Generate getters for interface fields + +* Changes to make models_test.go pass + +* Use text/template, not html/template + +* Re-run go generate ./... + +* gofmt a few files that were failing lint checks + +* Another gofmt straggler + +* Try making the "generated" match the exact whitespace github is disliking + +
+ +- 0d91c893 Add hackernews graphql api tutorial to other resources (#2305) + +- c2526ba5 Update gqlparser to v2.4.7 (#2300) + +- f283124d #2298: fix gqlgen extracting module name from comment line (#2299) + +
779d7cdd Add support for KeepAlive message in websocket client (#2293) + +* Add support for KeepAlive message in websocket client + +* rewrite if-else to switch statement + +
+ +- 5a37d1dc v0.17.13 postrelease bump + + + + + + +## [v0.17.13](https://github.com/99designs/gqlgen/compare/v0.17.12...v0.17.13) - 2022-07-15 +- e82b6bf1 release v0.17.13 + +
f0e9047d Hide dependencies in `tools.go` from importers (#2287) + +Projects that use `go mod vendor` will vendor `github.com/matryer/moq` +despite it not being required at runtime. + +Moving `tools.go` to `internal` hides this import from downstream +users and avoids `github.com/matryer/moq` being vendored. + +`go generate` of the mocks still works as expected. + +The assumption behind the import test broke, so I've pointed it at a +different path that has no Go code. This seems to match the intent +behind the original test for the `internal/code/..` path. + +
+ +- 6310e6a7 support named interface to Field.CallArgs (#2289) + +
30493696 fix: return the original error (#2288) + +* fix: return the original error + +close https://github.com/99designs/gqlgen/issues/2286 + +* Update error.go + +
+ +- fb13091d updated WebSocker InitFunc recipe (#2275) + +- 770c09fb Update changelog for v0.17.12 + +- b4c186a7 v0.17.12 postrelease bump + + + + + + +## [v0.17.12](https://github.com/99designs/gqlgen/compare/v0.17.11...v0.17.12) - 2022-07-04 +- 94c02b0d release v0.17.12 + +- 7eb8ba93 Fix CreateTodo (#2256) + +
0b0e5ce4 Replace use of strings.Title with cases.Title (#2268) + +* github: Test more go versions + +* github: Fix ci tests + +* github: Increase verbosity, sleep + +* github: Drop bash + +* github: Test go 1.18 and newer node verisons + +* github: Pull out node 16 for now + +* github: Only lint 1.16 for now + +* cases: Use cases.Title over strings.Title which is deprecated + +* gqlgen: Remove use of deprecated strings.Title + +
+ +- 0c11e5fd parse at beginning of do function (#2269) + +- edb1c585 Update Changelog for v0.17.11 + +- 5e6b52fd v0.17.11 postrelease bump + + + + + ## [v0.17.11](https://github.com/99designs/gqlgen/compare/v0.17.10...v0.17.11) - 2022-07-03 - ea294c4e release v0.17.11 diff --git a/vendor/github.com/99designs/gqlgen/README.md b/vendor/github.com/99designs/gqlgen/README.md index 0621c55b..6c61c85e 100644 --- a/vendor/github.com/99designs/gqlgen/README.md +++ b/vendor/github.com/99designs/gqlgen/README.md @@ -148,3 +148,4 @@ There isn't any way around this, gqlgen has no way to know what you want in a gi - [Introducing gqlgen: a GraphQL Server Generator for Go](https://99designs.com.au/blog/engineering/gqlgen-a-graphql-server-generator-for-go/) - [Dive into GraphQL by Iván Corrales Solera](https://medium.com/@ivan.corrales.solera/dive-into-graphql-9bfedf22e1a) - [Sample Project built on gqlgen with Postgres by Oleg Shalygin](https://github.com/oshalygin/gqlgen-pg-todo-example) +- [Hackernews GraphQL Server with gqlgen by Shayegan Hooshyari](https://www.howtographql.com/graphql-go/0-introduction/) diff --git a/vendor/github.com/99designs/gqlgen/codegen/config/binder.go b/vendor/github.com/99designs/gqlgen/codegen/config/binder.go index 90820de6..bedc23bc 100644 --- a/vendor/github.com/99designs/gqlgen/codegen/config/binder.go +++ b/vendor/github.com/99designs/gqlgen/codegen/config/binder.go @@ -216,7 +216,6 @@ func (t *TypeReference) IsPtr() bool { } // fix for https://github.com/golang/go/issues/31103 may make it possible to remove this (may still be useful) -// func (t *TypeReference) IsPtrToPtr() bool { if p, isPtr := t.GO.(*types.Pointer); isPtr { _, isPtr := p.Elem().(*types.Pointer) diff --git a/vendor/github.com/99designs/gqlgen/codegen/config/config.go b/vendor/github.com/99designs/gqlgen/codegen/config/config.go index 2b45c3c2..9deba8b1 100644 --- a/vendor/github.com/99designs/gqlgen/codegen/config/config.go +++ b/vendor/github.com/99designs/gqlgen/codegen/config/config.go @@ -1,6 +1,7 @@ package config import ( + "bytes" "fmt" "os" "path/filepath" @@ -11,7 +12,7 @@ import ( "github.com/99designs/gqlgen/internal/code" "github.com/vektah/gqlparser/v2" "github.com/vektah/gqlparser/v2/ast" - "gopkg.in/yaml.v2" + "gopkg.in/yaml.v3" ) type Config struct { @@ -102,7 +103,10 @@ func LoadConfig(filename string) (*Config, error) { return nil, fmt.Errorf("unable to read config: %w", err) } - if err := yaml.UnmarshalStrict(b, config); err != nil { + dec := yaml.NewDecoder(bytes.NewReader(b)) + dec.KnownFields(true) + + if err := dec.Decode(config); err != nil { return nil, fmt.Errorf("unable to parse config: %w", err) } diff --git a/vendor/github.com/99designs/gqlgen/codegen/field.go b/vendor/github.com/99designs/gqlgen/codegen/field.go index 053c86e1..a33cc18e 100644 --- a/vendor/github.com/99designs/gqlgen/codegen/field.go +++ b/vendor/github.com/99designs/gqlgen/codegen/field.go @@ -562,7 +562,7 @@ func (f *Field) CallArgs() string { for _, arg := range f.Args { tmp := "fc.Args[" + strconv.Quote(arg.Name) + "].(" + templates.CurrentImports.LookupType(arg.TypeReference.GO) + ")" - if types.IsInterface(arg.TypeReference.GO) { + if iface, ok := arg.TypeReference.GO.(*types.Interface); ok && iface.Empty() { tmp = fmt.Sprintf(` func () interface{} { if fc.Args["%s"] == nil { diff --git a/vendor/github.com/99designs/gqlgen/codegen/templates/templates.go b/vendor/github.com/99designs/gqlgen/codegen/templates/templates.go index ab39c08e..159df77c 100644 --- a/vendor/github.com/99designs/gqlgen/codegen/templates/templates.go +++ b/vendor/github.com/99designs/gqlgen/codegen/templates/templates.go @@ -8,10 +8,12 @@ import ( "os" "path/filepath" "reflect" + "regexp" "runtime" "sort" "strconv" "strings" + "sync" "text/template" "unicode" @@ -58,6 +60,12 @@ type Options struct { Packages *code.Packages } +var ( + modelNamesMu sync.Mutex + modelNames = make(map[string]string, 0) + goNameRe = regexp.MustCompile("[^a-zA-Z0-9_]") +) + // Render renders a gql plugin template from the given Options. Render is an // abstraction of the text/template package that makes it easier to write gqlgen // plugins. If Options.Template is empty, the Render function will look for `.gotpl` @@ -188,20 +196,22 @@ func center(width int, pad string, s string) string { func Funcs() template.FuncMap { return template.FuncMap{ - "ucFirst": UcFirst, - "lcFirst": LcFirst, - "quote": strconv.Quote, - "rawQuote": rawQuote, - "dump": Dump, - "ref": ref, - "ts": TypeIdentifier, - "call": Call, - "prefixLines": prefixLines, - "notNil": notNil, - "reserveImport": CurrentImports.Reserve, - "lookupImport": CurrentImports.Lookup, - "go": ToGo, - "goPrivate": ToGoPrivate, + "ucFirst": UcFirst, + "lcFirst": LcFirst, + "quote": strconv.Quote, + "rawQuote": rawQuote, + "dump": Dump, + "ref": ref, + "ts": TypeIdentifier, + "call": Call, + "prefixLines": prefixLines, + "notNil": notNil, + "reserveImport": CurrentImports.Reserve, + "lookupImport": CurrentImports.Lookup, + "go": ToGo, + "goPrivate": ToGoPrivate, + "goModelName": ToGoModelName, + "goPrivateModelName": ToGoPrivateModelName, "add": func(a, b int) int { return a + b }, @@ -291,25 +301,154 @@ func Call(p *types.Func) string { return pkg + p.Name() } +func resetModelNames() { + modelNamesMu.Lock() + defer modelNamesMu.Unlock() + modelNames = make(map[string]string, 0) +} + +func buildGoModelNameKey(parts []string) string { + const sep = ":" + return strings.Join(parts, sep) +} + +func goModelName(primaryToGoFunc func(string) string, parts []string) string { + modelNamesMu.Lock() + defer modelNamesMu.Unlock() + + var ( + goNameKey string + partLen int + + nameExists = func(n string) bool { + for _, v := range modelNames { + if n == v { + return true + } + } + return false + } + + applyToGoFunc = func(parts []string) string { + var out string + switch len(parts) { + case 0: + return "" + case 1: + return primaryToGoFunc(parts[0]) + default: + out = primaryToGoFunc(parts[0]) + } + for _, p := range parts[1:] { + out = fmt.Sprintf("%s%s", out, ToGo(p)) + } + return out + } + + applyValidGoName = func(parts []string) string { + var out string + for _, p := range parts { + out = fmt.Sprintf("%s%s", out, replaceInvalidCharacters(p)) + } + return out + } + ) + + // build key for this entity + goNameKey = buildGoModelNameKey(parts) + + // determine if we've seen this entity before, and reuse if so + if goName, ok := modelNames[goNameKey]; ok { + return goName + } + + // attempt first pass + if goName := applyToGoFunc(parts); !nameExists(goName) { + modelNames[goNameKey] = goName + return goName + } + + // determine number of parts + partLen = len(parts) + + // if there is only 1 part, append incrementing number until no conflict + if partLen == 1 { + base := applyToGoFunc(parts) + for i := 0; ; i++ { + tmp := fmt.Sprintf("%s%d", base, i) + if !nameExists(tmp) { + modelNames[goNameKey] = tmp + return tmp + } + } + } + + // best effort "pretty" name + for i := partLen - 1; i >= 1; i-- { + tmp := fmt.Sprintf("%s%s", applyToGoFunc(parts[0:i]), applyValidGoName(parts[i:])) + if !nameExists(tmp) { + modelNames[goNameKey] = tmp + return tmp + } + } + + // finally, fallback to just adding an incrementing number + base := applyToGoFunc(parts) + for i := 0; ; i++ { + tmp := fmt.Sprintf("%s%d", base, i) + if !nameExists(tmp) { + modelNames[goNameKey] = tmp + return tmp + } + } +} + +func ToGoModelName(parts ...string) string { + return goModelName(ToGo, parts) +} + +func ToGoPrivateModelName(parts ...string) string { + return goModelName(ToGoPrivate, parts) +} + +func replaceInvalidCharacters(in string) string { + return goNameRe.ReplaceAllLiteralString(in, "_") +} + +func wordWalkerFunc(private bool, nameRunes *[]rune) func(*wordInfo) { + return func(info *wordInfo) { + word := info.Word + + switch { + case private && info.WordOffset == 0: + if strings.ToUpper(word) == word || strings.ToLower(word) == word { + // ID → id, CAMEL → camel + word = strings.ToLower(info.Word) + } else { + // ITicket → iTicket + word = LcFirst(info.Word) + } + + case info.MatchCommonInitial: + word = strings.ToUpper(word) + + case !info.HasCommonInitial && (strings.ToUpper(word) == word || strings.ToLower(word) == word): + // FOO or foo → Foo + // FOo → FOo + word = UcFirst(strings.ToLower(word)) + } + + *nameRunes = append(*nameRunes, []rune(word)...) + } +} + func ToGo(name string) string { if name == "_" { return "_" } runes := make([]rune, 0, len(name)) - wordWalker(name, func(info *wordInfo) { - word := info.Word - if info.MatchCommonInitial { - word = strings.ToUpper(word) - } else if !info.HasCommonInitial { - if strings.ToUpper(word) == word || strings.ToLower(word) == word { - // FOO or foo → Foo - // FOo → FOo - word = UcFirst(strings.ToLower(word)) - } - } - runes = append(runes, []rune(word)...) - }) + wordWalker(name, wordWalkerFunc(false, &runes)) return string(runes) } @@ -320,31 +459,13 @@ func ToGoPrivate(name string) string { } runes := make([]rune, 0, len(name)) - first := true - wordWalker(name, func(info *wordInfo) { - word := info.Word - switch { - case first: - if strings.ToUpper(word) == word || strings.ToLower(word) == word { - // ID → id, CAMEL → camel - word = strings.ToLower(info.Word) - } else { - // ITicket → iTicket - word = LcFirst(info.Word) - } - first = false - case info.MatchCommonInitial: - word = strings.ToUpper(word) - case !info.HasCommonInitial: - word = UcFirst(strings.ToLower(word)) - } - runes = append(runes, []rune(word)...) - }) + wordWalker(name, wordWalkerFunc(true, &runes)) return sanitizeKeywords(string(runes)) } type wordInfo struct { + WordOffset int Word string MatchCommonInitial bool HasCommonInitial bool @@ -354,7 +475,7 @@ type wordInfo struct { // https://github.com/golang/lint/blob/06c8688daad7faa9da5a0c2f163a3d14aac986ca/lint.go#L679 func wordWalker(str string, f func(*wordInfo)) { runes := []rune(strings.TrimFunc(str, isDelimiter)) - w, i := 0, 0 // index of start of word, scan + w, i, wo := 0, 0, 0 // index of start of word, scan, word offset hasCommonInitial := false for i+1 <= len(runes) { eow := false // whether we hit the end of a word @@ -402,12 +523,14 @@ func wordWalker(str string, f func(*wordInfo)) { } f(&wordInfo{ + WordOffset: wo, Word: word, MatchCommonInitial: matchCommonInitial, HasCommonInitial: hasCommonInitial, }) hasCommonInitial = false w = i + wo++ } } diff --git a/vendor/github.com/99designs/gqlgen/graphql/errcode/codes.go b/vendor/github.com/99designs/gqlgen/graphql/errcode/codes.go index 98b95d00..4333d87e 100644 --- a/vendor/github.com/99designs/gqlgen/graphql/errcode/codes.go +++ b/vendor/github.com/99designs/gqlgen/graphql/errcode/codes.go @@ -29,12 +29,13 @@ func RegisterErrorType(code string, kind ErrorKind) { } // Set the error code on a given graphql error extension -func Set(err *gqlerror.Error, value string) { - if err.Extensions == nil { - err.Extensions = map[string]interface{}{} +func Set(err error, value string) { + gqlErr, _ := err.(*gqlerror.Error) + if gqlErr.Extensions == nil { + gqlErr.Extensions = map[string]interface{}{} } - err.Extensions["code"] = value + gqlErr.Extensions["code"] = value } // get the kind of the first non User error, defaults to User if no errors have a custom extension diff --git a/vendor/github.com/99designs/gqlgen/graphql/error.go b/vendor/github.com/99designs/gqlgen/graphql/error.go index 4fe520b2..f816bef6 100644 --- a/vendor/github.com/99designs/gqlgen/graphql/error.go +++ b/vendor/github.com/99designs/gqlgen/graphql/error.go @@ -26,7 +26,8 @@ func ErrorOnPath(ctx context.Context, err error) error { if gqlErr.Path == nil { gqlErr.Path = GetPath(ctx) } - return gqlErr + // Return the original error to avoid losing any attached annotation + return err } return gqlerror.WrapPath(GetPath(ctx), err) } diff --git a/vendor/github.com/99designs/gqlgen/graphql/executor/executor.go b/vendor/github.com/99designs/gqlgen/graphql/executor/executor.go index 2fca58ac..d036ea6f 100644 --- a/vendor/github.com/99designs/gqlgen/graphql/executor/executor.go +++ b/vendor/github.com/99designs/gqlgen/graphql/executor/executor.go @@ -72,11 +72,12 @@ func (e *Executor) CreateOperationContext(ctx context.Context, params *graphql.R return rc, gqlerror.List{err} } - var err *gqlerror.Error + var err error rc.Variables, err = validator.VariableValues(e.es.Schema(), rc.Operation, params.Variables) - if err != nil { - errcode.Set(err, errcode.ValidationFailed) - return rc, gqlerror.List{err} + gqlErr, _ := err.(*gqlerror.Error) + if gqlErr != nil { + errcode.Set(gqlErr, errcode.ValidationFailed) + return rc, gqlerror.List{gqlErr} } rc.Stats.Validation.End = graphql.Now() @@ -141,7 +142,7 @@ func (e *Executor) DispatchError(ctx context.Context, list gqlerror.List) *graph return resp } -func (e *Executor) PresentRecoveredError(ctx context.Context, err interface{}) *gqlerror.Error { +func (e *Executor) PresentRecoveredError(ctx context.Context, err interface{}) error { return e.errorPresenter(ctx, e.recoverFunc(ctx, err)) } @@ -173,9 +174,10 @@ func (e *Executor) parseQuery(ctx context.Context, stats *graphql.Stats, query s } doc, err := parser.ParseQuery(&ast.Source{Input: query}) - if err != nil { - errcode.Set(err, errcode.ParseFailed) - return nil, gqlerror.List{err} + gqlErr, _ := err.(*gqlerror.Error) + if gqlErr != nil { + errcode.Set(gqlErr, errcode.ParseFailed) + return nil, gqlerror.List{gqlErr} } stats.Parsing.End = graphql.Now() @@ -183,8 +185,9 @@ func (e *Executor) parseQuery(ctx context.Context, stats *graphql.Stats, query s if len(doc.Operations) == 0 { err = gqlerror.Errorf("no operation provided") + gqlErr, _ := err.(*gqlerror.Error) errcode.Set(err, errcode.ValidationFailed) - return nil, gqlerror.List{err} + return nil, gqlerror.List{gqlErr} } listErr := validator.Validate(e.es.Schema(), doc) diff --git a/vendor/github.com/99designs/gqlgen/graphql/handler/server.go b/vendor/github.com/99designs/gqlgen/graphql/handler/server.go index 69530bbc..b6524d8d 100644 --- a/vendor/github.com/99designs/gqlgen/graphql/handler/server.go +++ b/vendor/github.com/99designs/gqlgen/graphql/handler/server.go @@ -102,7 +102,8 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { defer func() { if err := recover(); err != nil { err := s.exec.PresentRecoveredError(r.Context(), err) - resp := &graphql.Response{Errors: []*gqlerror.Error{err}} + gqlErr, _ := err.(*gqlerror.Error) + resp := &graphql.Response{Errors: []*gqlerror.Error{gqlErr}} b, _ := json.Marshal(resp) w.WriteHeader(http.StatusUnprocessableEntity) w.Write(b) diff --git a/vendor/github.com/99designs/gqlgen/graphql/playground/playground.go b/vendor/github.com/99designs/gqlgen/graphql/playground/playground.go index d356729e..720e1a14 100644 --- a/vendor/github.com/99designs/gqlgen/graphql/playground/playground.go +++ b/vendor/github.com/99designs/gqlgen/graphql/playground/playground.go @@ -9,17 +9,19 @@ import ( var page = template.Must(template.New("graphiql").Parse(` - {{.title}} - - - -
+ {{.title}} + + + + +
Loading...
+