songxiaohang 1 жил өмнө
parent
commit
dd63e41668
100 өөрчлөгдсөн 56 нэмэгдсэн , 12145 устгасан
  1. 3 3
      .gitignore
  2. 4 1
      app/cmd/events/etc/events.yaml
  3. 1 1
      app/cmd/events/events.go
  4. 4 0
      app/cmd/events/internal/config/config.go
  5. 18 8
      app/cmd/events/internal/logic/handler/event.go
  6. 9 2
      app/cmd/events/internal/logic/handler/single.go
  7. 2 0
      app/cmd/events/internal/logic/handler/vars.go
  8. 1 1
      app/cmd/organization/organization.go
  9. 2 3
      app/model/dcDeviceBindModel_gen.go
  10. 1 1
      app/model/dcEventBindModel_gen.go
  11. 0 336
      common/envitem/func.go
  12. 0 78
      common/envitem/func_test.go
  13. 0 48
      common/envitem/types.go
  14. 0 17
      common/envitem/vars.go
  15. 0 576
      common/httplib/httplib.go
  16. 0 221
      common/identify/single.go
  17. 0 11
      common/identify/single_test.go
  18. 0 35
      common/identify/types.go
  19. 0 6
      common/identify/vars.go
  20. 5 1
      deploy/test.sh
  21. 2 1
      go.mod
  22. 4 2
      go.sum
  23. 0 20
      vendor/github.com/beorn7/perks/LICENSE
  24. 0 2388
      vendor/github.com/beorn7/perks/quantile/exampledata.txt
  25. 0 316
      vendor/github.com/beorn7/perks/quantile/stream.go
  26. 0 25
      vendor/github.com/cenkalti/backoff/v4/.gitignore
  27. 0 20
      vendor/github.com/cenkalti/backoff/v4/LICENSE
  28. 0 32
      vendor/github.com/cenkalti/backoff/v4/README.md
  29. 0 66
      vendor/github.com/cenkalti/backoff/v4/backoff.go
  30. 0 62
      vendor/github.com/cenkalti/backoff/v4/context.go
  31. 0 161
      vendor/github.com/cenkalti/backoff/v4/exponential.go
  32. 0 146
      vendor/github.com/cenkalti/backoff/v4/retry.go
  33. 0 97
      vendor/github.com/cenkalti/backoff/v4/ticker.go
  34. 0 35
      vendor/github.com/cenkalti/backoff/v4/timer.go
  35. 0 38
      vendor/github.com/cenkalti/backoff/v4/tries.go
  36. 0 22
      vendor/github.com/cespare/xxhash/v2/LICENSE.txt
  37. 0 72
      vendor/github.com/cespare/xxhash/v2/README.md
  38. 0 10
      vendor/github.com/cespare/xxhash/v2/testall.sh
  39. 0 228
      vendor/github.com/cespare/xxhash/v2/xxhash.go
  40. 0 209
      vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s
  41. 0 183
      vendor/github.com/cespare/xxhash/v2/xxhash_arm64.s
  42. 0 15
      vendor/github.com/cespare/xxhash/v2/xxhash_asm.go
  43. 0 76
      vendor/github.com/cespare/xxhash/v2/xxhash_other.go
  44. 0 16
      vendor/github.com/cespare/xxhash/v2/xxhash_safe.go
  45. 0 58
      vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go
  46. 0 202
      vendor/github.com/coreos/go-semver/LICENSE
  47. 0 5
      vendor/github.com/coreos/go-semver/NOTICE
  48. 0 296
      vendor/github.com/coreos/go-semver/semver/semver.go
  49. 0 38
      vendor/github.com/coreos/go-semver/semver/sort.go
  50. 0 191
      vendor/github.com/coreos/go-systemd/v22/LICENSE
  51. 0 5
      vendor/github.com/coreos/go-systemd/v22/NOTICE
  52. 0 46
      vendor/github.com/coreos/go-systemd/v22/journal/journal.go
  53. 0 267
      vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go
  54. 0 43
      vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go
  55. 0 15
      vendor/github.com/davecgh/go-spew/LICENSE
  56. 0 145
      vendor/github.com/davecgh/go-spew/spew/bypass.go
  57. 0 38
      vendor/github.com/davecgh/go-spew/spew/bypasssafe.go
  58. 0 341
      vendor/github.com/davecgh/go-spew/spew/common.go
  59. 0 306
      vendor/github.com/davecgh/go-spew/spew/config.go
  60. 0 211
      vendor/github.com/davecgh/go-spew/spew/doc.go
  61. 0 509
      vendor/github.com/davecgh/go-spew/spew/dump.go
  62. 0 419
      vendor/github.com/davecgh/go-spew/spew/format.go
  63. 0 148
      vendor/github.com/davecgh/go-spew/spew/spew.go
  64. 0 21
      vendor/github.com/dgryski/go-rendezvous/LICENSE
  65. 0 79
      vendor/github.com/dgryski/go-rendezvous/rdv.go
  66. 0 71
      vendor/github.com/emicklei/go-restful/v3/.gitignore
  67. 0 1
      vendor/github.com/emicklei/go-restful/v3/.goconvey
  68. 0 13
      vendor/github.com/emicklei/go-restful/v3/.travis.yml
  69. 0 376
      vendor/github.com/emicklei/go-restful/v3/CHANGES.md
  70. 0 22
      vendor/github.com/emicklei/go-restful/v3/LICENSE
  71. 0 8
      vendor/github.com/emicklei/go-restful/v3/Makefile
  72. 0 111
      vendor/github.com/emicklei/go-restful/v3/README.md
  73. 0 13
      vendor/github.com/emicklei/go-restful/v3/SECURITY.md
  74. 0 1
      vendor/github.com/emicklei/go-restful/v3/Srcfile
  75. 0 10
      vendor/github.com/emicklei/go-restful/v3/bench_test.sh
  76. 0 127
      vendor/github.com/emicklei/go-restful/v3/compress.go
  77. 0 103
      vendor/github.com/emicklei/go-restful/v3/compressor_cache.go
  78. 0 91
      vendor/github.com/emicklei/go-restful/v3/compressor_pools.go
  79. 0 54
      vendor/github.com/emicklei/go-restful/v3/compressors.go
  80. 0 30
      vendor/github.com/emicklei/go-restful/v3/constants.go
  81. 0 450
      vendor/github.com/emicklei/go-restful/v3/container.go
  82. 0 193
      vendor/github.com/emicklei/go-restful/v3/cors_filter.go
  83. 0 2
      vendor/github.com/emicklei/go-restful/v3/coverage.sh
  84. 0 173
      vendor/github.com/emicklei/go-restful/v3/curly.go
  85. 0 54
      vendor/github.com/emicklei/go-restful/v3/curly_route.go
  86. 0 29
      vendor/github.com/emicklei/go-restful/v3/custom_verb.go
  87. 0 185
      vendor/github.com/emicklei/go-restful/v3/doc.go
  88. 0 162
      vendor/github.com/emicklei/go-restful/v3/entity_accessors.go
  89. 0 21
      vendor/github.com/emicklei/go-restful/v3/extensions.go
  90. 0 37
      vendor/github.com/emicklei/go-restful/v3/filter.go
  91. 0 21
      vendor/github.com/emicklei/go-restful/v3/filter_adapter.go
  92. 0 11
      vendor/github.com/emicklei/go-restful/v3/json.go
  93. 0 12
      vendor/github.com/emicklei/go-restful/v3/jsoniter.go
  94. 0 326
      vendor/github.com/emicklei/go-restful/v3/jsr311.go
  95. 0 34
      vendor/github.com/emicklei/go-restful/v3/log/log.go
  96. 0 32
      vendor/github.com/emicklei/go-restful/v3/logger.go
  97. 0 50
      vendor/github.com/emicklei/go-restful/v3/mime.go
  98. 0 34
      vendor/github.com/emicklei/go-restful/v3/options_filter.go
  99. 0 242
      vendor/github.com/emicklei/go-restful/v3/parameter.go
  100. 0 74
      vendor/github.com/emicklei/go-restful/v3/path_expression.go

+ 3 - 3
.gitignore

@@ -3,6 +3,9 @@
 *.o
 *.a
 *.so
+vendor/
+vendor/*
+venv/
 
 # Folders
 _obj
@@ -30,9 +33,6 @@ __pycache__/
 *.py[cod]
 *$py.class
 
-# C extensions
-*.so
-
 # Distribution / packaging
 .Python
 env/

+ 4 - 1
app/cmd/events/etc/events.yaml

@@ -12,8 +12,11 @@ Log:
 #双胞胎服务
 GtServerIp: 47.96.12.136:8788
 
+RabbitMQ:
+  Url: amqp://admin:devmq*1120@47.96.12.136:5672/
+
 DtDataStoreDB:
-  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(192.168.60.201:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
+  DataSource: ws_data:c712f89fc4f8edaf30e41b828f4e3d26@tcp(172.16.0.194:4000)/ws_data?charset=utf8mb4&parseTime=True&loc=&loc=Asia%2FShanghai
 
 Redis:
   Host: 47.96.12.136:6379

+ 1 - 1
app/cmd/events/events.go

@@ -3,9 +3,9 @@ package main
 import (
 	"GtDataStore/app/cmd/events/internal/logic/handler"
 	"GtDataStore/app/cmd/events/internal/logic/job"
-	"GtDataStore/common/envitem"
 	"flag"
 	"fmt"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/envitem"
 
 	"GtDataStore/app/cmd/events/internal/config"
 	"GtDataStore/app/cmd/events/internal/svc"

+ 4 - 0
app/cmd/events/internal/config/config.go

@@ -15,4 +15,8 @@ type Config struct {
 	Cache cache.CacheConf
 
 	GtServerIp string
+
+	RabbitMQ struct {
+		Url string
+	}
 }

+ 18 - 8
app/cmd/events/internal/logic/handler/event.go

@@ -8,11 +8,27 @@ import (
 	"fmt"
 	"github.com/go-redis/redis/v8"
 	"github.com/zeromicro/go-zero/core/logx"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/rabbitMQ"
 	"time"
 )
 
 func HandlerEventNotify(svcCtx *svc.ServiceContext) error {
+	var err error
+	producter, err = rabbitMQ.NewProducter(rabbitMQ.Exchange{
+		Name:      "gt.dc.event",
+		Type:      "fanout",
+		QueueName: "",
+		Key:       "",
+		Dns:       svcCtx.Config.RabbitMQ.Url,
+	})
+
+	if err != nil {
+		return err
+	}
+
+	defer producter.Close()
 	defer close(eventChan)
+
 	fmt.Print("start HandlerEventNotify.....\n")
 	queue := svcCtx.Cache
 
@@ -30,14 +46,8 @@ func HandlerEventNotify(svcCtx *svc.ServiceContext) error {
 func toMQ(queue *redis.Client, info eventInfo) {
 	channel := fmt.Sprintf(EVTNE_NOTIFY_KEY_FORMAT, info.ProjectId, info.EventName)
 	if bs, err := json.Marshal(info); err == nil {
-		//queue.XAdd(context.Background(), &redis.XAddArgs{
-		//	Stream: channel,
-		//	MaxLen: 5000,
-		//	Values: ``,
-		//})
-
-		if intCmd := queue.Publish(context.Background(), channel, string(bs)); intCmd == nil {
-			logx.Errorf("handlerEvent queue.Publish toMQ error: %s %+v", channel, info)
+		if err := producter.Publisher(channel, bs); err == nil {
+			logx.Errorf("handlerEvent queue.Publish toMQ ok: %s %+v", channel, info)
 		}
 	} else {
 		logx.Errorf("handlerEvent queue.Publish toMQ error: %s %+v", channel, info)

+ 9 - 2
app/cmd/events/internal/logic/handler/single.go

@@ -4,12 +4,12 @@ import (
 	"GtDataStore/app/cmd/events/internal/logic/job"
 	"GtDataStore/app/cmd/events/internal/svc"
 	"GtDataStore/app/model"
-	"GtDataStore/common/envitem"
-	"GtDataStore/common/identify"
 	"context"
 	"errors"
 	"fmt"
 	"github.com/zeromicro/go-zero/core/logx"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/envitem"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/identify"
 	"sync"
 )
 
@@ -47,7 +47,14 @@ func EventSingle(ctx context.Context, task *job.Task, technologyName string) err
 			checker := identify.NewSingleCheck(map[string]identify.Rule{bind.Name: bind.Config})
 			name := checker.Check(ov, nv)
 			println(fmt.Sprintf("ov: %s nv: %s event: %s name", ov, nv, name))
+
 			if name != "" {
+				ht := item.GetItemHtime()
+				if ht == nil {
+					println(fmt.Sprintf("htime is nil ov: %s nv: %s event: %s name", ov, nv, name))
+					return
+				}
+
 				eventChan <- eventInfo{
 					ProjectId:  bind.ProjectId,
 					DeviceCode: bind.DeviceCode,

+ 2 - 0
app/cmd/events/internal/logic/handler/vars.go

@@ -3,6 +3,7 @@ package handler
 import (
 	"GtDataStore/app/cmd/events/internal/logic/job"
 	"context"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/rabbitMQ"
 	"time"
 )
 
@@ -31,6 +32,7 @@ type (
 
 var (
 	eventChan chan eventInfo
+	producter *rabbitMQ.Producter
 
 	EventIntervalTable = map[string]time.Duration{
 		EVENT_SINGLE_ITEM: 1 * time.Second,

+ 1 - 1
app/cmd/organization/organization.go

@@ -6,11 +6,11 @@ import (
 	"GtDataStore/app/cmd/organization/internal/logic/job"
 	"GtDataStore/app/cmd/organization/internal/server"
 	"GtDataStore/app/cmd/organization/pb"
-	"GtDataStore/common/envitem"
 	"github.com/zeromicro/go-zero/core/service"
 	"github.com/zeromicro/go-zero/zrpc"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc/reflection"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/envitem"
 
 	//"GtDataStore/app/cmd/organization/internal/server"
 	"GtDataStore/app/cmd/organization/internal/svc"

+ 2 - 3
app/model/dcDeviceBindModel_gen.go

@@ -6,13 +6,12 @@ import (
 	"context"
 	"database/sql"
 	"fmt"
-	"gtlib.local/gaoyagang/gt-common/envitem"
-	"strings"
-
 	"github.com/zeromicro/go-zero/core/stores/builder"
 	"github.com/zeromicro/go-zero/core/stores/sqlc"
 	"github.com/zeromicro/go-zero/core/stores/sqlx"
 	"github.com/zeromicro/go-zero/core/stringx"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/envitem"
+	"strings"
 )
 
 var (

+ 1 - 1
app/model/dcEventBindModel_gen.go

@@ -3,10 +3,10 @@
 package model
 
 import (
-	"GtDataStore/common/identify"
 	"context"
 	"database/sql"
 	"fmt"
+	"metawant.greentech.com.cn/gaoyagang/gt-common/identify"
 	"strings"
 	"time"
 

+ 0 - 336
common/envitem/func.go

@@ -1,336 +0,0 @@
-package envitem
-
-import (
-	"GtDataStore/common/httplib"
-	"context"
-	"database/sql/driver"
-	"encoding/json"
-	"errors"
-	"fmt"
-	"strconv"
-	"strings"
-	"time"
-)
-
-func SetOptions(options Options) {
-	snapUrl = fmt.Sprintf("http://%s/api/v1/plc-current", options.GtServerIp)
-	ctlUrl = fmt.Sprintf("http://%s/api/v1/plc/set-var-values", options.GtServerIp)
-
-	if options.Cache != nil {
-		cache = options.Cache
-	}
-}
-
-func (m MultiEnvItem) GetProjectId() int64 {
-	for _, item := range m {
-		return item.ProjectId
-	}
-	return 0
-}
-
-func (m MultiEnvItem) getItemNames() []string {
-	items := make([]string, 0)
-	for _, item := range m {
-		items = append(items, item.Item)
-	}
-	return items
-}
-
-func (m MultiEnvItem) FillCurrentValue() error {
-	datas, err := m.getCurrentData()
-	if err != nil {
-		return err
-	}
-	// 先做一个item -> key的映射
-	ikm := make(map[string]string)
-	for s, item := range m {
-		ikm[item.Item] = s
-	}
-
-	for _, data := range datas {
-		if k, ok := ikm[data.ItemName]; ok {
-			m[k].Value = data.Val
-			m[k].Htime = data.HTime
-			_ = m[k].setPrevValue()
-		}
-	}
-	return nil
-}
-
-func (m MultiEnvItem) GetItemFloat64Value(key string) float64 {
-	if envItem, ok := m[key]; ok {
-		return envItem.GetItemFloat64Val()
-	}
-	return 0
-}
-
-func (m MultiEnvItem) GetItemInt64Value(key string) int64 {
-	if envItem, ok := m[key]; ok {
-		return envItem.GetItemInt64Val()
-	}
-	return 0
-}
-
-func (m MultiEnvItem) GetItemStringValue(key string) string {
-	if envItem, ok := m[key]; ok {
-		return envItem.GetItemStringVal()
-	}
-	return ""
-}
-
-func (m MultiEnvItem) GetItemHtime(key string) *time.Time {
-	if envItem, ok := m[key]; ok {
-		return envItem.GetItemHtime()
-	}
-	return nil
-}
-
-func (m MultiEnvItem) FindString() map[string]string {
-	a := make(map[string]string)
-	for _, item := range m {
-		a[item.Item] = item.Value.(string)
-	}
-
-	return a
-}
-
-func (m MultiEnvItem) FindPrevString() map[string]string {
-	a := make(map[string]string)
-	for _, item := range m {
-		a[item.Item] = item.GetItemPrevStringVal()
-	}
-
-	return a
-}
-
-func (m MultiEnvItem) getCurrentData() ([]*ItemValueResp, error) {
-	req := httplib.Post(snapUrl)
-	data := make([]*ItemValueReq, 1)
-
-	data[0] = &ItemValueReq{
-		DeviceItems: strings.Join(m.getItemNames(), ","),
-		ProjectId:   m.GetProjectId(),
-	}
-
-	jsonBytes, err := json.Marshal(data)
-	if err != nil {
-		return nil, err
-	}
-	req.Body(jsonBytes)
-	req.SetTimeout(time.Millisecond * 2000)
-
-	r, err := req.Response()
-	if err != nil {
-		return nil, err
-	}
-	defer r.Body.Close()
-
-	if r.StatusCode == 200 {
-		resp, err := req.Bytes()
-		if err != nil {
-			return nil, err
-		}
-
-		res := &ItemValueResps{}
-		err = json.Unmarshal(resp, res)
-		if err != nil {
-			return nil, err
-		}
-
-		if len(res.Data) == 0 {
-			return nil, errors.New("not found envitem's value")
-		}
-
-		return res.Data, nil
-	}
-
-	return nil, errors.New(fmt.Sprintf("request statusCode: %d", r.StatusCode))
-}
-
-func (e *EnvItem) getCurrentData() (*ItemValueResp, error) {
-	req := httplib.Post(snapUrl)
-	data := make([]*ItemValueReq, 1)
-
-	data[0] = &ItemValueReq{
-		DeviceItems: e.Item,
-		ProjectId:   e.ProjectId,
-	}
-
-	jsonBytes, err := json.Marshal(data)
-	if err != nil {
-		return nil, err
-	}
-	req.Body(jsonBytes)
-	req.SetTimeout(time.Millisecond * 2000)
-
-	r, err := req.Response()
-	if err != nil {
-		return nil, err
-	}
-	defer r.Body.Close()
-
-	if r.StatusCode == 200 {
-		resp, err := req.Bytes()
-		if err != nil {
-			return nil, err
-		}
-
-		res := &ItemValueResps{}
-		err = json.Unmarshal(resp, res)
-		if err != nil {
-			return nil, err
-		}
-
-		if len(res.Data) == 0 {
-			return nil, errors.New("not found envitem's value")
-		}
-
-		return res.Data[0], nil
-	}
-
-	return nil, errors.New(fmt.Sprintf("request statusCode: %d", r.StatusCode))
-}
-
-func (e *EnvItem) getCurrentValue() (string, string, error) {
-	resp, err := e.getCurrentData()
-	if err != nil {
-		return "", "", err
-	}
-
-	e.Value = resp.Val
-	e.Htime = resp.HTime
-	_ = e.setPrevValue()
-
-	return resp.Val, resp.HTime, nil
-}
-
-func (e *EnvItem) getPrevValue() (string, string, error) {
-	if cache == nil {
-		return "", "", errors.New("not cache")
-	}
-	key := fmt.Sprintf(CACHE_PREV_VALUE_KEY, e.ProjectId, e.Item)
-	if cmd := cache.Get(context.Background(), key); cmd != nil {
-		n := strings.Split(cmd.Val(), "|")
-		if len(n) != 2 {
-			return "", "", errors.New("getPrevValue cache length error")
-		}
-		return n[0], n[1], nil
-	} else {
-		return "", "", cmd.Err()
-	}
-}
-
-func (e *EnvItem) setPrevValue() error {
-	if cache == nil {
-		return errors.New("not cache")
-	}
-	key := fmt.Sprintf(CACHE_PREV_VALUE_KEY, e.ProjectId, e.Item)
-	value := fmt.Sprintf("%s|%s", e.Value, e.Htime)
-	if statusCmd := cache.Set(context.Background(), key, value, CACHE_PREV_VALUE_KEY_EXPIRE); statusCmd != nil {
-		return nil
-	} else {
-		return errors.New("setPrevValue error")
-	}
-}
-
-func (e *EnvItem) GetItemFloat64Val() float64 {
-	if e.Value == nil {
-		e.getCurrentValue()
-	}
-
-	switch e.Value.(type) {
-	case string:
-		if v, e := strconv.ParseFloat(e.Value.(string), 64); e == nil {
-			return v
-		}
-	}
-
-	return 0
-}
-
-func (e *EnvItem) GetItemInt64Val() int64 {
-	if e.Value == nil {
-		e.getCurrentValue()
-	}
-
-	switch e.Value.(type) {
-	case string:
-		if v, e := strconv.ParseInt(e.Value.(string), 10, 64); e == nil {
-			return v
-		}
-	}
-
-	return 0
-}
-
-func (e *EnvItem) GetItemStringVal() string {
-	if e.Value == nil {
-		e.getCurrentValue()
-	}
-
-	if v, ok := e.Value.(string); ok {
-		return v
-	}
-
-	return ""
-}
-
-func (e *EnvItem) GetItemHtime() *time.Time {
-	if e.Value == nil {
-		e.getCurrentValue()
-	}
-
-	if ht, err := time.ParseInLocation("2006-01-02 15:04:05", e.Htime, time.Local); err == nil {
-		return &ht
-	}
-	return nil
-}
-
-func (e *EnvItem) GetItemPrevFloat64Val() float64 {
-	ov, _, err := e.getPrevValue()
-	if err != nil {
-		return 0
-	}
-
-	if v, err := strconv.ParseFloat(ov, 64); err == nil {
-		return v
-	}
-
-	return 0
-}
-
-func (e *EnvItem) GetItemPrevInt64Val() int64 {
-	ov, _, err := e.getPrevValue()
-	if err != nil {
-		return 0
-	}
-
-	if v, err := strconv.ParseInt(ov, 10, 64); err == nil {
-		return v
-	}
-
-	return 0
-}
-
-func (e *EnvItem) GetItemPrevStringVal() string {
-	ov, _, _ := e.getPrevValue()
-	return ov
-}
-
-func (e *EnvItem) GetItemPrevHtime() *time.Time {
-	_, ht, _ := e.getPrevValue()
-	if t, err := time.ParseInLocation("2006-01-02 15:04:05", ht, time.Local); err == nil {
-		return &t
-	}
-	return nil
-}
-
-// Scan 实现方法
-func (d *MultiEnvItem) Scan(input interface{}) error {
-	_ = json.Unmarshal(input.([]byte), &d)
-	return nil
-}
-
-func (d MultiEnvItem) Value() (driver.Value, error) {
-	return json.Marshal(d)
-}

+ 0 - 78
common/envitem/func_test.go

@@ -1,78 +0,0 @@
-package envitem
-
-import (
-	"encoding/json"
-	"testing"
-	"time"
-)
-
-func TestEnvItem_GetCurrentData(t *testing.T) {
-	SetOptions(Options{GtServerIp: "47.96.12.136:8788"})
-	e := EnvItem{
-		ProjectId: 92,
-		Item:      "C.M.LT_CIP@out,C.M.RO1_DB@time_CS_display",
-	}
-
-	v, ht, err := e.getCurrentValue()
-
-	t.Log(v, ht, err)
-
-}
-
-func TestMultiEnvItem_FillCurrentValue(t *testing.T) {
-	SetOptions(Options{GtServerIp: "47.96.12.136:8788"})
-	m := make(MultiEnvItem, 2)
-	m["C.M.LT_CIP@out"] = &EnvItem{
-		ProjectId: 92,
-		Item:      "C.M.LT_CIP@out",
-	}
-	m["C.M.RO1_DB@time_CS_display"] = &EnvItem{
-		ProjectId: 92,
-		Item:      "C.M.RO1_DB@time_CS_display",
-	}
-
-	err := m.FillCurrentValue()
-	t.Log(err)
-
-	for s, item := range m {
-		t.Logf("item: %s value: %s htime: %s", s, item.Value, item.Htime)
-	}
-}
-
-func TestMultiEnvItem_FillCurrentValue2(t *testing.T) {
-	SetOptions(Options{GtServerIp: "47.96.12.136:8788"})
-	js := `{"tmp":{"project_id":92,"device_code":"UF-4001A","plc_device_id":"0","item":"C.M.UF1_DB@press_PV","default_val":0},"feed_flow":{"project_id":92,"device_code":"UF-4001A","plc_device_id":"0","item":"C.M.UF1_FT_JS@out","default_val":0},"feed_pressure":{"project_id":92,"device_code":"UF-4001A","plc_device_id":"0","item":"C.M.UF1_PT_JS@out","default_val":0},"product_pressure":{"project_id":92,"device_code":"UF-4001A","plc_device_id":"0","item":"C.M.UF1_PT_CS@out","default_val":0},"feed_wq_turbidity":{"project_id":92,"device_code":"AIT-94061","plc_device_id":"0","item":"C.M.UF_Tur_ZJS@out","default_val":0},"water_temperature":{"project_id":92,"device_code":"TIT-34061","plc_device_id":"0","item":"C.M.RO_TT_ZJS@out","default_val":0},"product_wq_ph":{"project_id":92,"device_code":"AIT-95065b","plc_device_id":"0","item":"C.M.UF_PH_ZCS@out","default_val":0},"step":{"project_id":92,"device_code":"HB","plc_device_id":"0","item":"C.M.UF1_DB@word_control","default_val":0}}`
-	var multiEnvItems MultiEnvItem
-
-	_ = json.Unmarshal([]byte(js), &multiEnvItems)
-
-	t.Log(multiEnvItems)
-
-	for {
-		_ = multiEnvItems.FillCurrentValue()
-		time.Sleep(2 * time.Second)
-
-		//ms := multiEnvItems.FindString()
-
-		t.Logf("%+v", multiEnvItems)
-
-		t.Logf("step: %d", multiEnvItems.GetItemInt64Value("step"))
-		//early := checkEarly(multiEnvItems.GetItemFloat64Value("Display_Time"), multiEnvItems.GetItemFloat64Value("Filter_Time_Set"), multiEnvItems.GetItemStringValue("Step"))
-		//advanced := checkAdvanced(multiEnvItems.GetItemFloat64Value("Display_Time"), multiEnvItems.GetItemFloat64Value("Filter_Time_Set"), multiEnvItems.GetItemStringValue("Step"))
-		//
-		//t.Logf("early: %v, advanced: %v, step: %s filterNumber: %s Display_Time: %s Filter_Time_Set: %s", early, advanced, multiEnvItems.GetItemStringValue("Step"), multiEnvItems.GetItemStringValue("Filter_Number"), multiEnvItems.GetItemStringValue("Display_Time"), multiEnvItems.GetItemStringValue("Filter_Time_Set"))
-		//t.Log(err)
-		//for s, item := range multiEnvItems {
-		//	t.Logf("item: %s value: %s htime: %s", s, item.Value, item.Htime)
-		//}
-	}
-
-}
-
-func checkEarly(ft, fst float64, step string) bool {
-	return step == "26" && ft >= 360 && ft <= 660
-}
-
-func checkAdvanced(ft, fst float64, step string) bool {
-	return step == "26" && ft+360 >= fst && ft+60 <= fst
-}

+ 0 - 48
common/envitem/types.go

@@ -1,48 +0,0 @@
-package envitem
-
-import "github.com/go-redis/redis/v8"
-
-type (
-	Options struct {
-		GtServerIp string
-		Cache      *redis.Client
-	}
-
-	EnvItem struct {
-		ProjectId   int64       `json:"project_id"`
-		DeviceCode  string      `json:"device_code"`
-		PlcDeviceId string      `json:"plc_device_id"`
-		Item        string      `json:"item"`
-		DefaultVal  interface{} `json:"default_val"`
-		Value       interface{} `json:"value"`
-		Htime       string      `json:"htime"`
-	}
-
-	MultiEnvItem map[string]*EnvItem
-
-	ItemValueResp struct {
-		Alias        string `json:"alias"`
-		DataAddress  string `json:"dataAddress"`
-		DataType     string `json:"datatype"`
-		DevName      string `json:"devName"`
-		DevID        string `json:"devid"`
-		HTime        string `json:"htime"`
-		ItemID       string `json:"itemid"`
-		ItemName     string `json:"itemname"`
-		Quality      string `json:"quality"`
-		ReadOnly     bool   `json:"readOnly"`
-		SpecificType string `json:"specificType"`
-		Val          string `json:"val"`
-	}
-
-	ItemValueResps struct {
-		Code int              `json:"code"`
-		Data []*ItemValueResp `json:"data"`
-	}
-
-	ItemValueReq struct {
-		DeviceId    string `json:"deviceId"`
-		DeviceItems string `json:"deviceItems"`
-		ProjectId   int64  `json:"project_id"`
-	}
-)

+ 0 - 17
common/envitem/vars.go

@@ -1,17 +0,0 @@
-package envitem
-
-import (
-	"github.com/go-redis/redis/v8"
-	"time"
-)
-
-const (
-	CACHE_PREV_VALUE_KEY        = "envitem:prev:value:%d:%s"
-	CACHE_PREV_VALUE_KEY_EXPIRE = 86400 * time.Second
-)
-
-var (
-	snapUrl = ""
-	ctlUrl  = ""
-	cache   *redis.Client
-)

+ 0 - 576
common/httplib/httplib.go

@@ -1,576 +0,0 @@
-// Copyright 2014 beego Author. All Rights Reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//      http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// copy & modify from github.com/astaxie/beego/tree/master/httplib
-
-package httplib
-
-import (
-	"bytes"
-	"compress/gzip"
-	"crypto/tls"
-	"encoding/json"
-	"encoding/xml"
-	"io"
-	"io/ioutil"
-	"log"
-	"mime/multipart"
-	"net"
-	"net/http"
-	"net/http/cookiejar"
-	"net/http/httputil"
-	"net/url"
-	"os"
-	"strings"
-	"sync"
-	"time"
-)
-
-var defaultSetting = HTTPSettings{
-	//UserAgent:      "smart-push",
-	Gzip:           true,
-	DumpBody:       true,
-	ConnectTimeout: time.Second * 30,
-	KeepAlive:      time.Second * 60,
-	Transport: &http.Transport{
-		DialContext: (&net.Dialer{
-			Timeout:   time.Second * 30,
-			KeepAlive: time.Second * 60,
-		}).DialContext,
-		MaxIdleConnsPerHost: 3000,
-		MaxIdleConns:        30000,
-	},
-}
-
-var defaultCookieJar http.CookieJar
-var settingMutex sync.Mutex
-
-// createDefaultCookie creates a global cookiejar to store cookies.
-func createDefaultCookie() {
-	settingMutex.Lock()
-	defer settingMutex.Unlock()
-	defaultCookieJar, _ = cookiejar.New(nil)
-}
-
-// SetDefaultSetting Overwrite default settings
-func SetDefaultSetting(setting HTTPSettings) {
-	settingMutex.Lock()
-	defer settingMutex.Unlock()
-	defaultSetting = setting
-}
-
-// NewBeegoRequest return *HTTPRequest with specific method
-func NewHTTPRequest(rawurl, method string) *HTTPRequest {
-	var resp http.Response
-	u, err := url.Parse(rawurl)
-	if err != nil {
-		log.Println("Httplib:", err)
-	}
-	req := http.Request{
-		URL:        u,
-		Method:     method,
-		Header:     make(http.Header),
-		Proto:      "HTTP/1.1",
-		ProtoMajor: 1,
-		ProtoMinor: 1,
-	}
-	return &HTTPRequest{
-		url:     rawurl,
-		req:     &req,
-		params:  map[string][]string{},
-		files:   map[string]string{},
-		setting: defaultSetting,
-		resp:    &resp,
-	}
-}
-
-// Get returns *HTTPRequest with GET method.
-func Get(url string) *HTTPRequest {
-	return NewHTTPRequest(url, "GET")
-}
-
-// Post returns *HTTPRequest with POST method.
-func Post(url string) *HTTPRequest {
-	return NewHTTPRequest(url, "POST")
-}
-
-// Put returns *HTTPRequest with PUT method.
-func Put(url string) *HTTPRequest {
-	return NewHTTPRequest(url, "PUT")
-}
-
-// Delete returns *HTTPRequest DELETE method.
-func Delete(url string) *HTTPRequest {
-	return NewHTTPRequest(url, "DELETE")
-}
-
-// Head returns *HTTPRequest with HEAD method.
-func Head(url string) *HTTPRequest {
-	return NewHTTPRequest(url, "HEAD")
-}
-
-// HTTPSettings is the http.Client setting
-type HTTPSettings struct {
-	ShowDebug       bool
-	UserAgent       string
-	TLSClientConfig *tls.Config
-	Proxy           func(*http.Request) (*url.URL, error)
-	Transport       http.RoundTripper
-	CheckRedirect   func(req *http.Request, via []*http.Request) error
-	EnableCookie    bool
-	Gzip            bool
-	DumpBody        bool
-	Retries         int // if set to -1 means will retry forever
-	ConnectTimeout  time.Duration
-	KeepAlive       time.Duration
-	Timeout         time.Duration
-}
-
-// HTTPRequest provides more useful methods for requesting one url than http.Request.
-type HTTPRequest struct {
-	url     string
-	req     *http.Request
-	params  map[string][]string
-	files   map[string]string
-	setting HTTPSettings
-	resp    *http.Response
-	body    []byte
-	dump    []byte
-
-	client *http.Client
-}
-
-// GetRequest return the request object
-func (b *HTTPRequest) GetRequest() *http.Request {
-	return b.req
-}
-
-// Setting Change request settings
-func (b *HTTPRequest) Setting(setting HTTPSettings) *HTTPRequest {
-	b.setting = setting
-	return b
-}
-
-// SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.
-func (b *HTTPRequest) SetBasicAuth(username, password string) *HTTPRequest {
-	b.req.SetBasicAuth(username, password)
-	return b
-}
-
-// SetEnableCookie sets enable/disable cookiejar
-func (b *HTTPRequest) SetEnableCookie(enable bool) *HTTPRequest {
-	b.setting.EnableCookie = enable
-	return b
-}
-
-// SetUserAgent sets User-Agent header field
-func (b *HTTPRequest) SetUserAgent(useragent string) *HTTPRequest {
-	b.setting.UserAgent = useragent
-	return b
-}
-
-// Debug sets show debug or not when executing request.
-func (b *HTTPRequest) Debug(isdebug bool) *HTTPRequest {
-	b.setting.ShowDebug = isdebug
-	return b
-}
-
-// Retries sets Retries times.
-// default is 0 means no retried.
-// -1 means retried forever.
-// others means retried times.
-func (b *HTTPRequest) Retries(times int) *HTTPRequest {
-	b.setting.Retries = times
-	return b
-}
-
-// DumpBody setting whether need to Dump the Body.
-func (b *HTTPRequest) DumpBody(isdump bool) *HTTPRequest {
-	b.setting.DumpBody = isdump
-	return b
-}
-
-// DumpRequest return the DumpRequest
-func (b *HTTPRequest) DumpRequest() []byte {
-	return b.dump
-}
-
-// SetTimeout sets connect time out and read-write time out for BeegoRequest.
-func (b *HTTPRequest) SetTimeout(timeout time.Duration) *HTTPRequest {
-	b.setting.Timeout = timeout
-	return b
-}
-
-// SetTLSClientConfig sets tls connection configurations if visiting https url.
-func (b *HTTPRequest) SetTLSClientConfig(config *tls.Config) *HTTPRequest {
-	b.setting.TLSClientConfig = config
-	return b
-}
-
-// Header add header item string in request.
-func (b *HTTPRequest) Header(key, value string) *HTTPRequest {
-	b.req.Header.Set(key, value)
-	return b
-}
-
-// SetHost set the request host
-func (b *HTTPRequest) SetHost(host string) *HTTPRequest {
-	b.req.Host = host
-	return b
-}
-
-// SetProtocolVersion Set the protocol version for incoming requests.
-// Client requests always use HTTP/1.1.
-func (b *HTTPRequest) SetProtocolVersion(vers string) *HTTPRequest {
-	if len(vers) == 0 {
-		vers = "HTTP/1.1"
-	}
-
-	major, minor, ok := http.ParseHTTPVersion(vers)
-	if ok {
-		b.req.Proto = vers
-		b.req.ProtoMajor = major
-		b.req.ProtoMinor = minor
-	}
-
-	return b
-}
-
-// SetCookie add cookie into request.
-func (b *HTTPRequest) SetCookie(cookie *http.Cookie) *HTTPRequest {
-	b.req.Header.Add("Cookie", cookie.String())
-	return b
-}
-
-// SetTransport set the setting transport
-func (b *HTTPRequest) SetTransport(transport http.RoundTripper) *HTTPRequest {
-	b.setting.Transport = transport
-	return b
-}
-
-// SetProxy set the http proxy
-// example:
-//
-//	func(req *http.Request) (*url.URL, error) {
-// 		u, _ := url.ParseRequestURI("http://127.0.0.1:8118")
-// 		return u, nil
-// 	}
-func (b *HTTPRequest) SetProxy(proxy func(*http.Request) (*url.URL, error)) *HTTPRequest {
-	b.setting.Proxy = proxy
-	return b
-}
-
-// SetCheckRedirect specifies the policy for handling redirects.
-//
-// If CheckRedirect is nil, the Client uses its default policy,
-// which is to stop after 10 consecutive requests.
-func (b *HTTPRequest) SetCheckRedirect(redirect func(req *http.Request, via []*http.Request) error) *HTTPRequest {
-	b.setting.CheckRedirect = redirect
-	return b
-}
-
-// Param adds query param in to request.
-// params build query string as ?key1=value1&key2=value2...
-func (b *HTTPRequest) Param(key, value string) *HTTPRequest {
-	if param, ok := b.params[key]; ok {
-		b.params[key] = append(param, value)
-	} else {
-		b.params[key] = []string{value}
-	}
-	return b
-}
-
-// PostFile add a post file to the request
-func (b *HTTPRequest) PostFile(formname, filename string) *HTTPRequest {
-	b.files[formname] = filename
-	return b
-}
-
-// Body adds request raw body.
-// it supports string and []byte.
-func (b *HTTPRequest) Body(data interface{}) *HTTPRequest {
-	switch t := data.(type) {
-	case string:
-		bf := bytes.NewBufferString(t)
-		b.req.Body = ioutil.NopCloser(bf)
-		b.req.ContentLength = int64(len(t))
-	case []byte:
-		bf := bytes.NewBuffer(t)
-		b.req.Body = ioutil.NopCloser(bf)
-		b.req.ContentLength = int64(len(t))
-	}
-	return b
-}
-
-// JSONBody adds request raw body encoding by JSON.
-func (b *HTTPRequest) JSONBody(obj interface{}) (*HTTPRequest, error) {
-	if b.req.Body == nil && obj != nil {
-		byts, err := json.Marshal(obj)
-		if err != nil {
-			return b, err
-		}
-		b.req.Body = ioutil.NopCloser(bytes.NewReader(byts))
-		b.req.ContentLength = int64(len(byts))
-		b.req.Header.Set("Content-Type", "application/json")
-	}
-	return b, nil
-}
-
-func (b *HTTPRequest) buildURL(paramBody string) {
-	// build GET url with query string
-	if b.req.Method == "GET" && len(paramBody) > 0 {
-		if strings.Contains(b.url, "?") {
-			b.url += "&" + paramBody
-		} else {
-			b.url = b.url + "?" + paramBody
-		}
-		return
-	}
-
-	// build POST/PUT/PATCH url and body
-	if (b.req.Method == "POST" || b.req.Method == "PUT" || b.req.Method == "PATCH" || b.req.Method == "DELETE") && b.req.Body == nil {
-		// with files
-		if len(b.files) > 0 {
-			pr, pw := io.Pipe()
-			bodyWriter := multipart.NewWriter(pw)
-			go func() {
-				for formname, filename := range b.files {
-					fileWriter, err := bodyWriter.CreateFormFile(formname, filename)
-					if err != nil {
-						log.Println("Httplib:", err)
-					}
-					fh, err := os.Open(filename)
-					if err != nil {
-						log.Println("Httplib:", err)
-					}
-					//iocopy
-					_, err = io.Copy(fileWriter, fh)
-					fh.Close()
-					if err != nil {
-						log.Println("Httplib:", err)
-					}
-				}
-				for k, v := range b.params {
-					for _, vv := range v {
-						bodyWriter.WriteField(k, vv)
-					}
-				}
-				bodyWriter.Close()
-				pw.Close()
-			}()
-			b.Header("Content-Type", bodyWriter.FormDataContentType())
-			b.req.Body = ioutil.NopCloser(pr)
-			return
-		}
-
-		// with params
-		if len(paramBody) > 0 {
-			b.Header("Content-Type", "application/x-www-form-urlencoded")
-			b.Body(paramBody)
-		}
-	}
-}
-
-func (b *HTTPRequest) getResponse() (*http.Response, error) {
-	if b.resp.StatusCode != 0 {
-		return b.resp, nil
-	}
-	resp, err := b.DoRequest()
-	if err != nil {
-		return nil, err
-	}
-	b.resp = resp
-	return resp, nil
-}
-
-// DoRequest will do the client.Do
-func (b *HTTPRequest) DoRequest() (resp *http.Response, err error) {
-	var paramBody string
-	if len(b.params) > 0 {
-		var buf bytes.Buffer
-		for k, v := range b.params {
-			for _, vv := range v {
-				buf.WriteString(url.QueryEscape(k))
-				buf.WriteByte('=')
-				buf.WriteString(url.QueryEscape(vv))
-				buf.WriteByte('&')
-			}
-		}
-		paramBody = buf.String()
-		paramBody = paramBody[0 : len(paramBody)-1]
-	}
-
-	b.buildURL(paramBody)
-	url, err := url.Parse(b.url)
-	if err != nil {
-		return nil, err
-	}
-
-	b.req.URL = url
-
-	trans := b.setting.Transport
-
-	if trans == nil {
-		// create default transport
-		trans = &http.Transport{
-			TLSClientConfig: b.setting.TLSClientConfig,
-			Proxy:           b.setting.Proxy,
-			DialContext: (&net.Dialer{
-				Timeout:   b.setting.ConnectTimeout,
-				KeepAlive: b.setting.KeepAlive,
-			}).DialContext,
-			MaxIdleConnsPerHost: -1,
-		}
-	} else {
-		// if b.transport is *http.Transport then set the settings.
-		if t, ok := trans.(*http.Transport); ok {
-			if t.TLSClientConfig == nil {
-				t.TLSClientConfig = b.setting.TLSClientConfig
-			}
-			if t.Proxy == nil {
-				t.Proxy = b.setting.Proxy
-			}
-			if t.DialContext == nil {
-				t.DialContext = (&net.Dialer{
-					Timeout:   b.setting.ConnectTimeout,
-					KeepAlive: b.setting.KeepAlive,
-				}).DialContext
-			}
-		}
-	}
-
-	var jar http.CookieJar
-	if b.setting.EnableCookie {
-		if defaultCookieJar == nil {
-			createDefaultCookie()
-		}
-		jar = defaultCookieJar
-	}
-
-	client := &http.Client{
-		Transport: trans,
-		Jar:       jar,
-	}
-
-	client.Timeout = b.setting.Timeout
-
-	if b.setting.UserAgent != "" && b.req.Header.Get("User-Agent") == "" {
-		b.req.Header.Set("User-Agent", b.setting.UserAgent)
-	}
-
-	if b.setting.CheckRedirect != nil {
-		client.CheckRedirect = b.setting.CheckRedirect
-	}
-
-	if b.setting.ShowDebug {
-		dump, err := httputil.DumpRequest(b.req, b.setting.DumpBody)
-		if err != nil {
-			log.Println(err.Error())
-		}
-		b.dump = dump
-	}
-	// retries default value is 0, it will run once.
-	// retries equal to -1, it will run forever until success
-	// retries is setted, it will retries fixed times.
-	for i := 0; b.setting.Retries == -1 || i <= b.setting.Retries; i++ {
-		resp, err = client.Do(b.req)
-		if err == nil {
-			break
-		}
-	}
-	return resp, err
-}
-
-// String returns the body string in response.
-// it calls Response inner.
-func (b *HTTPRequest) String() (string, error) {
-	data, err := b.Bytes()
-	if err != nil {
-		return "", err
-	}
-
-	return string(data), nil
-}
-
-// Bytes returns the body []byte in response.
-// it calls Response inner.
-func (b *HTTPRequest) Bytes() ([]byte, error) {
-	if b.body != nil {
-		return b.body, nil
-	}
-	resp, err := b.getResponse()
-	if err != nil {
-		return nil, err
-	}
-	if resp.Body == nil {
-		return nil, nil
-	}
-	defer resp.Body.Close()
-	if b.setting.Gzip && resp.Header.Get("Content-Encoding") == "gzip" {
-		reader, err := gzip.NewReader(resp.Body)
-		if err != nil {
-			return nil, err
-		}
-		b.body, err = ioutil.ReadAll(reader)
-		return b.body, err
-	}
-	b.body, err = ioutil.ReadAll(resp.Body)
-	return b.body, err
-}
-
-// ToFile saves the body data in response to one file.
-// it calls Response inner.
-func (b *HTTPRequest) ToFile(filename string) error {
-	f, err := os.Create(filename)
-	if err != nil {
-		return err
-	}
-	defer f.Close()
-
-	resp, err := b.getResponse()
-	if err != nil {
-		return err
-	}
-	if resp.Body == nil {
-		return nil
-	}
-	defer resp.Body.Close()
-	_, err = io.Copy(f, resp.Body)
-	return err
-}
-
-// ToJSON returns the map that marshals from the body bytes as json in response .
-// it calls Response inner.
-func (b *HTTPRequest) ToJSON(v interface{}) error {
-	data, err := b.Bytes()
-	if err != nil {
-		return err
-	}
-	return json.Unmarshal(data, v)
-}
-
-// ToXML returns the map that marshals from the body bytes as xml in response .
-// it calls Response inner.
-func (b *HTTPRequest) ToXML(v interface{}) error {
-	data, err := b.Bytes()
-	if err != nil {
-		return err
-	}
-	return xml.Unmarshal(data, v)
-}
-
-// Response executes request client gets response mannually.
-func (b *HTTPRequest) Response() (*http.Response, error) {
-	return b.getResponse()
-}

+ 0 - 221
common/identify/single.go

@@ -1,221 +0,0 @@
-package identify
-
-import (
-	"encoding/json"
-	"strconv"
-	"strings"
-)
-
-// SingleItem Nv和Ov的组合规则:
-// 1. Nv是什么 || Nv不是什么
-// 2. Ov是什么 || Ov不是什么
-//
-// 1与2的布尔运行结果交叉后, 得到4种组合 00, 01, 10, 11.
-// 一个事件的判断, 就处在[00, 01, 10, 11]的其中, 有一项为nil, 则表示该项直接通过
-// 多个事件, 就判断多个[00, 01, 10, 11], 所以得出以下结论:
-// 针对设备配置如下规则:
-//
-//	{
-//			"EventName 1": {
-//	          "NvIn": [1,2,3,4],
-//	          "NvNotIn": [5,6,7,8],
-//	          "OvIn": [1,2,3,4],
-//			  "OvNotIn": [5,6,7,8],
-//			},
-//			"EventName 2": {
-//	          "NvIn": [1,2,3,4],
-//	          "NvNotIn": [5,6,7,8],
-//			  "OvNotIn": [5,6,7,8],
-//			},
-//	     ......
-//	}
-type SingleItem struct {
-	nv string // 当前值
-	ov string // 上一次的值
-
-	rules map[string]Rule
-}
-
-func (s *SingleItem) Check(ov, nv string) string {
-	defer func() {
-		s.nv = ""
-		s.ov = ""
-	}()
-	s.nv = nv
-	s.ov = ov
-	for event, rule := range s.rules {
-		if s.check(rule) {
-			return event
-		}
-	}
-	return ""
-}
-
-func (s *SingleItem) check(rule Rule) bool {
-	var ovIn, ovNotIn, nvIn, nvNotIn = true, true, true, true
-	if rule.OvIn != nil {
-		ovIn = s.ovIn(rule.OvIn)
-	}
-
-	if rule.OvNotIn != nil {
-		ovNotIn = s.ovNotIn(rule.OvNotIn)
-	}
-
-	if rule.NvIn != nil {
-		nvIn = s.nvIn(rule.NvIn)
-	}
-
-	if rule.NvNotIn != nil {
-		nvNotIn = s.nvNotIn(rule.NvNotIn)
-	}
-
-	return ovIn && ovNotIn && nvIn && nvNotIn
-}
-
-func (s *SingleItem) ovIn(slice []string) bool {
-	b := true
-	if slice != nil && s.inSlice(slice, s.ov) == false {
-		b = false
-	}
-	return b
-}
-
-func (s *SingleItem) ovNotIn(slice []string) bool {
-	b := true
-	if slice != nil && s.inSlice(slice, s.ov) == true {
-		b = false
-	}
-	return b
-}
-
-func (s *SingleItem) nvIn(slice []string) bool {
-	b := true
-	if slice != nil && s.inSlice(slice, s.nv) == false {
-		b = false
-	}
-	return b
-}
-
-func (s *SingleItem) nvNotIn(slice []string) bool {
-	b := true
-	if slice != nil && s.inSlice(slice, s.nv) == true {
-		b = false
-	}
-	return b
-}
-
-func (s *SingleItem) inSlice(slice []string, v string) bool {
-	for _, s2 := range slice {
-		s1 := s.transVar(s2)
-
-		if s1 == v {
-			return true
-		}
-		// 数字比较
-		if _, err := strconv.ParseInt(s1, 10, 64); err != nil {
-			return s.compare(s1, v)
-		}
-	}
-	return false
-}
-
-func (s *SingleItem) transVar(v string) string {
-	if v == VAR_NV {
-		v = s.nv
-	}
-
-	if v == VAR_OV {
-		v = s.ov
-	}
-	return v
-}
-
-func (s *SingleItem) compare(r string, v string) bool {
-	if strings.Index(r, "...") > -1 {
-		return s.compareRange(r, v)
-	} else if strings.Index(r, " ") > 1 {
-		return s.compareLogic(r, v)
-	}
-
-	return false
-}
-
-func (s *SingleItem) compareRange(r string, v string) bool {
-	rl := strings.Split(r, "...")
-	if len(rl) != 2 {
-		return false
-	}
-
-	var min, max, vi int64 = 0, 0, 0
-	if tmin, err := strconv.ParseInt(strings.TrimSpace(rl[0]), 10, 64); err == nil {
-		min = tmin
-	} else {
-		return false
-	}
-
-	if tmax, err := strconv.ParseInt(strings.TrimSpace(rl[1]), 10, 64); err == nil {
-		max = tmax
-	} else {
-		return false
-	}
-
-	if tvi, err := strconv.ParseInt(strings.TrimSpace(v), 10, 64); err == nil {
-		vi = tvi
-	} else {
-		return false
-	}
-
-	return min <= vi && vi <= max
-}
-
-func (s *SingleItem) compareLogic(r string, v string) bool {
-	rl := strings.Split(r, " ")
-	if len(rl) != 2 {
-		return false
-	}
-
-	var ri, vi int64 = 0, 0
-	if tri, err := strconv.ParseInt(strings.TrimSpace(rl[1]), 10, 64); err == nil {
-		ri = tri
-	} else {
-		return false
-	}
-
-	if tvi, err := strconv.ParseInt(strings.TrimSpace(v), 10, 64); err == nil {
-		vi = tvi
-	} else {
-		return false
-	}
-
-	switch rl[0] {
-	case "<":
-		return vi < ri
-	case "<=":
-		return vi <= ri
-	case ">":
-		return vi > ri
-	case ">=":
-		return vi >= ri
-	case "!=":
-		return vi != ri
-	}
-
-	return false
-}
-
-// NewSingleCheck 生成一个检测对象, 之后调用Check来获得事件名称
-func NewSingleCheck(rules map[string]Rule) *SingleItem {
-	return &SingleItem{
-		rules: rules,
-	}
-}
-
-func StepTest(ov, nv, ruleString string) string {
-	rules := make(map[string]Rule)
-	err := json.Unmarshal([]byte(ruleString), &rules)
-	if err != nil {
-		println(err.Error())
-	}
-
-	return NewSingleCheck(rules).Check(ov, nv)
-}

+ 0 - 11
common/identify/single_test.go

@@ -1,11 +0,0 @@
-package identify
-
-import "testing"
-
-func TestStepTest(t *testing.T) {
-	// 只要值发生改变就触发  旧值的可选范围中, 不包含新值
-	// 适合液位变化, 开关量, 敏感数据监控
-	rule := `{"xxx":{"OvNotIn":["$nv"]}}`
-	x := StepTest("5", "6", rule)
-	t.Log(x)
-}

+ 0 - 35
common/identify/types.go

@@ -1,35 +0,0 @@
-package identify
-
-import (
-	"database/sql/driver"
-	"encoding/json"
-)
-
-type Rule struct {
-	NvIn    []string `json:"NvIn"`
-	NvNotIn []string `json:"NvNotIn"`
-	OvIn    []string `json:"OvIn"`
-	OvNotIn []string `json:"OvNotIn"`
-}
-
-type MultiRule []Rule
-
-// Scan 实现方法
-func (d *MultiRule) Scan(input interface{}) error {
-	_ = json.Unmarshal(input.([]byte), &d)
-	return nil
-}
-
-func (d MultiRule) Value() (driver.Value, error) {
-	return json.Marshal(d)
-}
-
-// Scan 实现方法
-func (d *Rule) Scan(input interface{}) error {
-	_ = json.Unmarshal(input.([]byte), &d)
-	return nil
-}
-
-func (d Rule) Value() (driver.Value, error) {
-	return json.Marshal(d)
-}

+ 0 - 6
common/identify/vars.go

@@ -1,6 +0,0 @@
-package identify
-
-const (
-	VAR_NV = "$nv"
-	VAR_OV = "$ov"
-)

+ 5 - 1
deploy/test.sh

@@ -57,5 +57,9 @@ deploy () {
     restart $1;
 }
 
+<<<<<<< HEAD
 deploy 'organization'
-deploy 'datacenter'
+deploy 'datacenter'
+=======
+deploy $1
+>>>>>>> 6c5c5e4a86262f6791474e42ca8664f4418fc675

+ 2 - 1
go.mod

@@ -9,7 +9,7 @@ require (
 	github.com/zeromicro/go-zero v1.6.0
 	google.golang.org/grpc v1.59.0
 	google.golang.org/protobuf v1.31.0
-	gtlib.local/gaoyagang/gt-common v1.0.24
+	metawant.greentech.com.cn/gaoyagang/gt-common v1.1.0
 )
 
 require (
@@ -53,6 +53,7 @@ require (
 	github.com/prometheus/common v0.44.0 // indirect
 	github.com/prometheus/procfs v0.11.1 // indirect
 	github.com/spaolacci/murmur3 v1.1.0 // indirect
+	github.com/streadway/amqp v1.1.0 // indirect
 	go.etcd.io/etcd/api/v3 v3.5.10 // indirect
 	go.etcd.io/etcd/client/pkg/v3 v3.5.10 // indirect
 	go.etcd.io/etcd/client/v3 v3.5.10 // indirect

+ 4 - 2
go.sum

@@ -123,6 +123,8 @@ github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjR
 github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
 github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
 github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/streadway/amqp v1.1.0 h1:py12iX8XSyI7aN/3dUT8DFIDJazNJsVJdxNVEpnQTZM=
+github.com/streadway/amqp v1.1.0/go.mod h1:WYSrTEYHOXHd0nwFeUXAe2G2hRnQT+deZJJf88uS9Bg=
 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
 github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
 github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
@@ -265,8 +267,6 @@ gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
 gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
 gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
 gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-gtlib.local/gaoyagang/gt-common v1.0.24 h1:5m/gXrrPKPxFRQ3Vv4EQBisSNlUAlLvvVD4CBDX8ULM=
-gtlib.local/gaoyagang/gt-common v1.0.24/go.mod h1:zJ9SfVFwkeGNhcI8PSKp7UR3e80cLmBr108xiqFsTvo=
 k8s.io/api v0.28.3 h1:Gj1HtbSdB4P08C8rs9AR94MfSGpRhJgsS+GF9V26xMM=
 k8s.io/api v0.28.3/go.mod h1:MRCV/jr1dW87/qJnZ57U5Pak65LGmQVkKTzf3AtKFHc=
 k8s.io/apimachinery v0.28.3 h1:B1wYx8txOaCQG0HmYF6nbpU8dg6HvA06x5tEffvOe7A=
@@ -279,6 +279,8 @@ k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00 h1:aVUu9fTY98ivBPKR9Y5w/A
 k8s.io/kube-openapi v0.0.0-20231010175941-2dd684a91f00/go.mod h1:AsvuZPBlUDVuCdzJ87iajxtXuR9oktsTctW/R9wwouA=
 k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=
 k8s.io/utils v0.0.0-20230726121419-3b25d923346b/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
+metawant.greentech.com.cn/gaoyagang/gt-common v1.1.0 h1:iqjiskz3GIOZQC4kTFL47I982W0ECQAwECEj49b4eS4=
+metawant.greentech.com.cn/gaoyagang/gt-common v1.1.0/go.mod h1:TiS/E+b6WFW/0Ei4H/djoguRTnfeBsiUnt5odj1C9n4=
 sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd h1:EDPBXCAspyGV4jQlpZSudPeMmr1bNJefnuqLsRAsHZo=
 sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd/go.mod h1:B8JuhiUyNFVKdsE8h686QcCxMaH6HrOAZj4vswFpcB0=
 sigs.k8s.io/structured-merge-diff/v4 v4.2.3 h1:PRbqxJClWWYMNV1dhaG4NsibJbArud9kFxnAMREiWFE=

+ 0 - 20
vendor/github.com/beorn7/perks/LICENSE

@@ -1,20 +0,0 @@
-Copyright (C) 2013 Blake Mizerany
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 2388
vendor/github.com/beorn7/perks/quantile/exampledata.txt

@@ -1,2388 +0,0 @@
-8
-5
-26
-12
-5
-235
-13
-6
-28
-30
-3
-3
-3
-3
-5
-2
-33
-7
-2
-4
-7
-12
-14
-5
-8
-3
-10
-4
-5
-3
-6
-6
-209
-20
-3
-10
-14
-3
-4
-6
-8
-5
-11
-7
-3
-2
-3
-3
-212
-5
-222
-4
-10
-10
-5
-6
-3
-8
-3
-10
-254
-220
-2
-3
-5
-24
-5
-4
-222
-7
-3
-3
-223
-8
-15
-12
-14
-14
-3
-2
-2
-3
-13
-3
-11
-4
-4
-6
-5
-7
-13
-5
-3
-5
-2
-5
-3
-5
-2
-7
-15
-17
-14
-3
-6
-6
-3
-17
-5
-4
-7
-6
-4
-4
-8
-6
-8
-3
-9
-3
-6
-3
-4
-5
-3
-3
-660
-4
-6
-10
-3
-6
-3
-2
-5
-13
-2
-4
-4
-10
-4
-8
-4
-3
-7
-9
-9
-3
-10
-37
-3
-13
-4
-12
-3
-6
-10
-8
-5
-21
-2
-3
-8
-3
-2
-3
-3
-4
-12
-2
-4
-8
-8
-4
-3
-2
-20
-1
-6
-32
-2
-11
-6
-18
-3
-8
-11
-3
-212
-3
-4
-2
-6
-7
-12
-11
-3
-2
-16
-10
-6
-4
-6
-3
-2
-7
-3
-2
-2
-2
-2
-5
-6
-4
-3
-10
-3
-4
-6
-5
-3
-4
-4
-5
-6
-4
-3
-4
-4
-5
-7
-5
-5
-3
-2
-7
-2
-4
-12
-4
-5
-6
-2
-4
-4
-8
-4
-15
-13
-7
-16
-5
-3
-23
-5
-5
-7
-3
-2
-9
-8
-7
-5
-8
-11
-4
-10
-76
-4
-47
-4
-3
-2
-7
-4
-2
-3
-37
-10
-4
-2
-20
-5
-4
-4
-10
-10
-4
-3
-7
-23
-240
-7
-13
-5
-5
-3
-3
-2
-5
-4
-2
-8
-7
-19
-2
-23
-8
-7
-2
-5
-3
-8
-3
-8
-13
-5
-5
-5
-2
-3
-23
-4
-9
-8
-4
-3
-3
-5
-220
-2
-3
-4
-6
-14
-3
-53
-6
-2
-5
-18
-6
-3
-219
-6
-5
-2
-5
-3
-6
-5
-15
-4
-3
-17
-3
-2
-4
-7
-2
-3
-3
-4
-4
-3
-2
-664
-6
-3
-23
-5
-5
-16
-5
-8
-2
-4
-2
-24
-12
-3
-2
-3
-5
-8
-3
-5
-4
-3
-14
-3
-5
-8
-2
-3
-7
-9
-4
-2
-3
-6
-8
-4
-3
-4
-6
-5
-3
-3
-6
-3
-19
-4
-4
-6
-3
-6
-3
-5
-22
-5
-4
-4
-3
-8
-11
-4
-9
-7
-6
-13
-4
-4
-4
-6
-17
-9
-3
-3
-3
-4
-3
-221
-5
-11
-3
-4
-2
-12
-6
-3
-5
-7
-5
-7
-4
-9
-7
-14
-37
-19
-217
-16
-3
-5
-2
-2
-7
-19
-7
-6
-7
-4
-24
-5
-11
-4
-7
-7
-9
-13
-3
-4
-3
-6
-28
-4
-4
-5
-5
-2
-5
-6
-4
-4
-6
-10
-5
-4
-3
-2
-3
-3
-6
-5
-5
-4
-3
-2
-3
-7
-4
-6
-18
-16
-8
-16
-4
-5
-8
-6
-9
-13
-1545
-6
-215
-6
-5
-6
-3
-45
-31
-5
-2
-2
-4
-3
-3
-2
-5
-4
-3
-5
-7
-7
-4
-5
-8
-5
-4
-749
-2
-31
-9
-11
-2
-11
-5
-4
-4
-7
-9
-11
-4
-5
-4
-7
-3
-4
-6
-2
-15
-3
-4
-3
-4
-3
-5
-2
-13
-5
-5
-3
-3
-23
-4
-4
-5
-7
-4
-13
-2
-4
-3
-4
-2
-6
-2
-7
-3
-5
-5
-3
-29
-5
-4
-4
-3
-10
-2
-3
-79
-16
-6
-6
-7
-7
-3
-5
-5
-7
-4
-3
-7
-9
-5
-6
-5
-9
-6
-3
-6
-4
-17
-2
-10
-9
-3
-6
-2
-3
-21
-22
-5
-11
-4
-2
-17
-2
-224
-2
-14
-3
-4
-4
-2
-4
-4
-4
-4
-5
-3
-4
-4
-10
-2
-6
-3
-3
-5
-7
-2
-7
-5
-6
-3
-218
-2
-2
-5
-2
-6
-3
-5
-222
-14
-6
-33
-3
-2
-5
-3
-3
-3
-9
-5
-3
-3
-2
-7
-4
-3
-4
-3
-5
-6
-5
-26
-4
-13
-9
-7
-3
-221
-3
-3
-4
-4
-4
-4
-2
-18
-5
-3
-7
-9
-6
-8
-3
-10
-3
-11
-9
-5
-4
-17
-5
-5
-6
-6
-3
-2
-4
-12
-17
-6
-7
-218
-4
-2
-4
-10
-3
-5
-15
-3
-9
-4
-3
-3
-6
-29
-3
-3
-4
-5
-5
-3
-8
-5
-6
-6
-7
-5
-3
-5
-3
-29
-2
-31
-5
-15
-24
-16
-5
-207
-4
-3
-3
-2
-15
-4
-4
-13
-5
-5
-4
-6
-10
-2
-7
-8
-4
-6
-20
-5
-3
-4
-3
-12
-12
-5
-17
-7
-3
-3
-3
-6
-10
-3
-5
-25
-80
-4
-9
-3
-2
-11
-3
-3
-2
-3
-8
-7
-5
-5
-19
-5
-3
-3
-12
-11
-2
-6
-5
-5
-5
-3
-3
-3
-4
-209
-14
-3
-2
-5
-19
-4
-4
-3
-4
-14
-5
-6
-4
-13
-9
-7
-4
-7
-10
-2
-9
-5
-7
-2
-8
-4
-6
-5
-5
-222
-8
-7
-12
-5
-216
-3
-4
-4
-6
-3
-14
-8
-7
-13
-4
-3
-3
-3
-3
-17
-5
-4
-3
-33
-6
-6
-33
-7
-5
-3
-8
-7
-5
-2
-9
-4
-2
-233
-24
-7
-4
-8
-10
-3
-4
-15
-2
-16
-3
-3
-13
-12
-7
-5
-4
-207
-4
-2
-4
-27
-15
-2
-5
-2
-25
-6
-5
-5
-6
-13
-6
-18
-6
-4
-12
-225
-10
-7
-5
-2
-2
-11
-4
-14
-21
-8
-10
-3
-5
-4
-232
-2
-5
-5
-3
-7
-17
-11
-6
-6
-23
-4
-6
-3
-5
-4
-2
-17
-3
-6
-5
-8
-3
-2
-2
-14
-9
-4
-4
-2
-5
-5
-3
-7
-6
-12
-6
-10
-3
-6
-2
-2
-19
-5
-4
-4
-9
-2
-4
-13
-3
-5
-6
-3
-6
-5
-4
-9
-6
-3
-5
-7
-3
-6
-6
-4
-3
-10
-6
-3
-221
-3
-5
-3
-6
-4
-8
-5
-3
-6
-4
-4
-2
-54
-5
-6
-11
-3
-3
-4
-4
-4
-3
-7
-3
-11
-11
-7
-10
-6
-13
-223
-213
-15
-231
-7
-3
-7
-228
-2
-3
-4
-4
-5
-6
-7
-4
-13
-3
-4
-5
-3
-6
-4
-6
-7
-2
-4
-3
-4
-3
-3
-6
-3
-7
-3
-5
-18
-5
-6
-8
-10
-3
-3
-3
-2
-4
-2
-4
-4
-5
-6
-6
-4
-10
-13
-3
-12
-5
-12
-16
-8
-4
-19
-11
-2
-4
-5
-6
-8
-5
-6
-4
-18
-10
-4
-2
-216
-6
-6
-6
-2
-4
-12
-8
-3
-11
-5
-6
-14
-5
-3
-13
-4
-5
-4
-5
-3
-28
-6
-3
-7
-219
-3
-9
-7
-3
-10
-6
-3
-4
-19
-5
-7
-11
-6
-15
-19
-4
-13
-11
-3
-7
-5
-10
-2
-8
-11
-2
-6
-4
-6
-24
-6
-3
-3
-3
-3
-6
-18
-4
-11
-4
-2
-5
-10
-8
-3
-9
-5
-3
-4
-5
-6
-2
-5
-7
-4
-4
-14
-6
-4
-4
-5
-5
-7
-2
-4
-3
-7
-3
-3
-6
-4
-5
-4
-4
-4
-3
-3
-3
-3
-8
-14
-2
-3
-5
-3
-2
-4
-5
-3
-7
-3
-3
-18
-3
-4
-4
-5
-7
-3
-3
-3
-13
-5
-4
-8
-211
-5
-5
-3
-5
-2
-5
-4
-2
-655
-6
-3
-5
-11
-2
-5
-3
-12
-9
-15
-11
-5
-12
-217
-2
-6
-17
-3
-3
-207
-5
-5
-4
-5
-9
-3
-2
-8
-5
-4
-3
-2
-5
-12
-4
-14
-5
-4
-2
-13
-5
-8
-4
-225
-4
-3
-4
-5
-4
-3
-3
-6
-23
-9
-2
-6
-7
-233
-4
-4
-6
-18
-3
-4
-6
-3
-4
-4
-2
-3
-7
-4
-13
-227
-4
-3
-5
-4
-2
-12
-9
-17
-3
-7
-14
-6
-4
-5
-21
-4
-8
-9
-2
-9
-25
-16
-3
-6
-4
-7
-8
-5
-2
-3
-5
-4
-3
-3
-5
-3
-3
-3
-2
-3
-19
-2
-4
-3
-4
-2
-3
-4
-4
-2
-4
-3
-3
-3
-2
-6
-3
-17
-5
-6
-4
-3
-13
-5
-3
-3
-3
-4
-9
-4
-2
-14
-12
-4
-5
-24
-4
-3
-37
-12
-11
-21
-3
-4
-3
-13
-4
-2
-3
-15
-4
-11
-4
-4
-3
-8
-3
-4
-4
-12
-8
-5
-3
-3
-4
-2
-220
-3
-5
-223
-3
-3
-3
-10
-3
-15
-4
-241
-9
-7
-3
-6
-6
-23
-4
-13
-7
-3
-4
-7
-4
-9
-3
-3
-4
-10
-5
-5
-1
-5
-24
-2
-4
-5
-5
-6
-14
-3
-8
-2
-3
-5
-13
-13
-3
-5
-2
-3
-15
-3
-4
-2
-10
-4
-4
-4
-5
-5
-3
-5
-3
-4
-7
-4
-27
-3
-6
-4
-15
-3
-5
-6
-6
-5
-4
-8
-3
-9
-2
-6
-3
-4
-3
-7
-4
-18
-3
-11
-3
-3
-8
-9
-7
-24
-3
-219
-7
-10
-4
-5
-9
-12
-2
-5
-4
-4
-4
-3
-3
-19
-5
-8
-16
-8
-6
-22
-3
-23
-3
-242
-9
-4
-3
-3
-5
-7
-3
-3
-5
-8
-3
-7
-5
-14
-8
-10
-3
-4
-3
-7
-4
-6
-7
-4
-10
-4
-3
-11
-3
-7
-10
-3
-13
-6
-8
-12
-10
-5
-7
-9
-3
-4
-7
-7
-10
-8
-30
-9
-19
-4
-3
-19
-15
-4
-13
-3
-215
-223
-4
-7
-4
-8
-17
-16
-3
-7
-6
-5
-5
-4
-12
-3
-7
-4
-4
-13
-4
-5
-2
-5
-6
-5
-6
-6
-7
-10
-18
-23
-9
-3
-3
-6
-5
-2
-4
-2
-7
-3
-3
-2
-5
-5
-14
-10
-224
-6
-3
-4
-3
-7
-5
-9
-3
-6
-4
-2
-5
-11
-4
-3
-3
-2
-8
-4
-7
-4
-10
-7
-3
-3
-18
-18
-17
-3
-3
-3
-4
-5
-3
-3
-4
-12
-7
-3
-11
-13
-5
-4
-7
-13
-5
-4
-11
-3
-12
-3
-6
-4
-4
-21
-4
-6
-9
-5
-3
-10
-8
-4
-6
-4
-4
-6
-5
-4
-8
-6
-4
-6
-4
-4
-5
-9
-6
-3
-4
-2
-9
-3
-18
-2
-4
-3
-13
-3
-6
-6
-8
-7
-9
-3
-2
-16
-3
-4
-6
-3
-2
-33
-22
-14
-4
-9
-12
-4
-5
-6
-3
-23
-9
-4
-3
-5
-5
-3
-4
-5
-3
-5
-3
-10
-4
-5
-5
-8
-4
-4
-6
-8
-5
-4
-3
-4
-6
-3
-3
-3
-5
-9
-12
-6
-5
-9
-3
-5
-3
-2
-2
-2
-18
-3
-2
-21
-2
-5
-4
-6
-4
-5
-10
-3
-9
-3
-2
-10
-7
-3
-6
-6
-4
-4
-8
-12
-7
-3
-7
-3
-3
-9
-3
-4
-5
-4
-4
-5
-5
-10
-15
-4
-4
-14
-6
-227
-3
-14
-5
-216
-22
-5
-4
-2
-2
-6
-3
-4
-2
-9
-9
-4
-3
-28
-13
-11
-4
-5
-3
-3
-2
-3
-3
-5
-3
-4
-3
-5
-23
-26
-3
-4
-5
-6
-4
-6
-3
-5
-5
-3
-4
-3
-2
-2
-2
-7
-14
-3
-6
-7
-17
-2
-2
-15
-14
-16
-4
-6
-7
-13
-6
-4
-5
-6
-16
-3
-3
-28
-3
-6
-15
-3
-9
-2
-4
-6
-3
-3
-22
-4
-12
-6
-7
-2
-5
-4
-10
-3
-16
-6
-9
-2
-5
-12
-7
-5
-5
-5
-5
-2
-11
-9
-17
-4
-3
-11
-7
-3
-5
-15
-4
-3
-4
-211
-8
-7
-5
-4
-7
-6
-7
-6
-3
-6
-5
-6
-5
-3
-4
-4
-26
-4
-6
-10
-4
-4
-3
-2
-3
-3
-4
-5
-9
-3
-9
-4
-4
-5
-5
-8
-2
-4
-2
-3
-8
-4
-11
-19
-5
-8
-6
-3
-5
-6
-12
-3
-2
-4
-16
-12
-3
-4
-4
-8
-6
-5
-6
-6
-219
-8
-222
-6
-16
-3
-13
-19
-5
-4
-3
-11
-6
-10
-4
-7
-7
-12
-5
-3
-3
-5
-6
-10
-3
-8
-2
-5
-4
-7
-2
-4
-4
-2
-12
-9
-6
-4
-2
-40
-2
-4
-10
-4
-223
-4
-2
-20
-6
-7
-24
-5
-4
-5
-2
-20
-16
-6
-5
-13
-2
-3
-3
-19
-3
-2
-4
-5
-6
-7
-11
-12
-5
-6
-7
-7
-3
-5
-3
-5
-3
-14
-3
-4
-4
-2
-11
-1
-7
-3
-9
-6
-11
-12
-5
-8
-6
-221
-4
-2
-12
-4
-3
-15
-4
-5
-226
-7
-218
-7
-5
-4
-5
-18
-4
-5
-9
-4
-4
-2
-9
-18
-18
-9
-5
-6
-6
-3
-3
-7
-3
-5
-4
-4
-4
-12
-3
-6
-31
-5
-4
-7
-3
-6
-5
-6
-5
-11
-2
-2
-11
-11
-6
-7
-5
-8
-7
-10
-5
-23
-7
-4
-3
-5
-34
-2
-5
-23
-7
-3
-6
-8
-4
-4
-4
-2
-5
-3
-8
-5
-4
-8
-25
-2
-3
-17
-8
-3
-4
-8
-7
-3
-15
-6
-5
-7
-21
-9
-5
-6
-6
-5
-3
-2
-3
-10
-3
-6
-3
-14
-7
-4
-4
-8
-7
-8
-2
-6
-12
-4
-213
-6
-5
-21
-8
-2
-5
-23
-3
-11
-2
-3
-6
-25
-2
-3
-6
-7
-6
-6
-4
-4
-6
-3
-17
-9
-7
-6
-4
-3
-10
-7
-2
-3
-3
-3
-11
-8
-3
-7
-6
-4
-14
-36
-3
-4
-3
-3
-22
-13
-21
-4
-2
-7
-4
-4
-17
-15
-3
-7
-11
-2
-4
-7
-6
-209
-6
-3
-2
-2
-24
-4
-9
-4
-3
-3
-3
-29
-2
-2
-4
-3
-3
-5
-4
-6
-3
-3
-2
-4

+ 0 - 316
vendor/github.com/beorn7/perks/quantile/stream.go

@@ -1,316 +0,0 @@
-// Package quantile computes approximate quantiles over an unbounded data
-// stream within low memory and CPU bounds.
-//
-// A small amount of accuracy is traded to achieve the above properties.
-//
-// Multiple streams can be merged before calling Query to generate a single set
-// of results. This is meaningful when the streams represent the same type of
-// data. See Merge and Samples.
-//
-// For more detailed information about the algorithm used, see:
-//
-// Effective Computation of Biased Quantiles over Data Streams
-//
-// http://www.cs.rutgers.edu/~muthu/bquant.pdf
-package quantile
-
-import (
-	"math"
-	"sort"
-)
-
-// Sample holds an observed value and meta information for compression. JSON
-// tags have been added for convenience.
-type Sample struct {
-	Value float64 `json:",string"`
-	Width float64 `json:",string"`
-	Delta float64 `json:",string"`
-}
-
-// Samples represents a slice of samples. It implements sort.Interface.
-type Samples []Sample
-
-func (a Samples) Len() int           { return len(a) }
-func (a Samples) Less(i, j int) bool { return a[i].Value < a[j].Value }
-func (a Samples) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
-
-type invariant func(s *stream, r float64) float64
-
-// NewLowBiased returns an initialized Stream for low-biased quantiles
-// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but
-// error guarantees can still be given even for the lower ranks of the data
-// distribution.
-//
-// The provided epsilon is a relative error, i.e. the true quantile of a value
-// returned by a query is guaranteed to be within (1±Epsilon)*Quantile.
-//
-// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error
-// properties.
-func NewLowBiased(epsilon float64) *Stream {
-	ƒ := func(s *stream, r float64) float64 {
-		return 2 * epsilon * r
-	}
-	return newStream(ƒ)
-}
-
-// NewHighBiased returns an initialized Stream for high-biased quantiles
-// (e.g. 0.01, 0.1, 0.5) where the needed quantiles are not known a priori, but
-// error guarantees can still be given even for the higher ranks of the data
-// distribution.
-//
-// The provided epsilon is a relative error, i.e. the true quantile of a value
-// returned by a query is guaranteed to be within 1-(1±Epsilon)*(1-Quantile).
-//
-// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error
-// properties.
-func NewHighBiased(epsilon float64) *Stream {
-	ƒ := func(s *stream, r float64) float64 {
-		return 2 * epsilon * (s.n - r)
-	}
-	return newStream(ƒ)
-}
-
-// NewTargeted returns an initialized Stream concerned with a particular set of
-// quantile values that are supplied a priori. Knowing these a priori reduces
-// space and computation time. The targets map maps the desired quantiles to
-// their absolute errors, i.e. the true quantile of a value returned by a query
-// is guaranteed to be within (Quantile±Epsilon).
-//
-// See http://www.cs.rutgers.edu/~muthu/bquant.pdf for time, space, and error properties.
-func NewTargeted(targetMap map[float64]float64) *Stream {
-	// Convert map to slice to avoid slow iterations on a map.
-	// ƒ is called on the hot path, so converting the map to a slice
-	// beforehand results in significant CPU savings.
-	targets := targetMapToSlice(targetMap)
-
-	ƒ := func(s *stream, r float64) float64 {
-		var m = math.MaxFloat64
-		var f float64
-		for _, t := range targets {
-			if t.quantile*s.n <= r {
-				f = (2 * t.epsilon * r) / t.quantile
-			} else {
-				f = (2 * t.epsilon * (s.n - r)) / (1 - t.quantile)
-			}
-			if f < m {
-				m = f
-			}
-		}
-		return m
-	}
-	return newStream(ƒ)
-}
-
-type target struct {
-	quantile float64
-	epsilon  float64
-}
-
-func targetMapToSlice(targetMap map[float64]float64) []target {
-	targets := make([]target, 0, len(targetMap))
-
-	for quantile, epsilon := range targetMap {
-		t := target{
-			quantile: quantile,
-			epsilon:  epsilon,
-		}
-		targets = append(targets, t)
-	}
-
-	return targets
-}
-
-// Stream computes quantiles for a stream of float64s. It is not thread-safe by
-// design. Take care when using across multiple goroutines.
-type Stream struct {
-	*stream
-	b      Samples
-	sorted bool
-}
-
-func newStream(ƒ invariant) *Stream {
-	x := &stream{ƒ: ƒ}
-	return &Stream{x, make(Samples, 0, 500), true}
-}
-
-// Insert inserts v into the stream.
-func (s *Stream) Insert(v float64) {
-	s.insert(Sample{Value: v, Width: 1})
-}
-
-func (s *Stream) insert(sample Sample) {
-	s.b = append(s.b, sample)
-	s.sorted = false
-	if len(s.b) == cap(s.b) {
-		s.flush()
-	}
-}
-
-// Query returns the computed qth percentiles value. If s was created with
-// NewTargeted, and q is not in the set of quantiles provided a priori, Query
-// will return an unspecified result.
-func (s *Stream) Query(q float64) float64 {
-	if !s.flushed() {
-		// Fast path when there hasn't been enough data for a flush;
-		// this also yields better accuracy for small sets of data.
-		l := len(s.b)
-		if l == 0 {
-			return 0
-		}
-		i := int(math.Ceil(float64(l) * q))
-		if i > 0 {
-			i -= 1
-		}
-		s.maybeSort()
-		return s.b[i].Value
-	}
-	s.flush()
-	return s.stream.query(q)
-}
-
-// Merge merges samples into the underlying streams samples. This is handy when
-// merging multiple streams from separate threads, database shards, etc.
-//
-// ATTENTION: This method is broken and does not yield correct results. The
-// underlying algorithm is not capable of merging streams correctly.
-func (s *Stream) Merge(samples Samples) {
-	sort.Sort(samples)
-	s.stream.merge(samples)
-}
-
-// Reset reinitializes and clears the list reusing the samples buffer memory.
-func (s *Stream) Reset() {
-	s.stream.reset()
-	s.b = s.b[:0]
-}
-
-// Samples returns stream samples held by s.
-func (s *Stream) Samples() Samples {
-	if !s.flushed() {
-		return s.b
-	}
-	s.flush()
-	return s.stream.samples()
-}
-
-// Count returns the total number of samples observed in the stream
-// since initialization.
-func (s *Stream) Count() int {
-	return len(s.b) + s.stream.count()
-}
-
-func (s *Stream) flush() {
-	s.maybeSort()
-	s.stream.merge(s.b)
-	s.b = s.b[:0]
-}
-
-func (s *Stream) maybeSort() {
-	if !s.sorted {
-		s.sorted = true
-		sort.Sort(s.b)
-	}
-}
-
-func (s *Stream) flushed() bool {
-	return len(s.stream.l) > 0
-}
-
-type stream struct {
-	n float64
-	l []Sample
-	ƒ invariant
-}
-
-func (s *stream) reset() {
-	s.l = s.l[:0]
-	s.n = 0
-}
-
-func (s *stream) insert(v float64) {
-	s.merge(Samples{{v, 1, 0}})
-}
-
-func (s *stream) merge(samples Samples) {
-	// TODO(beorn7): This tries to merge not only individual samples, but
-	// whole summaries. The paper doesn't mention merging summaries at
-	// all. Unittests show that the merging is inaccurate. Find out how to
-	// do merges properly.
-	var r float64
-	i := 0
-	for _, sample := range samples {
-		for ; i < len(s.l); i++ {
-			c := s.l[i]
-			if c.Value > sample.Value {
-				// Insert at position i.
-				s.l = append(s.l, Sample{})
-				copy(s.l[i+1:], s.l[i:])
-				s.l[i] = Sample{
-					sample.Value,
-					sample.Width,
-					math.Max(sample.Delta, math.Floor(s.ƒ(s, r))-1),
-					// TODO(beorn7): How to calculate delta correctly?
-				}
-				i++
-				goto inserted
-			}
-			r += c.Width
-		}
-		s.l = append(s.l, Sample{sample.Value, sample.Width, 0})
-		i++
-	inserted:
-		s.n += sample.Width
-		r += sample.Width
-	}
-	s.compress()
-}
-
-func (s *stream) count() int {
-	return int(s.n)
-}
-
-func (s *stream) query(q float64) float64 {
-	t := math.Ceil(q * s.n)
-	t += math.Ceil(s.ƒ(s, t) / 2)
-	p := s.l[0]
-	var r float64
-	for _, c := range s.l[1:] {
-		r += p.Width
-		if r+c.Width+c.Delta > t {
-			return p.Value
-		}
-		p = c
-	}
-	return p.Value
-}
-
-func (s *stream) compress() {
-	if len(s.l) < 2 {
-		return
-	}
-	x := s.l[len(s.l)-1]
-	xi := len(s.l) - 1
-	r := s.n - 1 - x.Width
-
-	for i := len(s.l) - 2; i >= 0; i-- {
-		c := s.l[i]
-		if c.Width+x.Width+x.Delta <= s.ƒ(s, r) {
-			x.Width += c.Width
-			s.l[xi] = x
-			// Remove element at i.
-			copy(s.l[i:], s.l[i+1:])
-			s.l = s.l[:len(s.l)-1]
-			xi -= 1
-		} else {
-			x = c
-			xi = i
-		}
-		r -= c.Width
-	}
-}
-
-func (s *stream) samples() Samples {
-	samples := make(Samples, len(s.l))
-	copy(samples, s.l)
-	return samples
-}

+ 0 - 25
vendor/github.com/cenkalti/backoff/v4/.gitignore

@@ -1,25 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-
-# IDEs
-.idea/

+ 0 - 20
vendor/github.com/cenkalti/backoff/v4/LICENSE

@@ -1,20 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2014 Cenk Altı
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 32
vendor/github.com/cenkalti/backoff/v4/README.md

@@ -1,32 +0,0 @@
-# Exponential Backoff [![GoDoc][godoc image]][godoc] [![Build Status][travis image]][travis] [![Coverage Status][coveralls image]][coveralls]
-
-This is a Go port of the exponential backoff algorithm from [Google's HTTP Client Library for Java][google-http-java-client].
-
-[Exponential backoff][exponential backoff wiki]
-is an algorithm that uses feedback to multiplicatively decrease the rate of some process,
-in order to gradually find an acceptable rate.
-The retries exponentially increase and stop increasing when a certain threshold is met.
-
-## Usage
-
-Import path is `github.com/cenkalti/backoff/v4`. Please note the version part at the end.
-
-Use https://pkg.go.dev/github.com/cenkalti/backoff/v4 to view the documentation.
-
-## Contributing
-
-* I would like to keep this library as small as possible.
-* Please don't send a PR without opening an issue and discussing it first.
-* If proposed change is not a common use case, I will probably not accept it.
-
-[godoc]: https://pkg.go.dev/github.com/cenkalti/backoff/v4
-[godoc image]: https://godoc.org/github.com/cenkalti/backoff?status.png
-[travis]: https://travis-ci.org/cenkalti/backoff
-[travis image]: https://travis-ci.org/cenkalti/backoff.png?branch=master
-[coveralls]: https://coveralls.io/github/cenkalti/backoff?branch=master
-[coveralls image]: https://coveralls.io/repos/github/cenkalti/backoff/badge.svg?branch=master
-
-[google-http-java-client]: https://github.com/google/google-http-java-client/blob/da1aa993e90285ec18579f1553339b00e19b3ab5/google-http-client/src/main/java/com/google/api/client/util/ExponentialBackOff.java
-[exponential backoff wiki]: http://en.wikipedia.org/wiki/Exponential_backoff
-
-[advanced example]: https://pkg.go.dev/github.com/cenkalti/backoff/v4?tab=doc#pkg-examples

+ 0 - 66
vendor/github.com/cenkalti/backoff/v4/backoff.go

@@ -1,66 +0,0 @@
-// Package backoff implements backoff algorithms for retrying operations.
-//
-// Use Retry function for retrying operations that may fail.
-// If Retry does not meet your needs,
-// copy/paste the function into your project and modify as you wish.
-//
-// There is also Ticker type similar to time.Ticker.
-// You can use it if you need to work with channels.
-//
-// See Examples section below for usage examples.
-package backoff
-
-import "time"
-
-// BackOff is a backoff policy for retrying an operation.
-type BackOff interface {
-	// NextBackOff returns the duration to wait before retrying the operation,
-	// or backoff. Stop to indicate that no more retries should be made.
-	//
-	// Example usage:
-	//
-	// 	duration := backoff.NextBackOff();
-	// 	if (duration == backoff.Stop) {
-	// 		// Do not retry operation.
-	// 	} else {
-	// 		// Sleep for duration and retry operation.
-	// 	}
-	//
-	NextBackOff() time.Duration
-
-	// Reset to initial state.
-	Reset()
-}
-
-// Stop indicates that no more retries should be made for use in NextBackOff().
-const Stop time.Duration = -1
-
-// ZeroBackOff is a fixed backoff policy whose backoff time is always zero,
-// meaning that the operation is retried immediately without waiting, indefinitely.
-type ZeroBackOff struct{}
-
-func (b *ZeroBackOff) Reset() {}
-
-func (b *ZeroBackOff) NextBackOff() time.Duration { return 0 }
-
-// StopBackOff is a fixed backoff policy that always returns backoff.Stop for
-// NextBackOff(), meaning that the operation should never be retried.
-type StopBackOff struct{}
-
-func (b *StopBackOff) Reset() {}
-
-func (b *StopBackOff) NextBackOff() time.Duration { return Stop }
-
-// ConstantBackOff is a backoff policy that always returns the same backoff delay.
-// This is in contrast to an exponential backoff policy,
-// which returns a delay that grows longer as you call NextBackOff() over and over again.
-type ConstantBackOff struct {
-	Interval time.Duration
-}
-
-func (b *ConstantBackOff) Reset()                     {}
-func (b *ConstantBackOff) NextBackOff() time.Duration { return b.Interval }
-
-func NewConstantBackOff(d time.Duration) *ConstantBackOff {
-	return &ConstantBackOff{Interval: d}
-}

+ 0 - 62
vendor/github.com/cenkalti/backoff/v4/context.go

@@ -1,62 +0,0 @@
-package backoff
-
-import (
-	"context"
-	"time"
-)
-
-// BackOffContext is a backoff policy that stops retrying after the context
-// is canceled.
-type BackOffContext interface { // nolint: golint
-	BackOff
-	Context() context.Context
-}
-
-type backOffContext struct {
-	BackOff
-	ctx context.Context
-}
-
-// WithContext returns a BackOffContext with context ctx
-//
-// ctx must not be nil
-func WithContext(b BackOff, ctx context.Context) BackOffContext { // nolint: golint
-	if ctx == nil {
-		panic("nil context")
-	}
-
-	if b, ok := b.(*backOffContext); ok {
-		return &backOffContext{
-			BackOff: b.BackOff,
-			ctx:     ctx,
-		}
-	}
-
-	return &backOffContext{
-		BackOff: b,
-		ctx:     ctx,
-	}
-}
-
-func getContext(b BackOff) context.Context {
-	if cb, ok := b.(BackOffContext); ok {
-		return cb.Context()
-	}
-	if tb, ok := b.(*backOffTries); ok {
-		return getContext(tb.delegate)
-	}
-	return context.Background()
-}
-
-func (b *backOffContext) Context() context.Context {
-	return b.ctx
-}
-
-func (b *backOffContext) NextBackOff() time.Duration {
-	select {
-	case <-b.ctx.Done():
-		return Stop
-	default:
-		return b.BackOff.NextBackOff()
-	}
-}

+ 0 - 161
vendor/github.com/cenkalti/backoff/v4/exponential.go

@@ -1,161 +0,0 @@
-package backoff
-
-import (
-	"math/rand"
-	"time"
-)
-
-/*
-ExponentialBackOff is a backoff implementation that increases the backoff
-period for each retry attempt using a randomization function that grows exponentially.
-
-NextBackOff() is calculated using the following formula:
-
- randomized interval =
-     RetryInterval * (random value in range [1 - RandomizationFactor, 1 + RandomizationFactor])
-
-In other words NextBackOff() will range between the randomization factor
-percentage below and above the retry interval.
-
-For example, given the following parameters:
-
- RetryInterval = 2
- RandomizationFactor = 0.5
- Multiplier = 2
-
-the actual backoff period used in the next retry attempt will range between 1 and 3 seconds,
-multiplied by the exponential, that is, between 2 and 6 seconds.
-
-Note: MaxInterval caps the RetryInterval and not the randomized interval.
-
-If the time elapsed since an ExponentialBackOff instance is created goes past the
-MaxElapsedTime, then the method NextBackOff() starts returning backoff.Stop.
-
-The elapsed time can be reset by calling Reset().
-
-Example: Given the following default arguments, for 10 tries the sequence will be,
-and assuming we go over the MaxElapsedTime on the 10th try:
-
- Request #  RetryInterval (seconds)  Randomized Interval (seconds)
-
-  1          0.5                     [0.25,   0.75]
-  2          0.75                    [0.375,  1.125]
-  3          1.125                   [0.562,  1.687]
-  4          1.687                   [0.8435, 2.53]
-  5          2.53                    [1.265,  3.795]
-  6          3.795                   [1.897,  5.692]
-  7          5.692                   [2.846,  8.538]
-  8          8.538                   [4.269, 12.807]
-  9         12.807                   [6.403, 19.210]
- 10         19.210                   backoff.Stop
-
-Note: Implementation is not thread-safe.
-*/
-type ExponentialBackOff struct {
-	InitialInterval     time.Duration
-	RandomizationFactor float64
-	Multiplier          float64
-	MaxInterval         time.Duration
-	// After MaxElapsedTime the ExponentialBackOff returns Stop.
-	// It never stops if MaxElapsedTime == 0.
-	MaxElapsedTime time.Duration
-	Stop           time.Duration
-	Clock          Clock
-
-	currentInterval time.Duration
-	startTime       time.Time
-}
-
-// Clock is an interface that returns current time for BackOff.
-type Clock interface {
-	Now() time.Time
-}
-
-// Default values for ExponentialBackOff.
-const (
-	DefaultInitialInterval     = 500 * time.Millisecond
-	DefaultRandomizationFactor = 0.5
-	DefaultMultiplier          = 1.5
-	DefaultMaxInterval         = 60 * time.Second
-	DefaultMaxElapsedTime      = 15 * time.Minute
-)
-
-// NewExponentialBackOff creates an instance of ExponentialBackOff using default values.
-func NewExponentialBackOff() *ExponentialBackOff {
-	b := &ExponentialBackOff{
-		InitialInterval:     DefaultInitialInterval,
-		RandomizationFactor: DefaultRandomizationFactor,
-		Multiplier:          DefaultMultiplier,
-		MaxInterval:         DefaultMaxInterval,
-		MaxElapsedTime:      DefaultMaxElapsedTime,
-		Stop:                Stop,
-		Clock:               SystemClock,
-	}
-	b.Reset()
-	return b
-}
-
-type systemClock struct{}
-
-func (t systemClock) Now() time.Time {
-	return time.Now()
-}
-
-// SystemClock implements Clock interface that uses time.Now().
-var SystemClock = systemClock{}
-
-// Reset the interval back to the initial retry interval and restarts the timer.
-// Reset must be called before using b.
-func (b *ExponentialBackOff) Reset() {
-	b.currentInterval = b.InitialInterval
-	b.startTime = b.Clock.Now()
-}
-
-// NextBackOff calculates the next backoff interval using the formula:
-// 	Randomized interval = RetryInterval * (1 ± RandomizationFactor)
-func (b *ExponentialBackOff) NextBackOff() time.Duration {
-	// Make sure we have not gone over the maximum elapsed time.
-	elapsed := b.GetElapsedTime()
-	next := getRandomValueFromInterval(b.RandomizationFactor, rand.Float64(), b.currentInterval)
-	b.incrementCurrentInterval()
-	if b.MaxElapsedTime != 0 && elapsed+next > b.MaxElapsedTime {
-		return b.Stop
-	}
-	return next
-}
-
-// GetElapsedTime returns the elapsed time since an ExponentialBackOff instance
-// is created and is reset when Reset() is called.
-//
-// The elapsed time is computed using time.Now().UnixNano(). It is
-// safe to call even while the backoff policy is used by a running
-// ticker.
-func (b *ExponentialBackOff) GetElapsedTime() time.Duration {
-	return b.Clock.Now().Sub(b.startTime)
-}
-
-// Increments the current interval by multiplying it with the multiplier.
-func (b *ExponentialBackOff) incrementCurrentInterval() {
-	// Check for overflow, if overflow is detected set the current interval to the max interval.
-	if float64(b.currentInterval) >= float64(b.MaxInterval)/b.Multiplier {
-		b.currentInterval = b.MaxInterval
-	} else {
-		b.currentInterval = time.Duration(float64(b.currentInterval) * b.Multiplier)
-	}
-}
-
-// Returns a random value from the following interval:
-// 	[currentInterval - randomizationFactor * currentInterval, currentInterval + randomizationFactor * currentInterval].
-func getRandomValueFromInterval(randomizationFactor, random float64, currentInterval time.Duration) time.Duration {
-	if randomizationFactor == 0 {
-		return currentInterval // make sure no randomness is used when randomizationFactor is 0.
-	}
-	var delta = randomizationFactor * float64(currentInterval)
-	var minInterval = float64(currentInterval) - delta
-	var maxInterval = float64(currentInterval) + delta
-
-	// Get a random value from the range [minInterval, maxInterval].
-	// The formula used below has a +1 because if the minInterval is 1 and the maxInterval is 3 then
-	// we want a 33% chance for selecting either 1, 2 or 3.
-	return time.Duration(minInterval + (random * (maxInterval - minInterval + 1)))
-}

+ 0 - 146
vendor/github.com/cenkalti/backoff/v4/retry.go

@@ -1,146 +0,0 @@
-package backoff
-
-import (
-	"errors"
-	"time"
-)
-
-// An OperationWithData is executing by RetryWithData() or RetryNotifyWithData().
-// The operation will be retried using a backoff policy if it returns an error.
-type OperationWithData[T any] func() (T, error)
-
-// An Operation is executing by Retry() or RetryNotify().
-// The operation will be retried using a backoff policy if it returns an error.
-type Operation func() error
-
-func (o Operation) withEmptyData() OperationWithData[struct{}] {
-	return func() (struct{}, error) {
-		return struct{}{}, o()
-	}
-}
-
-// Notify is a notify-on-error function. It receives an operation error and
-// backoff delay if the operation failed (with an error).
-//
-// NOTE that if the backoff policy stated to stop retrying,
-// the notify function isn't called.
-type Notify func(error, time.Duration)
-
-// Retry the operation o until it does not return error or BackOff stops.
-// o is guaranteed to be run at least once.
-//
-// If o returns a *PermanentError, the operation is not retried, and the
-// wrapped error is returned.
-//
-// Retry sleeps the goroutine for the duration returned by BackOff after a
-// failed operation returns.
-func Retry(o Operation, b BackOff) error {
-	return RetryNotify(o, b, nil)
-}
-
-// RetryWithData is like Retry but returns data in the response too.
-func RetryWithData[T any](o OperationWithData[T], b BackOff) (T, error) {
-	return RetryNotifyWithData(o, b, nil)
-}
-
-// RetryNotify calls notify function with the error and wait duration
-// for each failed attempt before sleep.
-func RetryNotify(operation Operation, b BackOff, notify Notify) error {
-	return RetryNotifyWithTimer(operation, b, notify, nil)
-}
-
-// RetryNotifyWithData is like RetryNotify but returns data in the response too.
-func RetryNotifyWithData[T any](operation OperationWithData[T], b BackOff, notify Notify) (T, error) {
-	return doRetryNotify(operation, b, notify, nil)
-}
-
-// RetryNotifyWithTimer calls notify function with the error and wait duration using the given Timer
-// for each failed attempt before sleep.
-// A default timer that uses system timer is used when nil is passed.
-func RetryNotifyWithTimer(operation Operation, b BackOff, notify Notify, t Timer) error {
-	_, err := doRetryNotify(operation.withEmptyData(), b, notify, t)
-	return err
-}
-
-// RetryNotifyWithTimerAndData is like RetryNotifyWithTimer but returns data in the response too.
-func RetryNotifyWithTimerAndData[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {
-	return doRetryNotify(operation, b, notify, t)
-}
-
-func doRetryNotify[T any](operation OperationWithData[T], b BackOff, notify Notify, t Timer) (T, error) {
-	var (
-		err  error
-		next time.Duration
-		res  T
-	)
-	if t == nil {
-		t = &defaultTimer{}
-	}
-
-	defer func() {
-		t.Stop()
-	}()
-
-	ctx := getContext(b)
-
-	b.Reset()
-	for {
-		res, err = operation()
-		if err == nil {
-			return res, nil
-		}
-
-		var permanent *PermanentError
-		if errors.As(err, &permanent) {
-			return res, permanent.Err
-		}
-
-		if next = b.NextBackOff(); next == Stop {
-			if cerr := ctx.Err(); cerr != nil {
-				return res, cerr
-			}
-
-			return res, err
-		}
-
-		if notify != nil {
-			notify(err, next)
-		}
-
-		t.Start(next)
-
-		select {
-		case <-ctx.Done():
-			return res, ctx.Err()
-		case <-t.C():
-		}
-	}
-}
-
-// PermanentError signals that the operation should not be retried.
-type PermanentError struct {
-	Err error
-}
-
-func (e *PermanentError) Error() string {
-	return e.Err.Error()
-}
-
-func (e *PermanentError) Unwrap() error {
-	return e.Err
-}
-
-func (e *PermanentError) Is(target error) bool {
-	_, ok := target.(*PermanentError)
-	return ok
-}
-
-// Permanent wraps the given err in a *PermanentError.
-func Permanent(err error) error {
-	if err == nil {
-		return nil
-	}
-	return &PermanentError{
-		Err: err,
-	}
-}

+ 0 - 97
vendor/github.com/cenkalti/backoff/v4/ticker.go

@@ -1,97 +0,0 @@
-package backoff
-
-import (
-	"context"
-	"sync"
-	"time"
-)
-
-// Ticker holds a channel that delivers `ticks' of a clock at times reported by a BackOff.
-//
-// Ticks will continue to arrive when the previous operation is still running,
-// so operations that take a while to fail could run in quick succession.
-type Ticker struct {
-	C        <-chan time.Time
-	c        chan time.Time
-	b        BackOff
-	ctx      context.Context
-	timer    Timer
-	stop     chan struct{}
-	stopOnce sync.Once
-}
-
-// NewTicker returns a new Ticker containing a channel that will send
-// the time at times specified by the BackOff argument. Ticker is
-// guaranteed to tick at least once.  The channel is closed when Stop
-// method is called or BackOff stops. It is not safe to manipulate the
-// provided backoff policy (notably calling NextBackOff or Reset)
-// while the ticker is running.
-func NewTicker(b BackOff) *Ticker {
-	return NewTickerWithTimer(b, &defaultTimer{})
-}
-
-// NewTickerWithTimer returns a new Ticker with a custom timer.
-// A default timer that uses system timer is used when nil is passed.
-func NewTickerWithTimer(b BackOff, timer Timer) *Ticker {
-	if timer == nil {
-		timer = &defaultTimer{}
-	}
-	c := make(chan time.Time)
-	t := &Ticker{
-		C:     c,
-		c:     c,
-		b:     b,
-		ctx:   getContext(b),
-		timer: timer,
-		stop:  make(chan struct{}),
-	}
-	t.b.Reset()
-	go t.run()
-	return t
-}
-
-// Stop turns off a ticker. After Stop, no more ticks will be sent.
-func (t *Ticker) Stop() {
-	t.stopOnce.Do(func() { close(t.stop) })
-}
-
-func (t *Ticker) run() {
-	c := t.c
-	defer close(c)
-
-	// Ticker is guaranteed to tick at least once.
-	afterC := t.send(time.Now())
-
-	for {
-		if afterC == nil {
-			return
-		}
-
-		select {
-		case tick := <-afterC:
-			afterC = t.send(tick)
-		case <-t.stop:
-			t.c = nil // Prevent future ticks from being sent to the channel.
-			return
-		case <-t.ctx.Done():
-			return
-		}
-	}
-}
-
-func (t *Ticker) send(tick time.Time) <-chan time.Time {
-	select {
-	case t.c <- tick:
-	case <-t.stop:
-		return nil
-	}
-
-	next := t.b.NextBackOff()
-	if next == Stop {
-		t.Stop()
-		return nil
-	}
-
-	t.timer.Start(next)
-	return t.timer.C()
-}

+ 0 - 35
vendor/github.com/cenkalti/backoff/v4/timer.go

@@ -1,35 +0,0 @@
-package backoff
-
-import "time"
-
-type Timer interface {
-	Start(duration time.Duration)
-	Stop()
-	C() <-chan time.Time
-}
-
-// defaultTimer implements Timer interface using time.Timer
-type defaultTimer struct {
-	timer *time.Timer
-}
-
-// C returns the timers channel which receives the current time when the timer fires.
-func (t *defaultTimer) C() <-chan time.Time {
-	return t.timer.C
-}
-
-// Start starts the timer to fire after the given duration
-func (t *defaultTimer) Start(duration time.Duration) {
-	if t.timer == nil {
-		t.timer = time.NewTimer(duration)
-	} else {
-		t.timer.Reset(duration)
-	}
-}
-
-// Stop is called when the timer is not used anymore and resources may be freed.
-func (t *defaultTimer) Stop() {
-	if t.timer != nil {
-		t.timer.Stop()
-	}
-}

+ 0 - 38
vendor/github.com/cenkalti/backoff/v4/tries.go

@@ -1,38 +0,0 @@
-package backoff
-
-import "time"
-
-/*
-WithMaxRetries creates a wrapper around another BackOff, which will
-return Stop if NextBackOff() has been called too many times since
-the last time Reset() was called
-
-Note: Implementation is not thread-safe.
-*/
-func WithMaxRetries(b BackOff, max uint64) BackOff {
-	return &backOffTries{delegate: b, maxTries: max}
-}
-
-type backOffTries struct {
-	delegate BackOff
-	maxTries uint64
-	numTries uint64
-}
-
-func (b *backOffTries) NextBackOff() time.Duration {
-	if b.maxTries == 0 {
-		return Stop
-	}
-	if b.maxTries > 0 {
-		if b.maxTries <= b.numTries {
-			return Stop
-		}
-		b.numTries++
-	}
-	return b.delegate.NextBackOff()
-}
-
-func (b *backOffTries) Reset() {
-	b.numTries = 0
-	b.delegate.Reset()
-}

+ 0 - 22
vendor/github.com/cespare/xxhash/v2/LICENSE.txt

@@ -1,22 +0,0 @@
-Copyright (c) 2016 Caleb Spare
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 72
vendor/github.com/cespare/xxhash/v2/README.md

@@ -1,72 +0,0 @@
-# xxhash
-
-[![Go Reference](https://pkg.go.dev/badge/github.com/cespare/xxhash/v2.svg)](https://pkg.go.dev/github.com/cespare/xxhash/v2)
-[![Test](https://github.com/cespare/xxhash/actions/workflows/test.yml/badge.svg)](https://github.com/cespare/xxhash/actions/workflows/test.yml)
-
-xxhash is a Go implementation of the 64-bit [xxHash] algorithm, XXH64. This is a
-high-quality hashing algorithm that is much faster than anything in the Go
-standard library.
-
-This package provides a straightforward API:
-
-```
-func Sum64(b []byte) uint64
-func Sum64String(s string) uint64
-type Digest struct{ ... }
-    func New() *Digest
-```
-
-The `Digest` type implements hash.Hash64. Its key methods are:
-
-```
-func (*Digest) Write([]byte) (int, error)
-func (*Digest) WriteString(string) (int, error)
-func (*Digest) Sum64() uint64
-```
-
-The package is written with optimized pure Go and also contains even faster
-assembly implementations for amd64 and arm64. If desired, the `purego` build tag
-opts into using the Go code even on those architectures.
-
-[xxHash]: http://cyan4973.github.io/xxHash/
-
-## Compatibility
-
-This package is in a module and the latest code is in version 2 of the module.
-You need a version of Go with at least "minimal module compatibility" to use
-github.com/cespare/xxhash/v2:
-
-* 1.9.7+ for Go 1.9
-* 1.10.3+ for Go 1.10
-* Go 1.11 or later
-
-I recommend using the latest release of Go.
-
-## Benchmarks
-
-Here are some quick benchmarks comparing the pure-Go and assembly
-implementations of Sum64.
-
-| input size | purego    | asm       |
-| ---------- | --------- | --------- |
-| 4 B        |  1.3 GB/s |  1.2 GB/s |
-| 16 B       |  2.9 GB/s |  3.5 GB/s |
-| 100 B      |  6.9 GB/s |  8.1 GB/s |
-| 4 KB       | 11.7 GB/s | 16.7 GB/s |
-| 10 MB      | 12.0 GB/s | 17.3 GB/s |
-
-These numbers were generated on Ubuntu 20.04 with an Intel Xeon Platinum 8252C
-CPU using the following commands under Go 1.19.2:
-
-```
-benchstat <(go test -tags purego -benchtime 500ms -count 15 -bench 'Sum64$')
-benchstat <(go test -benchtime 500ms -count 15 -bench 'Sum64$')
-```
-
-## Projects using this package
-
-- [InfluxDB](https://github.com/influxdata/influxdb)
-- [Prometheus](https://github.com/prometheus/prometheus)
-- [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics)
-- [FreeCache](https://github.com/coocood/freecache)
-- [FastCache](https://github.com/VictoriaMetrics/fastcache)

+ 0 - 10
vendor/github.com/cespare/xxhash/v2/testall.sh

@@ -1,10 +0,0 @@
-#!/bin/bash
-set -eu -o pipefail
-
-# Small convenience script for running the tests with various combinations of
-# arch/tags. This assumes we're running on amd64 and have qemu available.
-
-go test ./...
-go test -tags purego ./...
-GOARCH=arm64 go test
-GOARCH=arm64 go test -tags purego

+ 0 - 228
vendor/github.com/cespare/xxhash/v2/xxhash.go

@@ -1,228 +0,0 @@
-// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described
-// at http://cyan4973.github.io/xxHash/.
-package xxhash
-
-import (
-	"encoding/binary"
-	"errors"
-	"math/bits"
-)
-
-const (
-	prime1 uint64 = 11400714785074694791
-	prime2 uint64 = 14029467366897019727
-	prime3 uint64 = 1609587929392839161
-	prime4 uint64 = 9650029242287828579
-	prime5 uint64 = 2870177450012600261
-)
-
-// Store the primes in an array as well.
-//
-// The consts are used when possible in Go code to avoid MOVs but we need a
-// contiguous array of the assembly code.
-var primes = [...]uint64{prime1, prime2, prime3, prime4, prime5}
-
-// Digest implements hash.Hash64.
-type Digest struct {
-	v1    uint64
-	v2    uint64
-	v3    uint64
-	v4    uint64
-	total uint64
-	mem   [32]byte
-	n     int // how much of mem is used
-}
-
-// New creates a new Digest that computes the 64-bit xxHash algorithm.
-func New() *Digest {
-	var d Digest
-	d.Reset()
-	return &d
-}
-
-// Reset clears the Digest's state so that it can be reused.
-func (d *Digest) Reset() {
-	d.v1 = primes[0] + prime2
-	d.v2 = prime2
-	d.v3 = 0
-	d.v4 = -primes[0]
-	d.total = 0
-	d.n = 0
-}
-
-// Size always returns 8 bytes.
-func (d *Digest) Size() int { return 8 }
-
-// BlockSize always returns 32 bytes.
-func (d *Digest) BlockSize() int { return 32 }
-
-// Write adds more data to d. It always returns len(b), nil.
-func (d *Digest) Write(b []byte) (n int, err error) {
-	n = len(b)
-	d.total += uint64(n)
-
-	memleft := d.mem[d.n&(len(d.mem)-1):]
-
-	if d.n+n < 32 {
-		// This new data doesn't even fill the current block.
-		copy(memleft, b)
-		d.n += n
-		return
-	}
-
-	if d.n > 0 {
-		// Finish off the partial block.
-		c := copy(memleft, b)
-		d.v1 = round(d.v1, u64(d.mem[0:8]))
-		d.v2 = round(d.v2, u64(d.mem[8:16]))
-		d.v3 = round(d.v3, u64(d.mem[16:24]))
-		d.v4 = round(d.v4, u64(d.mem[24:32]))
-		b = b[c:]
-		d.n = 0
-	}
-
-	if len(b) >= 32 {
-		// One or more full blocks left.
-		nw := writeBlocks(d, b)
-		b = b[nw:]
-	}
-
-	// Store any remaining partial block.
-	copy(d.mem[:], b)
-	d.n = len(b)
-
-	return
-}
-
-// Sum appends the current hash to b and returns the resulting slice.
-func (d *Digest) Sum(b []byte) []byte {
-	s := d.Sum64()
-	return append(
-		b,
-		byte(s>>56),
-		byte(s>>48),
-		byte(s>>40),
-		byte(s>>32),
-		byte(s>>24),
-		byte(s>>16),
-		byte(s>>8),
-		byte(s),
-	)
-}
-
-// Sum64 returns the current hash.
-func (d *Digest) Sum64() uint64 {
-	var h uint64
-
-	if d.total >= 32 {
-		v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
-		h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
-		h = mergeRound(h, v1)
-		h = mergeRound(h, v2)
-		h = mergeRound(h, v3)
-		h = mergeRound(h, v4)
-	} else {
-		h = d.v3 + prime5
-	}
-
-	h += d.total
-
-	b := d.mem[:d.n&(len(d.mem)-1)]
-	for ; len(b) >= 8; b = b[8:] {
-		k1 := round(0, u64(b[:8]))
-		h ^= k1
-		h = rol27(h)*prime1 + prime4
-	}
-	if len(b) >= 4 {
-		h ^= uint64(u32(b[:4])) * prime1
-		h = rol23(h)*prime2 + prime3
-		b = b[4:]
-	}
-	for ; len(b) > 0; b = b[1:] {
-		h ^= uint64(b[0]) * prime5
-		h = rol11(h) * prime1
-	}
-
-	h ^= h >> 33
-	h *= prime2
-	h ^= h >> 29
-	h *= prime3
-	h ^= h >> 32
-
-	return h
-}
-
-const (
-	magic         = "xxh\x06"
-	marshaledSize = len(magic) + 8*5 + 32
-)
-
-// MarshalBinary implements the encoding.BinaryMarshaler interface.
-func (d *Digest) MarshalBinary() ([]byte, error) {
-	b := make([]byte, 0, marshaledSize)
-	b = append(b, magic...)
-	b = appendUint64(b, d.v1)
-	b = appendUint64(b, d.v2)
-	b = appendUint64(b, d.v3)
-	b = appendUint64(b, d.v4)
-	b = appendUint64(b, d.total)
-	b = append(b, d.mem[:d.n]...)
-	b = b[:len(b)+len(d.mem)-d.n]
-	return b, nil
-}
-
-// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
-func (d *Digest) UnmarshalBinary(b []byte) error {
-	if len(b) < len(magic) || string(b[:len(magic)]) != magic {
-		return errors.New("xxhash: invalid hash state identifier")
-	}
-	if len(b) != marshaledSize {
-		return errors.New("xxhash: invalid hash state size")
-	}
-	b = b[len(magic):]
-	b, d.v1 = consumeUint64(b)
-	b, d.v2 = consumeUint64(b)
-	b, d.v3 = consumeUint64(b)
-	b, d.v4 = consumeUint64(b)
-	b, d.total = consumeUint64(b)
-	copy(d.mem[:], b)
-	d.n = int(d.total % uint64(len(d.mem)))
-	return nil
-}
-
-func appendUint64(b []byte, x uint64) []byte {
-	var a [8]byte
-	binary.LittleEndian.PutUint64(a[:], x)
-	return append(b, a[:]...)
-}
-
-func consumeUint64(b []byte) ([]byte, uint64) {
-	x := u64(b)
-	return b[8:], x
-}
-
-func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }
-func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }
-
-func round(acc, input uint64) uint64 {
-	acc += input * prime2
-	acc = rol31(acc)
-	acc *= prime1
-	return acc
-}
-
-func mergeRound(acc, val uint64) uint64 {
-	val = round(0, val)
-	acc ^= val
-	acc = acc*prime1 + prime4
-	return acc
-}
-
-func rol1(x uint64) uint64  { return bits.RotateLeft64(x, 1) }
-func rol7(x uint64) uint64  { return bits.RotateLeft64(x, 7) }
-func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }
-func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }
-func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }
-func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }
-func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }
-func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }

+ 0 - 209
vendor/github.com/cespare/xxhash/v2/xxhash_amd64.s

@@ -1,209 +0,0 @@
-//go:build !appengine && gc && !purego
-// +build !appengine
-// +build gc
-// +build !purego
-
-#include "textflag.h"
-
-// Registers:
-#define h      AX
-#define d      AX
-#define p      SI // pointer to advance through b
-#define n      DX
-#define end    BX // loop end
-#define v1     R8
-#define v2     R9
-#define v3     R10
-#define v4     R11
-#define x      R12
-#define prime1 R13
-#define prime2 R14
-#define prime4 DI
-
-#define round(acc, x) \
-	IMULQ prime2, x   \
-	ADDQ  x, acc      \
-	ROLQ  $31, acc    \
-	IMULQ prime1, acc
-
-// round0 performs the operation x = round(0, x).
-#define round0(x) \
-	IMULQ prime2, x \
-	ROLQ  $31, x    \
-	IMULQ prime1, x
-
-// mergeRound applies a merge round on the two registers acc and x.
-// It assumes that prime1, prime2, and prime4 have been loaded.
-#define mergeRound(acc, x) \
-	round0(x)         \
-	XORQ  x, acc      \
-	IMULQ prime1, acc \
-	ADDQ  prime4, acc
-
-// blockLoop processes as many 32-byte blocks as possible,
-// updating v1, v2, v3, and v4. It assumes that there is at least one block
-// to process.
-#define blockLoop() \
-loop:  \
-	MOVQ +0(p), x  \
-	round(v1, x)   \
-	MOVQ +8(p), x  \
-	round(v2, x)   \
-	MOVQ +16(p), x \
-	round(v3, x)   \
-	MOVQ +24(p), x \
-	round(v4, x)   \
-	ADDQ $32, p    \
-	CMPQ p, end    \
-	JLE  loop
-
-// func Sum64(b []byte) uint64
-TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32
-	// Load fixed primes.
-	MOVQ ·primes+0(SB), prime1
-	MOVQ ·primes+8(SB), prime2
-	MOVQ ·primes+24(SB), prime4
-
-	// Load slice.
-	MOVQ b_base+0(FP), p
-	MOVQ b_len+8(FP), n
-	LEAQ (p)(n*1), end
-
-	// The first loop limit will be len(b)-32.
-	SUBQ $32, end
-
-	// Check whether we have at least one block.
-	CMPQ n, $32
-	JLT  noBlocks
-
-	// Set up initial state (v1, v2, v3, v4).
-	MOVQ prime1, v1
-	ADDQ prime2, v1
-	MOVQ prime2, v2
-	XORQ v3, v3
-	XORQ v4, v4
-	SUBQ prime1, v4
-
-	blockLoop()
-
-	MOVQ v1, h
-	ROLQ $1, h
-	MOVQ v2, x
-	ROLQ $7, x
-	ADDQ x, h
-	MOVQ v3, x
-	ROLQ $12, x
-	ADDQ x, h
-	MOVQ v4, x
-	ROLQ $18, x
-	ADDQ x, h
-
-	mergeRound(h, v1)
-	mergeRound(h, v2)
-	mergeRound(h, v3)
-	mergeRound(h, v4)
-
-	JMP afterBlocks
-
-noBlocks:
-	MOVQ ·primes+32(SB), h
-
-afterBlocks:
-	ADDQ n, h
-
-	ADDQ $24, end
-	CMPQ p, end
-	JG   try4
-
-loop8:
-	MOVQ  (p), x
-	ADDQ  $8, p
-	round0(x)
-	XORQ  x, h
-	ROLQ  $27, h
-	IMULQ prime1, h
-	ADDQ  prime4, h
-
-	CMPQ p, end
-	JLE  loop8
-
-try4:
-	ADDQ $4, end
-	CMPQ p, end
-	JG   try1
-
-	MOVL  (p), x
-	ADDQ  $4, p
-	IMULQ prime1, x
-	XORQ  x, h
-
-	ROLQ  $23, h
-	IMULQ prime2, h
-	ADDQ  ·primes+16(SB), h
-
-try1:
-	ADDQ $4, end
-	CMPQ p, end
-	JGE  finalize
-
-loop1:
-	MOVBQZX (p), x
-	ADDQ    $1, p
-	IMULQ   ·primes+32(SB), x
-	XORQ    x, h
-	ROLQ    $11, h
-	IMULQ   prime1, h
-
-	CMPQ p, end
-	JL   loop1
-
-finalize:
-	MOVQ  h, x
-	SHRQ  $33, x
-	XORQ  x, h
-	IMULQ prime2, h
-	MOVQ  h, x
-	SHRQ  $29, x
-	XORQ  x, h
-	IMULQ ·primes+16(SB), h
-	MOVQ  h, x
-	SHRQ  $32, x
-	XORQ  x, h
-
-	MOVQ h, ret+24(FP)
-	RET
-
-// func writeBlocks(d *Digest, b []byte) int
-TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40
-	// Load fixed primes needed for round.
-	MOVQ ·primes+0(SB), prime1
-	MOVQ ·primes+8(SB), prime2
-
-	// Load slice.
-	MOVQ b_base+8(FP), p
-	MOVQ b_len+16(FP), n
-	LEAQ (p)(n*1), end
-	SUBQ $32, end
-
-	// Load vN from d.
-	MOVQ s+0(FP), d
-	MOVQ 0(d), v1
-	MOVQ 8(d), v2
-	MOVQ 16(d), v3
-	MOVQ 24(d), v4
-
-	// We don't need to check the loop condition here; this function is
-	// always called with at least one block of data to process.
-	blockLoop()
-
-	// Copy vN back to d.
-	MOVQ v1, 0(d)
-	MOVQ v2, 8(d)
-	MOVQ v3, 16(d)
-	MOVQ v4, 24(d)
-
-	// The number of bytes written is p minus the old base pointer.
-	SUBQ b_base+8(FP), p
-	MOVQ p, ret+32(FP)
-
-	RET

+ 0 - 183
vendor/github.com/cespare/xxhash/v2/xxhash_arm64.s

@@ -1,183 +0,0 @@
-//go:build !appengine && gc && !purego
-// +build !appengine
-// +build gc
-// +build !purego
-
-#include "textflag.h"
-
-// Registers:
-#define digest	R1
-#define h	R2 // return value
-#define p	R3 // input pointer
-#define n	R4 // input length
-#define nblocks	R5 // n / 32
-#define prime1	R7
-#define prime2	R8
-#define prime3	R9
-#define prime4	R10
-#define prime5	R11
-#define v1	R12
-#define v2	R13
-#define v3	R14
-#define v4	R15
-#define x1	R20
-#define x2	R21
-#define x3	R22
-#define x4	R23
-
-#define round(acc, x) \
-	MADD prime2, acc, x, acc \
-	ROR  $64-31, acc         \
-	MUL  prime1, acc
-
-// round0 performs the operation x = round(0, x).
-#define round0(x) \
-	MUL prime2, x \
-	ROR $64-31, x \
-	MUL prime1, x
-
-#define mergeRound(acc, x) \
-	round0(x)                     \
-	EOR  x, acc                   \
-	MADD acc, prime4, prime1, acc
-
-// blockLoop processes as many 32-byte blocks as possible,
-// updating v1, v2, v3, and v4. It assumes that n >= 32.
-#define blockLoop() \
-	LSR     $5, n, nblocks  \
-	PCALIGN $16             \
-	loop:                   \
-	LDP.P   16(p), (x1, x2) \
-	LDP.P   16(p), (x3, x4) \
-	round(v1, x1)           \
-	round(v2, x2)           \
-	round(v3, x3)           \
-	round(v4, x4)           \
-	SUB     $1, nblocks     \
-	CBNZ    nblocks, loop
-
-// func Sum64(b []byte) uint64
-TEXT ·Sum64(SB), NOSPLIT|NOFRAME, $0-32
-	LDP b_base+0(FP), (p, n)
-
-	LDP  ·primes+0(SB), (prime1, prime2)
-	LDP  ·primes+16(SB), (prime3, prime4)
-	MOVD ·primes+32(SB), prime5
-
-	CMP  $32, n
-	CSEL LT, prime5, ZR, h // if n < 32 { h = prime5 } else { h = 0 }
-	BLT  afterLoop
-
-	ADD  prime1, prime2, v1
-	MOVD prime2, v2
-	MOVD $0, v3
-	NEG  prime1, v4
-
-	blockLoop()
-
-	ROR $64-1, v1, x1
-	ROR $64-7, v2, x2
-	ADD x1, x2
-	ROR $64-12, v3, x3
-	ROR $64-18, v4, x4
-	ADD x3, x4
-	ADD x2, x4, h
-
-	mergeRound(h, v1)
-	mergeRound(h, v2)
-	mergeRound(h, v3)
-	mergeRound(h, v4)
-
-afterLoop:
-	ADD n, h
-
-	TBZ   $4, n, try8
-	LDP.P 16(p), (x1, x2)
-
-	round0(x1)
-
-	// NOTE: here and below, sequencing the EOR after the ROR (using a
-	// rotated register) is worth a small but measurable speedup for small
-	// inputs.
-	ROR  $64-27, h
-	EOR  x1 @> 64-27, h, h
-	MADD h, prime4, prime1, h
-
-	round0(x2)
-	ROR  $64-27, h
-	EOR  x2 @> 64-27, h, h
-	MADD h, prime4, prime1, h
-
-try8:
-	TBZ    $3, n, try4
-	MOVD.P 8(p), x1
-
-	round0(x1)
-	ROR  $64-27, h
-	EOR  x1 @> 64-27, h, h
-	MADD h, prime4, prime1, h
-
-try4:
-	TBZ     $2, n, try2
-	MOVWU.P 4(p), x2
-
-	MUL  prime1, x2
-	ROR  $64-23, h
-	EOR  x2 @> 64-23, h, h
-	MADD h, prime3, prime2, h
-
-try2:
-	TBZ     $1, n, try1
-	MOVHU.P 2(p), x3
-	AND     $255, x3, x1
-	LSR     $8, x3, x2
-
-	MUL prime5, x1
-	ROR $64-11, h
-	EOR x1 @> 64-11, h, h
-	MUL prime1, h
-
-	MUL prime5, x2
-	ROR $64-11, h
-	EOR x2 @> 64-11, h, h
-	MUL prime1, h
-
-try1:
-	TBZ   $0, n, finalize
-	MOVBU (p), x4
-
-	MUL prime5, x4
-	ROR $64-11, h
-	EOR x4 @> 64-11, h, h
-	MUL prime1, h
-
-finalize:
-	EOR h >> 33, h
-	MUL prime2, h
-	EOR h >> 29, h
-	MUL prime3, h
-	EOR h >> 32, h
-
-	MOVD h, ret+24(FP)
-	RET
-
-// func writeBlocks(d *Digest, b []byte) int
-TEXT ·writeBlocks(SB), NOSPLIT|NOFRAME, $0-40
-	LDP ·primes+0(SB), (prime1, prime2)
-
-	// Load state. Assume v[1-4] are stored contiguously.
-	MOVD d+0(FP), digest
-	LDP  0(digest), (v1, v2)
-	LDP  16(digest), (v3, v4)
-
-	LDP b_base+8(FP), (p, n)
-
-	blockLoop()
-
-	// Store updated state.
-	STP (v1, v2), 0(digest)
-	STP (v3, v4), 16(digest)
-
-	BIC  $31, n
-	MOVD n, ret+32(FP)
-	RET

+ 0 - 15
vendor/github.com/cespare/xxhash/v2/xxhash_asm.go

@@ -1,15 +0,0 @@
-//go:build (amd64 || arm64) && !appengine && gc && !purego
-// +build amd64 arm64
-// +build !appengine
-// +build gc
-// +build !purego
-
-package xxhash
-
-// Sum64 computes the 64-bit xxHash digest of b.
-//
-//go:noescape
-func Sum64(b []byte) uint64
-
-//go:noescape
-func writeBlocks(d *Digest, b []byte) int

+ 0 - 76
vendor/github.com/cespare/xxhash/v2/xxhash_other.go

@@ -1,76 +0,0 @@
-//go:build (!amd64 && !arm64) || appengine || !gc || purego
-// +build !amd64,!arm64 appengine !gc purego
-
-package xxhash
-
-// Sum64 computes the 64-bit xxHash digest of b.
-func Sum64(b []byte) uint64 {
-	// A simpler version would be
-	//   d := New()
-	//   d.Write(b)
-	//   return d.Sum64()
-	// but this is faster, particularly for small inputs.
-
-	n := len(b)
-	var h uint64
-
-	if n >= 32 {
-		v1 := primes[0] + prime2
-		v2 := prime2
-		v3 := uint64(0)
-		v4 := -primes[0]
-		for len(b) >= 32 {
-			v1 = round(v1, u64(b[0:8:len(b)]))
-			v2 = round(v2, u64(b[8:16:len(b)]))
-			v3 = round(v3, u64(b[16:24:len(b)]))
-			v4 = round(v4, u64(b[24:32:len(b)]))
-			b = b[32:len(b):len(b)]
-		}
-		h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)
-		h = mergeRound(h, v1)
-		h = mergeRound(h, v2)
-		h = mergeRound(h, v3)
-		h = mergeRound(h, v4)
-	} else {
-		h = prime5
-	}
-
-	h += uint64(n)
-
-	for ; len(b) >= 8; b = b[8:] {
-		k1 := round(0, u64(b[:8]))
-		h ^= k1
-		h = rol27(h)*prime1 + prime4
-	}
-	if len(b) >= 4 {
-		h ^= uint64(u32(b[:4])) * prime1
-		h = rol23(h)*prime2 + prime3
-		b = b[4:]
-	}
-	for ; len(b) > 0; b = b[1:] {
-		h ^= uint64(b[0]) * prime5
-		h = rol11(h) * prime1
-	}
-
-	h ^= h >> 33
-	h *= prime2
-	h ^= h >> 29
-	h *= prime3
-	h ^= h >> 32
-
-	return h
-}
-
-func writeBlocks(d *Digest, b []byte) int {
-	v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4
-	n := len(b)
-	for len(b) >= 32 {
-		v1 = round(v1, u64(b[0:8:len(b)]))
-		v2 = round(v2, u64(b[8:16:len(b)]))
-		v3 = round(v3, u64(b[16:24:len(b)]))
-		v4 = round(v4, u64(b[24:32:len(b)]))
-		b = b[32:len(b):len(b)]
-	}
-	d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4
-	return n - len(b)
-}

+ 0 - 16
vendor/github.com/cespare/xxhash/v2/xxhash_safe.go

@@ -1,16 +0,0 @@
-//go:build appengine
-// +build appengine
-
-// This file contains the safe implementations of otherwise unsafe-using code.
-
-package xxhash
-
-// Sum64String computes the 64-bit xxHash digest of s.
-func Sum64String(s string) uint64 {
-	return Sum64([]byte(s))
-}
-
-// WriteString adds more data to d. It always returns len(s), nil.
-func (d *Digest) WriteString(s string) (n int, err error) {
-	return d.Write([]byte(s))
-}

+ 0 - 58
vendor/github.com/cespare/xxhash/v2/xxhash_unsafe.go

@@ -1,58 +0,0 @@
-//go:build !appengine
-// +build !appengine
-
-// This file encapsulates usage of unsafe.
-// xxhash_safe.go contains the safe implementations.
-
-package xxhash
-
-import (
-	"unsafe"
-)
-
-// In the future it's possible that compiler optimizations will make these
-// XxxString functions unnecessary by realizing that calls such as
-// Sum64([]byte(s)) don't need to copy s. See https://go.dev/issue/2205.
-// If that happens, even if we keep these functions they can be replaced with
-// the trivial safe code.
-
-// NOTE: The usual way of doing an unsafe string-to-[]byte conversion is:
-//
-//   var b []byte
-//   bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
-//   bh.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data
-//   bh.Len = len(s)
-//   bh.Cap = len(s)
-//
-// Unfortunately, as of Go 1.15.3 the inliner's cost model assigns a high enough
-// weight to this sequence of expressions that any function that uses it will
-// not be inlined. Instead, the functions below use a different unsafe
-// conversion designed to minimize the inliner weight and allow both to be
-// inlined. There is also a test (TestInlining) which verifies that these are
-// inlined.
-//
-// See https://github.com/golang/go/issues/42739 for discussion.
-
-// Sum64String computes the 64-bit xxHash digest of s.
-// It may be faster than Sum64([]byte(s)) by avoiding a copy.
-func Sum64String(s string) uint64 {
-	b := *(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)}))
-	return Sum64(b)
-}
-
-// WriteString adds more data to d. It always returns len(s), nil.
-// It may be faster than Write([]byte(s)) by avoiding a copy.
-func (d *Digest) WriteString(s string) (n int, err error) {
-	d.Write(*(*[]byte)(unsafe.Pointer(&sliceHeader{s, len(s)})))
-	// d.Write always returns len(s), nil.
-	// Ignoring the return output and returning these fixed values buys a
-	// savings of 6 in the inliner's cost model.
-	return len(s), nil
-}
-
-// sliceHeader is similar to reflect.SliceHeader, but it assumes that the layout
-// of the first two words is the same as the layout of a string.
-type sliceHeader struct {
-	s   string
-	cap int
-}

+ 0 - 202
vendor/github.com/coreos/go-semver/LICENSE

@@ -1,202 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

+ 0 - 5
vendor/github.com/coreos/go-semver/NOTICE

@@ -1,5 +0,0 @@
-CoreOS Project
-Copyright 2018 CoreOS, Inc
-
-This product includes software developed at CoreOS, Inc.
-(http://www.coreos.com/).

+ 0 - 296
vendor/github.com/coreos/go-semver/semver/semver.go

@@ -1,296 +0,0 @@
-// Copyright 2013-2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Semantic Versions http://semver.org
-package semver
-
-import (
-	"bytes"
-	"errors"
-	"fmt"
-	"regexp"
-	"strconv"
-	"strings"
-)
-
-type Version struct {
-	Major      int64
-	Minor      int64
-	Patch      int64
-	PreRelease PreRelease
-	Metadata   string
-}
-
-type PreRelease string
-
-func splitOff(input *string, delim string) (val string) {
-	parts := strings.SplitN(*input, delim, 2)
-
-	if len(parts) == 2 {
-		*input = parts[0]
-		val = parts[1]
-	}
-
-	return val
-}
-
-func New(version string) *Version {
-	return Must(NewVersion(version))
-}
-
-func NewVersion(version string) (*Version, error) {
-	v := Version{}
-
-	if err := v.Set(version); err != nil {
-		return nil, err
-	}
-
-	return &v, nil
-}
-
-// Must is a helper for wrapping NewVersion and will panic if err is not nil.
-func Must(v *Version, err error) *Version {
-	if err != nil {
-		panic(err)
-	}
-	return v
-}
-
-// Set parses and updates v from the given version string. Implements flag.Value
-func (v *Version) Set(version string) error {
-	metadata := splitOff(&version, "+")
-	preRelease := PreRelease(splitOff(&version, "-"))
-	dotParts := strings.SplitN(version, ".", 3)
-
-	if len(dotParts) != 3 {
-		return fmt.Errorf("%s is not in dotted-tri format", version)
-	}
-
-	if err := validateIdentifier(string(preRelease)); err != nil {
-		return fmt.Errorf("failed to validate pre-release: %v", err)
-	}
-
-	if err := validateIdentifier(metadata); err != nil {
-		return fmt.Errorf("failed to validate metadata: %v", err)
-	}
-
-	parsed := make([]int64, 3)
-
-	for i, v := range dotParts[:3] {
-		val, err := strconv.ParseInt(v, 10, 64)
-		parsed[i] = val
-		if err != nil {
-			return err
-		}
-	}
-
-	v.Metadata = metadata
-	v.PreRelease = preRelease
-	v.Major = parsed[0]
-	v.Minor = parsed[1]
-	v.Patch = parsed[2]
-	return nil
-}
-
-func (v Version) String() string {
-	var buffer bytes.Buffer
-
-	fmt.Fprintf(&buffer, "%d.%d.%d", v.Major, v.Minor, v.Patch)
-
-	if v.PreRelease != "" {
-		fmt.Fprintf(&buffer, "-%s", v.PreRelease)
-	}
-
-	if v.Metadata != "" {
-		fmt.Fprintf(&buffer, "+%s", v.Metadata)
-	}
-
-	return buffer.String()
-}
-
-func (v *Version) UnmarshalYAML(unmarshal func(interface{}) error) error {
-	var data string
-	if err := unmarshal(&data); err != nil {
-		return err
-	}
-	return v.Set(data)
-}
-
-func (v Version) MarshalJSON() ([]byte, error) {
-	return []byte(`"` + v.String() + `"`), nil
-}
-
-func (v *Version) UnmarshalJSON(data []byte) error {
-	l := len(data)
-	if l == 0 || string(data) == `""` {
-		return nil
-	}
-	if l < 2 || data[0] != '"' || data[l-1] != '"' {
-		return errors.New("invalid semver string")
-	}
-	return v.Set(string(data[1 : l-1]))
-}
-
-// Compare tests if v is less than, equal to, or greater than versionB,
-// returning -1, 0, or +1 respectively.
-func (v Version) Compare(versionB Version) int {
-	if cmp := recursiveCompare(v.Slice(), versionB.Slice()); cmp != 0 {
-		return cmp
-	}
-	return preReleaseCompare(v, versionB)
-}
-
-// Equal tests if v is equal to versionB.
-func (v Version) Equal(versionB Version) bool {
-	return v.Compare(versionB) == 0
-}
-
-// LessThan tests if v is less than versionB.
-func (v Version) LessThan(versionB Version) bool {
-	return v.Compare(versionB) < 0
-}
-
-// Slice converts the comparable parts of the semver into a slice of integers.
-func (v Version) Slice() []int64 {
-	return []int64{v.Major, v.Minor, v.Patch}
-}
-
-func (p PreRelease) Slice() []string {
-	preRelease := string(p)
-	return strings.Split(preRelease, ".")
-}
-
-func preReleaseCompare(versionA Version, versionB Version) int {
-	a := versionA.PreRelease
-	b := versionB.PreRelease
-
-	/* Handle the case where if two versions are otherwise equal it is the
-	 * one without a PreRelease that is greater */
-	if len(a) == 0 && (len(b) > 0) {
-		return 1
-	} else if len(b) == 0 && (len(a) > 0) {
-		return -1
-	}
-
-	// If there is a prerelease, check and compare each part.
-	return recursivePreReleaseCompare(a.Slice(), b.Slice())
-}
-
-func recursiveCompare(versionA []int64, versionB []int64) int {
-	if len(versionA) == 0 {
-		return 0
-	}
-
-	a := versionA[0]
-	b := versionB[0]
-
-	if a > b {
-		return 1
-	} else if a < b {
-		return -1
-	}
-
-	return recursiveCompare(versionA[1:], versionB[1:])
-}
-
-func recursivePreReleaseCompare(versionA []string, versionB []string) int {
-	// A larger set of pre-release fields has a higher precedence than a smaller set,
-	// if all of the preceding identifiers are equal.
-	if len(versionA) == 0 {
-		if len(versionB) > 0 {
-			return -1
-		}
-		return 0
-	} else if len(versionB) == 0 {
-		// We're longer than versionB so return 1.
-		return 1
-	}
-
-	a := versionA[0]
-	b := versionB[0]
-
-	aInt := false
-	bInt := false
-
-	aI, err := strconv.Atoi(versionA[0])
-	if err == nil {
-		aInt = true
-	}
-
-	bI, err := strconv.Atoi(versionB[0])
-	if err == nil {
-		bInt = true
-	}
-
-	// Numeric identifiers always have lower precedence than non-numeric identifiers.
-	if aInt && !bInt {
-		return -1
-	} else if !aInt && bInt {
-		return 1
-	}
-
-	// Handle Integer Comparison
-	if aInt && bInt {
-		if aI > bI {
-			return 1
-		} else if aI < bI {
-			return -1
-		}
-	}
-
-	// Handle String Comparison
-	if a > b {
-		return 1
-	} else if a < b {
-		return -1
-	}
-
-	return recursivePreReleaseCompare(versionA[1:], versionB[1:])
-}
-
-// BumpMajor increments the Major field by 1 and resets all other fields to their default values
-func (v *Version) BumpMajor() {
-	v.Major += 1
-	v.Minor = 0
-	v.Patch = 0
-	v.PreRelease = PreRelease("")
-	v.Metadata = ""
-}
-
-// BumpMinor increments the Minor field by 1 and resets all other fields to their default values
-func (v *Version) BumpMinor() {
-	v.Minor += 1
-	v.Patch = 0
-	v.PreRelease = PreRelease("")
-	v.Metadata = ""
-}
-
-// BumpPatch increments the Patch field by 1 and resets all other fields to their default values
-func (v *Version) BumpPatch() {
-	v.Patch += 1
-	v.PreRelease = PreRelease("")
-	v.Metadata = ""
-}
-
-// validateIdentifier makes sure the provided identifier satisfies semver spec
-func validateIdentifier(id string) error {
-	if id != "" && !reIdentifier.MatchString(id) {
-		return fmt.Errorf("%s is not a valid semver identifier", id)
-	}
-	return nil
-}
-
-// reIdentifier is a regular expression used to check that pre-release and metadata
-// identifiers satisfy the spec requirements
-var reIdentifier = regexp.MustCompile(`^[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*$`)

+ 0 - 38
vendor/github.com/coreos/go-semver/semver/sort.go

@@ -1,38 +0,0 @@
-// Copyright 2013-2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package semver
-
-import (
-	"sort"
-)
-
-type Versions []*Version
-
-func (s Versions) Len() int {
-	return len(s)
-}
-
-func (s Versions) Swap(i, j int) {
-	s[i], s[j] = s[j], s[i]
-}
-
-func (s Versions) Less(i, j int) bool {
-	return s[i].LessThan(*s[j])
-}
-
-// Sort sorts the given slice of Version
-func Sort(versions []*Version) {
-	sort.Sort(Versions(versions))
-}

+ 0 - 191
vendor/github.com/coreos/go-systemd/v22/LICENSE

@@ -1,191 +0,0 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and
-distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright
-owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities
-that control, are controlled by, or are under common control with that entity.
-For the purposes of this definition, "control" means (i) the power, direct or
-indirect, to cause the direction or management of such entity, whether by
-contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
-outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising
-permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including
-but not limited to software source code, documentation source, and configuration
-files.
-
-"Object" form shall mean any form resulting from mechanical transformation or
-translation of a Source form, including but not limited to compiled object code,
-generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made
-available under the License, as indicated by a copyright notice that is included
-in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that
-is based on (or derived from) the Work and for which the editorial revisions,
-annotations, elaborations, or other modifications represent, as a whole, an
-original work of authorship. For the purposes of this License, Derivative Works
-shall not include works that remain separable from, or merely link (or bind by
-name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version
-of the Work and any modifications or additions to that Work or Derivative Works
-thereof, that is intentionally submitted to Licensor for inclusion in the Work
-by the copyright owner or by an individual or Legal Entity authorized to submit
-on behalf of the copyright owner. For the purposes of this definition,
-"submitted" means any form of electronic, verbal, or written communication sent
-to the Licensor or its representatives, including but not limited to
-communication on electronic mailing lists, source code control systems, and
-issue tracking systems that are managed by, or on behalf of, the Licensor for
-the purpose of discussing and improving the Work, but excluding communication
-that is conspicuously marked or otherwise designated in writing by the copyright
-owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
-of whom a Contribution has been received by Licensor and subsequently
-incorporated within the Work.
-
-2. Grant of Copyright License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable copyright license to reproduce, prepare Derivative Works of,
-publicly display, publicly perform, sublicense, and distribute the Work and such
-Derivative Works in Source or Object form.
-
-3. Grant of Patent License.
-
-Subject to the terms and conditions of this License, each Contributor hereby
-grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
-irrevocable (except as stated in this section) patent license to make, have
-made, use, offer to sell, sell, import, and otherwise transfer the Work, where
-such license applies only to those patent claims licensable by such Contributor
-that are necessarily infringed by their Contribution(s) alone or by combination
-of their Contribution(s) with the Work to which such Contribution(s) was
-submitted. If You institute patent litigation against any entity (including a
-cross-claim or counterclaim in a lawsuit) alleging that the Work or a
-Contribution incorporated within the Work constitutes direct or contributory
-patent infringement, then any patent licenses granted to You under this License
-for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution.
-
-You may reproduce and distribute copies of the Work or Derivative Works thereof
-in any medium, with or without modifications, and in Source or Object form,
-provided that You meet the following conditions:
-
-You must give any other recipients of the Work or Derivative Works a copy of
-this License; and
-You must cause any modified files to carry prominent notices stating that You
-changed the files; and
-You must retain, in the Source form of any Derivative Works that You distribute,
-all copyright, patent, trademark, and attribution notices from the Source form
-of the Work, excluding those notices that do not pertain to any part of the
-Derivative Works; and
-If the Work includes a "NOTICE" text file as part of its distribution, then any
-Derivative Works that You distribute must include a readable copy of the
-attribution notices contained within such NOTICE file, excluding those notices
-that do not pertain to any part of the Derivative Works, in at least one of the
-following places: within a NOTICE text file distributed as part of the
-Derivative Works; within the Source form or documentation, if provided along
-with the Derivative Works; or, within a display generated by the Derivative
-Works, if and wherever such third-party notices normally appear. The contents of
-the NOTICE file are for informational purposes only and do not modify the
-License. You may add Your own attribution notices within Derivative Works that
-You distribute, alongside or as an addendum to the NOTICE text from the Work,
-provided that such additional attribution notices cannot be construed as
-modifying the License.
-You may add Your own copyright statement to Your modifications and may provide
-additional or different license terms and conditions for use, reproduction, or
-distribution of Your modifications, or for any such Derivative Works as a whole,
-provided Your use, reproduction, and distribution of the Work otherwise complies
-with the conditions stated in this License.
-
-5. Submission of Contributions.
-
-Unless You explicitly state otherwise, any Contribution intentionally submitted
-for inclusion in the Work by You to the Licensor shall be under the terms and
-conditions of this License, without any additional terms or conditions.
-Notwithstanding the above, nothing herein shall supersede or modify the terms of
-any separate license agreement you may have executed with Licensor regarding
-such Contributions.
-
-6. Trademarks.
-
-This License does not grant permission to use the trade names, trademarks,
-service marks, or product names of the Licensor, except as required for
-reasonable and customary use in describing the origin of the Work and
-reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty.
-
-Unless required by applicable law or agreed to in writing, Licensor provides the
-Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
-including, without limitation, any warranties or conditions of TITLE,
-NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
-solely responsible for determining the appropriateness of using or
-redistributing the Work and assume any risks associated with Your exercise of
-permissions under this License.
-
-8. Limitation of Liability.
-
-In no event and under no legal theory, whether in tort (including negligence),
-contract, or otherwise, unless required by applicable law (such as deliberate
-and grossly negligent acts) or agreed to in writing, shall any Contributor be
-liable to You for damages, including any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License or
-out of the use or inability to use the Work (including but not limited to
-damages for loss of goodwill, work stoppage, computer failure or malfunction, or
-any and all other commercial damages or losses), even if such Contributor has
-been advised of the possibility of such damages.
-
-9. Accepting Warranty or Additional Liability.
-
-While redistributing the Work or Derivative Works thereof, You may choose to
-offer, and charge a fee for, acceptance of support, warranty, indemnity, or
-other liability obligations and/or rights consistent with this License. However,
-in accepting such obligations, You may act only on Your own behalf and on Your
-sole responsibility, not on behalf of any other Contributor, and only if You
-agree to indemnify, defend, and hold each Contributor harmless for any liability
-incurred by, or claims asserted against, such Contributor by reason of your
-accepting any such warranty or additional liability.
-
-END OF TERMS AND CONDITIONS
-
-APPENDIX: How to apply the Apache License to your work
-
-To apply the Apache License to your work, attach the following boilerplate
-notice, with the fields enclosed by brackets "[]" replaced with your own
-identifying information. (Don't include the brackets!) The text should be
-enclosed in the appropriate comment syntax for the file format. We also
-recommend that a file or class name and description of purpose be included on
-the same "printed page" as the copyright notice for easier identification within
-third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.

+ 0 - 5
vendor/github.com/coreos/go-systemd/v22/NOTICE

@@ -1,5 +0,0 @@
-CoreOS Project
-Copyright 2018 CoreOS, Inc
-
-This product includes software developed at CoreOS, Inc.
-(http://www.coreos.com/).

+ 0 - 46
vendor/github.com/coreos/go-systemd/v22/journal/journal.go

@@ -1,46 +0,0 @@
-// Copyright 2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package journal provides write bindings to the local systemd journal.
-// It is implemented in pure Go and connects to the journal directly over its
-// unix socket.
-//
-// To read from the journal, see the "sdjournal" package, which wraps the
-// sd-journal a C API.
-//
-// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
-package journal
-
-import (
-	"fmt"
-)
-
-// Priority of a journal message
-type Priority int
-
-const (
-	PriEmerg Priority = iota
-	PriAlert
-	PriCrit
-	PriErr
-	PriWarning
-	PriNotice
-	PriInfo
-	PriDebug
-)
-
-// Print prints a message to the local systemd journal using Send().
-func Print(priority Priority, format string, a ...interface{}) error {
-	return Send(fmt.Sprintf(format, a...), priority, nil)
-}

+ 0 - 267
vendor/github.com/coreos/go-systemd/v22/journal/journal_unix.go

@@ -1,267 +0,0 @@
-// Copyright 2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-//go:build !windows
-// +build !windows
-
-// Package journal provides write bindings to the local systemd journal.
-// It is implemented in pure Go and connects to the journal directly over its
-// unix socket.
-//
-// To read from the journal, see the "sdjournal" package, which wraps the
-// sd-journal a C API.
-//
-// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
-package journal
-
-import (
-	"bytes"
-	"encoding/binary"
-	"errors"
-	"fmt"
-	"io"
-	"io/ioutil"
-	"net"
-	"os"
-	"strconv"
-	"strings"
-	"sync"
-	"sync/atomic"
-	"syscall"
-	"unsafe"
-)
-
-var (
-	// This can be overridden at build-time:
-	// https://github.com/golang/go/wiki/GcToolchainTricks#including-build-information-in-the-executable
-	journalSocket = "/run/systemd/journal/socket"
-
-	// unixConnPtr atomically holds the local unconnected Unix-domain socket.
-	// Concrete safe pointer type: *net.UnixConn
-	unixConnPtr unsafe.Pointer
-	// onceConn ensures that unixConnPtr is initialized exactly once.
-	onceConn sync.Once
-)
-
-// Enabled checks whether the local systemd journal is available for logging.
-func Enabled() bool {
-	if c := getOrInitConn(); c == nil {
-		return false
-	}
-
-	conn, err := net.Dial("unixgram", journalSocket)
-	if err != nil {
-		return false
-	}
-	defer conn.Close()
-
-	return true
-}
-
-// StderrIsJournalStream returns whether the process stderr is connected
-// to the Journal's stream transport.
-//
-// This can be used for automatic protocol upgrading described in [Journal Native Protocol].
-//
-// Returns true if JOURNAL_STREAM environment variable is present,
-// and stderr's device and inode numbers match it.
-//
-// Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable
-// is present, but malformed, fstat syscall fails, etc.
-//
-// [Journal Native Protocol]: https://systemd.io/JOURNAL_NATIVE_PROTOCOL/#automatic-protocol-upgrading
-func StderrIsJournalStream() (bool, error) {
-	return fdIsJournalStream(syscall.Stderr)
-}
-
-// StdoutIsJournalStream returns whether the process stdout is connected
-// to the Journal's stream transport.
-//
-// Returns true if JOURNAL_STREAM environment variable is present,
-// and stdout's device and inode numbers match it.
-//
-// Error is returned if unexpected error occurs: e.g. if JOURNAL_STREAM environment variable
-// is present, but malformed, fstat syscall fails, etc.
-//
-// Most users should probably use [StderrIsJournalStream].
-func StdoutIsJournalStream() (bool, error) {
-	return fdIsJournalStream(syscall.Stdout)
-}
-
-func fdIsJournalStream(fd int) (bool, error) {
-	journalStream := os.Getenv("JOURNAL_STREAM")
-	if journalStream == "" {
-		return false, nil
-	}
-
-	var expectedStat syscall.Stat_t
-	_, err := fmt.Sscanf(journalStream, "%d:%d", &expectedStat.Dev, &expectedStat.Ino)
-	if err != nil {
-		return false, fmt.Errorf("failed to parse JOURNAL_STREAM=%q: %v", journalStream, err)
-	}
-
-	var stat syscall.Stat_t
-	err = syscall.Fstat(fd, &stat)
-	if err != nil {
-		return false, err
-	}
-
-	match := stat.Dev == expectedStat.Dev && stat.Ino == expectedStat.Ino
-	return match, nil
-}
-
-// Send a message to the local systemd journal. vars is a map of journald
-// fields to values.  Fields must be composed of uppercase letters, numbers,
-// and underscores, but must not start with an underscore. Within these
-// restrictions, any arbitrary field name may be used.  Some names have special
-// significance: see the journalctl documentation
-// (http://www.freedesktop.org/software/systemd/man/systemd.journal-fields.html)
-// for more details.  vars may be nil.
-func Send(message string, priority Priority, vars map[string]string) error {
-	conn := getOrInitConn()
-	if conn == nil {
-		return errors.New("could not initialize socket to journald")
-	}
-
-	socketAddr := &net.UnixAddr{
-		Name: journalSocket,
-		Net:  "unixgram",
-	}
-
-	data := new(bytes.Buffer)
-	appendVariable(data, "PRIORITY", strconv.Itoa(int(priority)))
-	appendVariable(data, "MESSAGE", message)
-	for k, v := range vars {
-		appendVariable(data, k, v)
-	}
-
-	_, _, err := conn.WriteMsgUnix(data.Bytes(), nil, socketAddr)
-	if err == nil {
-		return nil
-	}
-	if !isSocketSpaceError(err) {
-		return err
-	}
-
-	// Large log entry, send it via tempfile and ancillary-fd.
-	file, err := tempFd()
-	if err != nil {
-		return err
-	}
-	defer file.Close()
-	_, err = io.Copy(file, data)
-	if err != nil {
-		return err
-	}
-	rights := syscall.UnixRights(int(file.Fd()))
-	_, _, err = conn.WriteMsgUnix([]byte{}, rights, socketAddr)
-	if err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// getOrInitConn attempts to get the global `unixConnPtr` socket, initializing if necessary
-func getOrInitConn() *net.UnixConn {
-	conn := (*net.UnixConn)(atomic.LoadPointer(&unixConnPtr))
-	if conn != nil {
-		return conn
-	}
-	onceConn.Do(initConn)
-	return (*net.UnixConn)(atomic.LoadPointer(&unixConnPtr))
-}
-
-func appendVariable(w io.Writer, name, value string) {
-	if err := validVarName(name); err != nil {
-		fmt.Fprintf(os.Stderr, "variable name %s contains invalid character, ignoring\n", name)
-	}
-	if strings.ContainsRune(value, '\n') {
-		/* When the value contains a newline, we write:
-		 * - the variable name, followed by a newline
-		 * - the size (in 64bit little endian format)
-		 * - the data, followed by a newline
-		 */
-		fmt.Fprintln(w, name)
-		binary.Write(w, binary.LittleEndian, uint64(len(value)))
-		fmt.Fprintln(w, value)
-	} else {
-		/* just write the variable and value all on one line */
-		fmt.Fprintf(w, "%s=%s\n", name, value)
-	}
-}
-
-// validVarName validates a variable name to make sure journald will accept it.
-// The variable name must be in uppercase and consist only of characters,
-// numbers and underscores, and may not begin with an underscore:
-// https://www.freedesktop.org/software/systemd/man/sd_journal_print.html
-func validVarName(name string) error {
-	if name == "" {
-		return errors.New("Empty variable name")
-	} else if name[0] == '_' {
-		return errors.New("Variable name begins with an underscore")
-	}
-
-	for _, c := range name {
-		if !(('A' <= c && c <= 'Z') || ('0' <= c && c <= '9') || c == '_') {
-			return errors.New("Variable name contains invalid characters")
-		}
-	}
-	return nil
-}
-
-// isSocketSpaceError checks whether the error is signaling
-// an "overlarge message" condition.
-func isSocketSpaceError(err error) bool {
-	opErr, ok := err.(*net.OpError)
-	if !ok || opErr == nil {
-		return false
-	}
-
-	sysErr, ok := opErr.Err.(*os.SyscallError)
-	if !ok || sysErr == nil {
-		return false
-	}
-
-	return sysErr.Err == syscall.EMSGSIZE || sysErr.Err == syscall.ENOBUFS
-}
-
-// tempFd creates a temporary, unlinked file under `/dev/shm`.
-func tempFd() (*os.File, error) {
-	file, err := ioutil.TempFile("/dev/shm/", "journal.XXXXX")
-	if err != nil {
-		return nil, err
-	}
-	err = syscall.Unlink(file.Name())
-	if err != nil {
-		return nil, err
-	}
-	return file, nil
-}
-
-// initConn initializes the global `unixConnPtr` socket.
-// It is automatically called when needed.
-func initConn() {
-	autobind, err := net.ResolveUnixAddr("unixgram", "")
-	if err != nil {
-		return
-	}
-
-	sock, err := net.ListenUnixgram("unixgram", autobind)
-	if err != nil {
-		return
-	}
-
-	atomic.StorePointer(&unixConnPtr, unsafe.Pointer(sock))
-}

+ 0 - 43
vendor/github.com/coreos/go-systemd/v22/journal/journal_windows.go

@@ -1,43 +0,0 @@
-// Copyright 2015 CoreOS, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package journal provides write bindings to the local systemd journal.
-// It is implemented in pure Go and connects to the journal directly over its
-// unix socket.
-//
-// To read from the journal, see the "sdjournal" package, which wraps the
-// sd-journal a C API.
-//
-// http://www.freedesktop.org/software/systemd/man/systemd-journald.service.html
-package journal
-
-import (
-	"errors"
-)
-
-func Enabled() bool {
-	return false
-}
-
-func Send(message string, priority Priority, vars map[string]string) error {
-	return errors.New("could not initialize socket to journald")
-}
-
-func StderrIsJournalStream() (bool, error) {
-	return false, nil
-}
-
-func StdoutIsJournalStream() (bool, error) {
-	return false, nil
-}

+ 0 - 15
vendor/github.com/davecgh/go-spew/LICENSE

@@ -1,15 +0,0 @@
-ISC License
-
-Copyright (c) 2012-2016 Dave Collins <dave@davec.name>
-
-Permission to use, copy, modify, and/or distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

+ 0 - 145
vendor/github.com/davecgh/go-spew/spew/bypass.go

@@ -1,145 +0,0 @@
-// Copyright (c) 2015-2016 Dave Collins <dave@davec.name>
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when the code is not running on Google App Engine, compiled by GopherJS, and
-// "-tags safe" is not added to the go build command line.  The "disableunsafe"
-// tag is deprecated and thus should not be used.
-// Go versions prior to 1.4 are disabled because they use a different layout
-// for interfaces which make the implementation of unsafeReflectValue more complex.
-// +build !js,!appengine,!safe,!disableunsafe,go1.4
-
-package spew
-
-import (
-	"reflect"
-	"unsafe"
-)
-
-const (
-	// UnsafeDisabled is a build-time constant which specifies whether or
-	// not access to the unsafe package is available.
-	UnsafeDisabled = false
-
-	// ptrSize is the size of a pointer on the current arch.
-	ptrSize = unsafe.Sizeof((*byte)(nil))
-)
-
-type flag uintptr
-
-var (
-	// flagRO indicates whether the value field of a reflect.Value
-	// is read-only.
-	flagRO flag
-
-	// flagAddr indicates whether the address of the reflect.Value's
-	// value may be taken.
-	flagAddr flag
-)
-
-// flagKindMask holds the bits that make up the kind
-// part of the flags field. In all the supported versions,
-// it is in the lower 5 bits.
-const flagKindMask = flag(0x1f)
-
-// Different versions of Go have used different
-// bit layouts for the flags type. This table
-// records the known combinations.
-var okFlags = []struct {
-	ro, addr flag
-}{{
-	// From Go 1.4 to 1.5
-	ro:   1 << 5,
-	addr: 1 << 7,
-}, {
-	// Up to Go tip.
-	ro:   1<<5 | 1<<6,
-	addr: 1 << 8,
-}}
-
-var flagValOffset = func() uintptr {
-	field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag")
-	if !ok {
-		panic("reflect.Value has no flag field")
-	}
-	return field.Offset
-}()
-
-// flagField returns a pointer to the flag field of a reflect.Value.
-func flagField(v *reflect.Value) *flag {
-	return (*flag)(unsafe.Pointer(uintptr(unsafe.Pointer(v)) + flagValOffset))
-}
-
-// unsafeReflectValue converts the passed reflect.Value into a one that bypasses
-// the typical safety restrictions preventing access to unaddressable and
-// unexported data.  It works by digging the raw pointer to the underlying
-// value out of the protected value and generating a new unprotected (unsafe)
-// reflect.Value to it.
-//
-// This allows us to check for implementations of the Stringer and error
-// interfaces to be used for pretty printing ordinarily unaddressable and
-// inaccessible values such as unexported struct fields.
-func unsafeReflectValue(v reflect.Value) reflect.Value {
-	if !v.IsValid() || (v.CanInterface() && v.CanAddr()) {
-		return v
-	}
-	flagFieldPtr := flagField(&v)
-	*flagFieldPtr &^= flagRO
-	*flagFieldPtr |= flagAddr
-	return v
-}
-
-// Sanity checks against future reflect package changes
-// to the type or semantics of the Value.flag field.
-func init() {
-	field, ok := reflect.TypeOf(reflect.Value{}).FieldByName("flag")
-	if !ok {
-		panic("reflect.Value has no flag field")
-	}
-	if field.Type.Kind() != reflect.TypeOf(flag(0)).Kind() {
-		panic("reflect.Value flag field has changed kind")
-	}
-	type t0 int
-	var t struct {
-		A t0
-		// t0 will have flagEmbedRO set.
-		t0
-		// a will have flagStickyRO set
-		a t0
-	}
-	vA := reflect.ValueOf(t).FieldByName("A")
-	va := reflect.ValueOf(t).FieldByName("a")
-	vt0 := reflect.ValueOf(t).FieldByName("t0")
-
-	// Infer flagRO from the difference between the flags
-	// for the (otherwise identical) fields in t.
-	flagPublic := *flagField(&vA)
-	flagWithRO := *flagField(&va) | *flagField(&vt0)
-	flagRO = flagPublic ^ flagWithRO
-
-	// Infer flagAddr from the difference between a value
-	// taken from a pointer and not.
-	vPtrA := reflect.ValueOf(&t).Elem().FieldByName("A")
-	flagNoPtr := *flagField(&vA)
-	flagPtr := *flagField(&vPtrA)
-	flagAddr = flagNoPtr ^ flagPtr
-
-	// Check that the inferred flags tally with one of the known versions.
-	for _, f := range okFlags {
-		if flagRO == f.ro && flagAddr == f.addr {
-			return
-		}
-	}
-	panic("reflect.Value read-only flag has changed semantics")
-}

+ 0 - 38
vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

@@ -1,38 +0,0 @@
-// Copyright (c) 2015-2016 Dave Collins <dave@davec.name>
-//
-// Permission to use, copy, modify, and distribute this software for any
-// purpose with or without fee is hereby granted, provided that the above
-// copyright notice and this permission notice appear in all copies.
-//
-// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-// ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-// ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-// OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-// NOTE: Due to the following build constraints, this file will only be compiled
-// when the code is running on Google App Engine, compiled by GopherJS, or
-// "-tags safe" is added to the go build command line.  The "disableunsafe"
-// tag is deprecated and thus should not be used.
-// +build js appengine safe disableunsafe !go1.4
-
-package spew
-
-import "reflect"
-
-const (
-	// UnsafeDisabled is a build-time constant which specifies whether or
-	// not access to the unsafe package is available.
-	UnsafeDisabled = true
-)
-
-// unsafeReflectValue typically converts the passed reflect.Value into a one
-// that bypasses the typical safety restrictions preventing access to
-// unaddressable and unexported data.  However, doing this relies on access to
-// the unsafe package.  This is a stub version which simply returns the passed
-// reflect.Value when the unsafe package is not available.
-func unsafeReflectValue(v reflect.Value) reflect.Value {
-	return v
-}

+ 0 - 341
vendor/github.com/davecgh/go-spew/spew/common.go

@@ -1,341 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"reflect"
-	"sort"
-	"strconv"
-)
-
-// Some constants in the form of bytes to avoid string overhead.  This mirrors
-// the technique used in the fmt package.
-var (
-	panicBytes            = []byte("(PANIC=")
-	plusBytes             = []byte("+")
-	iBytes                = []byte("i")
-	trueBytes             = []byte("true")
-	falseBytes            = []byte("false")
-	interfaceBytes        = []byte("(interface {})")
-	commaNewlineBytes     = []byte(",\n")
-	newlineBytes          = []byte("\n")
-	openBraceBytes        = []byte("{")
-	openBraceNewlineBytes = []byte("{\n")
-	closeBraceBytes       = []byte("}")
-	asteriskBytes         = []byte("*")
-	colonBytes            = []byte(":")
-	colonSpaceBytes       = []byte(": ")
-	openParenBytes        = []byte("(")
-	closeParenBytes       = []byte(")")
-	spaceBytes            = []byte(" ")
-	pointerChainBytes     = []byte("->")
-	nilAngleBytes         = []byte("<nil>")
-	maxNewlineBytes       = []byte("<max depth reached>\n")
-	maxShortBytes         = []byte("<max>")
-	circularBytes         = []byte("<already shown>")
-	circularShortBytes    = []byte("<shown>")
-	invalidAngleBytes     = []byte("<invalid>")
-	openBracketBytes      = []byte("[")
-	closeBracketBytes     = []byte("]")
-	percentBytes          = []byte("%")
-	precisionBytes        = []byte(".")
-	openAngleBytes        = []byte("<")
-	closeAngleBytes       = []byte(">")
-	openMapBytes          = []byte("map[")
-	closeMapBytes         = []byte("]")
-	lenEqualsBytes        = []byte("len=")
-	capEqualsBytes        = []byte("cap=")
-)
-
-// hexDigits is used to map a decimal value to a hex digit.
-var hexDigits = "0123456789abcdef"
-
-// catchPanic handles any panics that might occur during the handleMethods
-// calls.
-func catchPanic(w io.Writer, v reflect.Value) {
-	if err := recover(); err != nil {
-		w.Write(panicBytes)
-		fmt.Fprintf(w, "%v", err)
-		w.Write(closeParenBytes)
-	}
-}
-
-// handleMethods attempts to call the Error and String methods on the underlying
-// type the passed reflect.Value represents and outputes the result to Writer w.
-//
-// It handles panics in any called methods by catching and displaying the error
-// as the formatted value.
-func handleMethods(cs *ConfigState, w io.Writer, v reflect.Value) (handled bool) {
-	// We need an interface to check if the type implements the error or
-	// Stringer interface.  However, the reflect package won't give us an
-	// interface on certain things like unexported struct fields in order
-	// to enforce visibility rules.  We use unsafe, when it's available,
-	// to bypass these restrictions since this package does not mutate the
-	// values.
-	if !v.CanInterface() {
-		if UnsafeDisabled {
-			return false
-		}
-
-		v = unsafeReflectValue(v)
-	}
-
-	// Choose whether or not to do error and Stringer interface lookups against
-	// the base type or a pointer to the base type depending on settings.
-	// Technically calling one of these methods with a pointer receiver can
-	// mutate the value, however, types which choose to satisify an error or
-	// Stringer interface with a pointer receiver should not be mutating their
-	// state inside these interface methods.
-	if !cs.DisablePointerMethods && !UnsafeDisabled && !v.CanAddr() {
-		v = unsafeReflectValue(v)
-	}
-	if v.CanAddr() {
-		v = v.Addr()
-	}
-
-	// Is it an error or Stringer?
-	switch iface := v.Interface().(type) {
-	case error:
-		defer catchPanic(w, v)
-		if cs.ContinueOnMethod {
-			w.Write(openParenBytes)
-			w.Write([]byte(iface.Error()))
-			w.Write(closeParenBytes)
-			w.Write(spaceBytes)
-			return false
-		}
-
-		w.Write([]byte(iface.Error()))
-		return true
-
-	case fmt.Stringer:
-		defer catchPanic(w, v)
-		if cs.ContinueOnMethod {
-			w.Write(openParenBytes)
-			w.Write([]byte(iface.String()))
-			w.Write(closeParenBytes)
-			w.Write(spaceBytes)
-			return false
-		}
-		w.Write([]byte(iface.String()))
-		return true
-	}
-	return false
-}
-
-// printBool outputs a boolean value as true or false to Writer w.
-func printBool(w io.Writer, val bool) {
-	if val {
-		w.Write(trueBytes)
-	} else {
-		w.Write(falseBytes)
-	}
-}
-
-// printInt outputs a signed integer value to Writer w.
-func printInt(w io.Writer, val int64, base int) {
-	w.Write([]byte(strconv.FormatInt(val, base)))
-}
-
-// printUint outputs an unsigned integer value to Writer w.
-func printUint(w io.Writer, val uint64, base int) {
-	w.Write([]byte(strconv.FormatUint(val, base)))
-}
-
-// printFloat outputs a floating point value using the specified precision,
-// which is expected to be 32 or 64bit, to Writer w.
-func printFloat(w io.Writer, val float64, precision int) {
-	w.Write([]byte(strconv.FormatFloat(val, 'g', -1, precision)))
-}
-
-// printComplex outputs a complex value using the specified float precision
-// for the real and imaginary parts to Writer w.
-func printComplex(w io.Writer, c complex128, floatPrecision int) {
-	r := real(c)
-	w.Write(openParenBytes)
-	w.Write([]byte(strconv.FormatFloat(r, 'g', -1, floatPrecision)))
-	i := imag(c)
-	if i >= 0 {
-		w.Write(plusBytes)
-	}
-	w.Write([]byte(strconv.FormatFloat(i, 'g', -1, floatPrecision)))
-	w.Write(iBytes)
-	w.Write(closeParenBytes)
-}
-
-// printHexPtr outputs a uintptr formatted as hexadecimal with a leading '0x'
-// prefix to Writer w.
-func printHexPtr(w io.Writer, p uintptr) {
-	// Null pointer.
-	num := uint64(p)
-	if num == 0 {
-		w.Write(nilAngleBytes)
-		return
-	}
-
-	// Max uint64 is 16 bytes in hex + 2 bytes for '0x' prefix
-	buf := make([]byte, 18)
-
-	// It's simpler to construct the hex string right to left.
-	base := uint64(16)
-	i := len(buf) - 1
-	for num >= base {
-		buf[i] = hexDigits[num%base]
-		num /= base
-		i--
-	}
-	buf[i] = hexDigits[num]
-
-	// Add '0x' prefix.
-	i--
-	buf[i] = 'x'
-	i--
-	buf[i] = '0'
-
-	// Strip unused leading bytes.
-	buf = buf[i:]
-	w.Write(buf)
-}
-
-// valuesSorter implements sort.Interface to allow a slice of reflect.Value
-// elements to be sorted.
-type valuesSorter struct {
-	values  []reflect.Value
-	strings []string // either nil or same len and values
-	cs      *ConfigState
-}
-
-// newValuesSorter initializes a valuesSorter instance, which holds a set of
-// surrogate keys on which the data should be sorted.  It uses flags in
-// ConfigState to decide if and how to populate those surrogate keys.
-func newValuesSorter(values []reflect.Value, cs *ConfigState) sort.Interface {
-	vs := &valuesSorter{values: values, cs: cs}
-	if canSortSimply(vs.values[0].Kind()) {
-		return vs
-	}
-	if !cs.DisableMethods {
-		vs.strings = make([]string, len(values))
-		for i := range vs.values {
-			b := bytes.Buffer{}
-			if !handleMethods(cs, &b, vs.values[i]) {
-				vs.strings = nil
-				break
-			}
-			vs.strings[i] = b.String()
-		}
-	}
-	if vs.strings == nil && cs.SpewKeys {
-		vs.strings = make([]string, len(values))
-		for i := range vs.values {
-			vs.strings[i] = Sprintf("%#v", vs.values[i].Interface())
-		}
-	}
-	return vs
-}
-
-// canSortSimply tests whether a reflect.Kind is a primitive that can be sorted
-// directly, or whether it should be considered for sorting by surrogate keys
-// (if the ConfigState allows it).
-func canSortSimply(kind reflect.Kind) bool {
-	// This switch parallels valueSortLess, except for the default case.
-	switch kind {
-	case reflect.Bool:
-		return true
-	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
-		return true
-	case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
-		return true
-	case reflect.Float32, reflect.Float64:
-		return true
-	case reflect.String:
-		return true
-	case reflect.Uintptr:
-		return true
-	case reflect.Array:
-		return true
-	}
-	return false
-}
-
-// Len returns the number of values in the slice.  It is part of the
-// sort.Interface implementation.
-func (s *valuesSorter) Len() int {
-	return len(s.values)
-}
-
-// Swap swaps the values at the passed indices.  It is part of the
-// sort.Interface implementation.
-func (s *valuesSorter) Swap(i, j int) {
-	s.values[i], s.values[j] = s.values[j], s.values[i]
-	if s.strings != nil {
-		s.strings[i], s.strings[j] = s.strings[j], s.strings[i]
-	}
-}
-
-// valueSortLess returns whether the first value should sort before the second
-// value.  It is used by valueSorter.Less as part of the sort.Interface
-// implementation.
-func valueSortLess(a, b reflect.Value) bool {
-	switch a.Kind() {
-	case reflect.Bool:
-		return !a.Bool() && b.Bool()
-	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
-		return a.Int() < b.Int()
-	case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
-		return a.Uint() < b.Uint()
-	case reflect.Float32, reflect.Float64:
-		return a.Float() < b.Float()
-	case reflect.String:
-		return a.String() < b.String()
-	case reflect.Uintptr:
-		return a.Uint() < b.Uint()
-	case reflect.Array:
-		// Compare the contents of both arrays.
-		l := a.Len()
-		for i := 0; i < l; i++ {
-			av := a.Index(i)
-			bv := b.Index(i)
-			if av.Interface() == bv.Interface() {
-				continue
-			}
-			return valueSortLess(av, bv)
-		}
-	}
-	return a.String() < b.String()
-}
-
-// Less returns whether the value at index i should sort before the
-// value at index j.  It is part of the sort.Interface implementation.
-func (s *valuesSorter) Less(i, j int) bool {
-	if s.strings == nil {
-		return valueSortLess(s.values[i], s.values[j])
-	}
-	return s.strings[i] < s.strings[j]
-}
-
-// sortValues is a sort function that handles both native types and any type that
-// can be converted to error or Stringer.  Other inputs are sorted according to
-// their Value.String() value to ensure display stability.
-func sortValues(values []reflect.Value, cs *ConfigState) {
-	if len(values) == 0 {
-		return
-	}
-	sort.Sort(newValuesSorter(values, cs))
-}

+ 0 - 306
vendor/github.com/davecgh/go-spew/spew/config.go

@@ -1,306 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
-	"bytes"
-	"fmt"
-	"io"
-	"os"
-)
-
-// ConfigState houses the configuration options used by spew to format and
-// display values.  There is a global instance, Config, that is used to control
-// all top-level Formatter and Dump functionality.  Each ConfigState instance
-// provides methods equivalent to the top-level functions.
-//
-// The zero value for ConfigState provides no indentation.  You would typically
-// want to set it to a space or a tab.
-//
-// Alternatively, you can use NewDefaultConfig to get a ConfigState instance
-// with default settings.  See the documentation of NewDefaultConfig for default
-// values.
-type ConfigState struct {
-	// Indent specifies the string to use for each indentation level.  The
-	// global config instance that all top-level functions use set this to a
-	// single space by default.  If you would like more indentation, you might
-	// set this to a tab with "\t" or perhaps two spaces with "  ".
-	Indent string
-
-	// MaxDepth controls the maximum number of levels to descend into nested
-	// data structures.  The default, 0, means there is no limit.
-	//
-	// NOTE: Circular data structures are properly detected, so it is not
-	// necessary to set this value unless you specifically want to limit deeply
-	// nested data structures.
-	MaxDepth int
-
-	// DisableMethods specifies whether or not error and Stringer interfaces are
-	// invoked for types that implement them.
-	DisableMethods bool
-
-	// DisablePointerMethods specifies whether or not to check for and invoke
-	// error and Stringer interfaces on types which only accept a pointer
-	// receiver when the current type is not a pointer.
-	//
-	// NOTE: This might be an unsafe action since calling one of these methods
-	// with a pointer receiver could technically mutate the value, however,
-	// in practice, types which choose to satisify an error or Stringer
-	// interface with a pointer receiver should not be mutating their state
-	// inside these interface methods.  As a result, this option relies on
-	// access to the unsafe package, so it will not have any effect when
-	// running in environments without access to the unsafe package such as
-	// Google App Engine or with the "safe" build tag specified.
-	DisablePointerMethods bool
-
-	// DisablePointerAddresses specifies whether to disable the printing of
-	// pointer addresses. This is useful when diffing data structures in tests.
-	DisablePointerAddresses bool
-
-	// DisableCapacities specifies whether to disable the printing of capacities
-	// for arrays, slices, maps and channels. This is useful when diffing
-	// data structures in tests.
-	DisableCapacities bool
-
-	// ContinueOnMethod specifies whether or not recursion should continue once
-	// a custom error or Stringer interface is invoked.  The default, false,
-	// means it will print the results of invoking the custom error or Stringer
-	// interface and return immediately instead of continuing to recurse into
-	// the internals of the data type.
-	//
-	// NOTE: This flag does not have any effect if method invocation is disabled
-	// via the DisableMethods or DisablePointerMethods options.
-	ContinueOnMethod bool
-
-	// SortKeys specifies map keys should be sorted before being printed. Use
-	// this to have a more deterministic, diffable output.  Note that only
-	// native types (bool, int, uint, floats, uintptr and string) and types
-	// that support the error or Stringer interfaces (if methods are
-	// enabled) are supported, with other types sorted according to the
-	// reflect.Value.String() output which guarantees display stability.
-	SortKeys bool
-
-	// SpewKeys specifies that, as a last resort attempt, map keys should
-	// be spewed to strings and sorted by those strings.  This is only
-	// considered if SortKeys is true.
-	SpewKeys bool
-}
-
-// Config is the active configuration of the top-level functions.
-// The configuration can be changed by modifying the contents of spew.Config.
-var Config = ConfigState{Indent: " "}
-
-// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the formatted string as a value that satisfies error.  See NewFormatter
-// for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Errorf(format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Errorf(format string, a ...interface{}) (err error) {
-	return fmt.Errorf(format, c.convertArgs(a)...)
-}
-
-// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Fprint(w, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Fprint(w io.Writer, a ...interface{}) (n int, err error) {
-	return fmt.Fprint(w, c.convertArgs(a)...)
-}
-
-// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Fprintf(w, format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
-	return fmt.Fprintf(w, format, c.convertArgs(a)...)
-}
-
-// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it
-// passed with a Formatter interface returned by c.NewFormatter.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Fprintln(w, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
-	return fmt.Fprintln(w, c.convertArgs(a)...)
-}
-
-// Print is a wrapper for fmt.Print that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Print(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Print(a ...interface{}) (n int, err error) {
-	return fmt.Print(c.convertArgs(a)...)
-}
-
-// Printf is a wrapper for fmt.Printf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Printf(format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Printf(format string, a ...interface{}) (n int, err error) {
-	return fmt.Printf(format, c.convertArgs(a)...)
-}
-
-// Println is a wrapper for fmt.Println that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Println(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Println(a ...interface{}) (n int, err error) {
-	return fmt.Println(c.convertArgs(a)...)
-}
-
-// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the resulting string.  See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Sprint(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Sprint(a ...interface{}) string {
-	return fmt.Sprint(c.convertArgs(a)...)
-}
-
-// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were
-// passed with a Formatter interface returned by c.NewFormatter.  It returns
-// the resulting string.  See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Sprintf(format, c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Sprintf(format string, a ...interface{}) string {
-	return fmt.Sprintf(format, c.convertArgs(a)...)
-}
-
-// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it
-// were passed with a Formatter interface returned by c.NewFormatter.  It
-// returns the resulting string.  See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Sprintln(c.NewFormatter(a), c.NewFormatter(b))
-func (c *ConfigState) Sprintln(a ...interface{}) string {
-	return fmt.Sprintln(c.convertArgs(a)...)
-}
-
-/*
-NewFormatter returns a custom formatter that satisfies the fmt.Formatter
-interface.  As a result, it integrates cleanly with standard fmt package
-printing functions.  The formatter is useful for inline printing of smaller data
-types similar to the standard %v format specifier.
-
-The custom formatter only responds to the %v (most compact), %+v (adds pointer
-addresses), %#v (adds types), and %#+v (adds types and pointer addresses) verb
-combinations.  Any other verbs such as %x and %q will be sent to the the
-standard fmt package for formatting.  In addition, the custom formatter ignores
-the width and precision arguments (however they will still work on the format
-specifiers not handled by the custom formatter).
-
-Typically this function shouldn't be called directly.  It is much easier to make
-use of the custom formatter by calling one of the convenience functions such as
-c.Printf, c.Println, or c.Printf.
-*/
-func (c *ConfigState) NewFormatter(v interface{}) fmt.Formatter {
-	return newFormatter(c, v)
-}
-
-// Fdump formats and displays the passed arguments to io.Writer w.  It formats
-// exactly the same as Dump.
-func (c *ConfigState) Fdump(w io.Writer, a ...interface{}) {
-	fdump(c, w, a...)
-}
-
-/*
-Dump displays the passed parameters to standard out with newlines, customizable
-indentation, and additional debug information such as complete types and all
-pointer addresses used to indirect to the final value.  It provides the
-following features over the built-in printing facilities provided by the fmt
-package:
-
-	* Pointers are dereferenced and followed
-	* Circular data structures are detected and handled properly
-	* Custom Stringer/error interfaces are optionally invoked, including
-	  on unexported types
-	* Custom types which only implement the Stringer/error interfaces via
-	  a pointer receiver are optionally invoked when passing non-pointer
-	  variables
-	* Byte arrays and slices are dumped like the hexdump -C command which
-	  includes offsets, byte values in hex, and ASCII output
-
-The configuration options are controlled by modifying the public members
-of c.  See ConfigState for options documentation.
-
-See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
-get the formatted result as a string.
-*/
-func (c *ConfigState) Dump(a ...interface{}) {
-	fdump(c, os.Stdout, a...)
-}
-
-// Sdump returns a string with the passed arguments formatted exactly the same
-// as Dump.
-func (c *ConfigState) Sdump(a ...interface{}) string {
-	var buf bytes.Buffer
-	fdump(c, &buf, a...)
-	return buf.String()
-}
-
-// convertArgs accepts a slice of arguments and returns a slice of the same
-// length with each argument converted to a spew Formatter interface using
-// the ConfigState associated with s.
-func (c *ConfigState) convertArgs(args []interface{}) (formatters []interface{}) {
-	formatters = make([]interface{}, len(args))
-	for index, arg := range args {
-		formatters[index] = newFormatter(c, arg)
-	}
-	return formatters
-}
-
-// NewDefaultConfig returns a ConfigState with the following default settings.
-//
-// 	Indent: " "
-// 	MaxDepth: 0
-// 	DisableMethods: false
-// 	DisablePointerMethods: false
-// 	ContinueOnMethod: false
-// 	SortKeys: false
-func NewDefaultConfig() *ConfigState {
-	return &ConfigState{Indent: " "}
-}

+ 0 - 211
vendor/github.com/davecgh/go-spew/spew/doc.go

@@ -1,211 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
-Package spew implements a deep pretty printer for Go data structures to aid in
-debugging.
-
-A quick overview of the additional features spew provides over the built-in
-printing facilities for Go data types are as follows:
-
-	* Pointers are dereferenced and followed
-	* Circular data structures are detected and handled properly
-	* Custom Stringer/error interfaces are optionally invoked, including
-	  on unexported types
-	* Custom types which only implement the Stringer/error interfaces via
-	  a pointer receiver are optionally invoked when passing non-pointer
-	  variables
-	* Byte arrays and slices are dumped like the hexdump -C command which
-	  includes offsets, byte values in hex, and ASCII output (only when using
-	  Dump style)
-
-There are two different approaches spew allows for dumping Go data structures:
-
-	* Dump style which prints with newlines, customizable indentation,
-	  and additional debug information such as types and all pointer addresses
-	  used to indirect to the final value
-	* A custom Formatter interface that integrates cleanly with the standard fmt
-	  package and replaces %v, %+v, %#v, and %#+v to provide inline printing
-	  similar to the default %v while providing the additional functionality
-	  outlined above and passing unsupported format verbs such as %x and %q
-	  along to fmt
-
-Quick Start
-
-This section demonstrates how to quickly get started with spew.  See the
-sections below for further details on formatting and configuration options.
-
-To dump a variable with full newlines, indentation, type, and pointer
-information use Dump, Fdump, or Sdump:
-	spew.Dump(myVar1, myVar2, ...)
-	spew.Fdump(someWriter, myVar1, myVar2, ...)
-	str := spew.Sdump(myVar1, myVar2, ...)
-
-Alternatively, if you would prefer to use format strings with a compacted inline
-printing style, use the convenience wrappers Printf, Fprintf, etc with
-%v (most compact), %+v (adds pointer addresses), %#v (adds types), or
-%#+v (adds types and pointer addresses):
-	spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-	spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-	spew.Fprintf(someWriter, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-	spew.Fprintf(someWriter, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-
-Configuration Options
-
-Configuration of spew is handled by fields in the ConfigState type.  For
-convenience, all of the top-level functions use a global state available
-via the spew.Config global.
-
-It is also possible to create a ConfigState instance that provides methods
-equivalent to the top-level functions.  This allows concurrent configuration
-options.  See the ConfigState documentation for more details.
-
-The following configuration options are available:
-	* Indent
-		String to use for each indentation level for Dump functions.
-		It is a single space by default.  A popular alternative is "\t".
-
-	* MaxDepth
-		Maximum number of levels to descend into nested data structures.
-		There is no limit by default.
-
-	* DisableMethods
-		Disables invocation of error and Stringer interface methods.
-		Method invocation is enabled by default.
-
-	* DisablePointerMethods
-		Disables invocation of error and Stringer interface methods on types
-		which only accept pointer receivers from non-pointer variables.
-		Pointer method invocation is enabled by default.
-
-	* DisablePointerAddresses
-		DisablePointerAddresses specifies whether to disable the printing of
-		pointer addresses. This is useful when diffing data structures in tests.
-
-	* DisableCapacities
-		DisableCapacities specifies whether to disable the printing of
-		capacities for arrays, slices, maps and channels. This is useful when
-		diffing data structures in tests.
-
-	* ContinueOnMethod
-		Enables recursion into types after invoking error and Stringer interface
-		methods. Recursion after method invocation is disabled by default.
-
-	* SortKeys
-		Specifies map keys should be sorted before being printed. Use
-		this to have a more deterministic, diffable output.  Note that
-		only native types (bool, int, uint, floats, uintptr and string)
-		and types which implement error or Stringer interfaces are
-		supported with other types sorted according to the
-		reflect.Value.String() output which guarantees display
-		stability.  Natural map order is used by default.
-
-	* SpewKeys
-		Specifies that, as a last resort attempt, map keys should be
-		spewed to strings and sorted by those strings.  This is only
-		considered if SortKeys is true.
-
-Dump Usage
-
-Simply call spew.Dump with a list of variables you want to dump:
-
-	spew.Dump(myVar1, myVar2, ...)
-
-You may also call spew.Fdump if you would prefer to output to an arbitrary
-io.Writer.  For example, to dump to standard error:
-
-	spew.Fdump(os.Stderr, myVar1, myVar2, ...)
-
-A third option is to call spew.Sdump to get the formatted output as a string:
-
-	str := spew.Sdump(myVar1, myVar2, ...)
-
-Sample Dump Output
-
-See the Dump example for details on the setup of the types and variables being
-shown here.
-
-	(main.Foo) {
-	 unexportedField: (*main.Bar)(0xf84002e210)({
-	  flag: (main.Flag) flagTwo,
-	  data: (uintptr) <nil>
-	 }),
-	 ExportedField: (map[interface {}]interface {}) (len=1) {
-	  (string) (len=3) "one": (bool) true
-	 }
-	}
-
-Byte (and uint8) arrays and slices are displayed uniquely like the hexdump -C
-command as shown.
-	([]uint8) (len=32 cap=32) {
-	 00000000  11 12 13 14 15 16 17 18  19 1a 1b 1c 1d 1e 1f 20  |............... |
-	 00000010  21 22 23 24 25 26 27 28  29 2a 2b 2c 2d 2e 2f 30  |!"#$%&'()*+,-./0|
-	 00000020  31 32                                             |12|
-	}
-
-Custom Formatter
-
-Spew provides a custom formatter that implements the fmt.Formatter interface
-so that it integrates cleanly with standard fmt package printing functions. The
-formatter is useful for inline printing of smaller data types similar to the
-standard %v format specifier.
-
-The custom formatter only responds to the %v (most compact), %+v (adds pointer
-addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
-combinations.  Any other verbs such as %x and %q will be sent to the the
-standard fmt package for formatting.  In addition, the custom formatter ignores
-the width and precision arguments (however they will still work on the format
-specifiers not handled by the custom formatter).
-
-Custom Formatter Usage
-
-The simplest way to make use of the spew custom formatter is to call one of the
-convenience functions such as spew.Printf, spew.Println, or spew.Printf.  The
-functions have syntax you are most likely already familiar with:
-
-	spew.Printf("myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-	spew.Printf("myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-	spew.Println(myVar, myVar2)
-	spew.Fprintf(os.Stderr, "myVar1: %v -- myVar2: %+v", myVar1, myVar2)
-	spew.Fprintf(os.Stderr, "myVar3: %#v -- myVar4: %#+v", myVar3, myVar4)
-
-See the Index for the full list convenience functions.
-
-Sample Formatter Output
-
-Double pointer to a uint8:
-	  %v: <**>5
-	 %+v: <**>(0xf8400420d0->0xf8400420c8)5
-	 %#v: (**uint8)5
-	%#+v: (**uint8)(0xf8400420d0->0xf8400420c8)5
-
-Pointer to circular struct with a uint8 field and a pointer to itself:
-	  %v: <*>{1 <*><shown>}
-	 %+v: <*>(0xf84003e260){ui8:1 c:<*>(0xf84003e260)<shown>}
-	 %#v: (*main.circular){ui8:(uint8)1 c:(*main.circular)<shown>}
-	%#+v: (*main.circular)(0xf84003e260){ui8:(uint8)1 c:(*main.circular)(0xf84003e260)<shown>}
-
-See the Printf example for details on the setup of variables being shown
-here.
-
-Errors
-
-Since it is possible for custom Stringer/error interfaces to panic, spew
-detects them and handles them internally by printing the panic information
-inline with the output.  Since spew is intended to provide deep pretty printing
-capabilities on structures, it intentionally does not return any errors.
-*/
-package spew

+ 0 - 509
vendor/github.com/davecgh/go-spew/spew/dump.go

@@ -1,509 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
-	"bytes"
-	"encoding/hex"
-	"fmt"
-	"io"
-	"os"
-	"reflect"
-	"regexp"
-	"strconv"
-	"strings"
-)
-
-var (
-	// uint8Type is a reflect.Type representing a uint8.  It is used to
-	// convert cgo types to uint8 slices for hexdumping.
-	uint8Type = reflect.TypeOf(uint8(0))
-
-	// cCharRE is a regular expression that matches a cgo char.
-	// It is used to detect character arrays to hexdump them.
-	cCharRE = regexp.MustCompile(`^.*\._Ctype_char$`)
-
-	// cUnsignedCharRE is a regular expression that matches a cgo unsigned
-	// char.  It is used to detect unsigned character arrays to hexdump
-	// them.
-	cUnsignedCharRE = regexp.MustCompile(`^.*\._Ctype_unsignedchar$`)
-
-	// cUint8tCharRE is a regular expression that matches a cgo uint8_t.
-	// It is used to detect uint8_t arrays to hexdump them.
-	cUint8tCharRE = regexp.MustCompile(`^.*\._Ctype_uint8_t$`)
-)
-
-// dumpState contains information about the state of a dump operation.
-type dumpState struct {
-	w                io.Writer
-	depth            int
-	pointers         map[uintptr]int
-	ignoreNextType   bool
-	ignoreNextIndent bool
-	cs               *ConfigState
-}
-
-// indent performs indentation according to the depth level and cs.Indent
-// option.
-func (d *dumpState) indent() {
-	if d.ignoreNextIndent {
-		d.ignoreNextIndent = false
-		return
-	}
-	d.w.Write(bytes.Repeat([]byte(d.cs.Indent), d.depth))
-}
-
-// unpackValue returns values inside of non-nil interfaces when possible.
-// This is useful for data types like structs, arrays, slices, and maps which
-// can contain varying types packed inside an interface.
-func (d *dumpState) unpackValue(v reflect.Value) reflect.Value {
-	if v.Kind() == reflect.Interface && !v.IsNil() {
-		v = v.Elem()
-	}
-	return v
-}
-
-// dumpPtr handles formatting of pointers by indirecting them as necessary.
-func (d *dumpState) dumpPtr(v reflect.Value) {
-	// Remove pointers at or below the current depth from map used to detect
-	// circular refs.
-	for k, depth := range d.pointers {
-		if depth >= d.depth {
-			delete(d.pointers, k)
-		}
-	}
-
-	// Keep list of all dereferenced pointers to show later.
-	pointerChain := make([]uintptr, 0)
-
-	// Figure out how many levels of indirection there are by dereferencing
-	// pointers and unpacking interfaces down the chain while detecting circular
-	// references.
-	nilFound := false
-	cycleFound := false
-	indirects := 0
-	ve := v
-	for ve.Kind() == reflect.Ptr {
-		if ve.IsNil() {
-			nilFound = true
-			break
-		}
-		indirects++
-		addr := ve.Pointer()
-		pointerChain = append(pointerChain, addr)
-		if pd, ok := d.pointers[addr]; ok && pd < d.depth {
-			cycleFound = true
-			indirects--
-			break
-		}
-		d.pointers[addr] = d.depth
-
-		ve = ve.Elem()
-		if ve.Kind() == reflect.Interface {
-			if ve.IsNil() {
-				nilFound = true
-				break
-			}
-			ve = ve.Elem()
-		}
-	}
-
-	// Display type information.
-	d.w.Write(openParenBytes)
-	d.w.Write(bytes.Repeat(asteriskBytes, indirects))
-	d.w.Write([]byte(ve.Type().String()))
-	d.w.Write(closeParenBytes)
-
-	// Display pointer information.
-	if !d.cs.DisablePointerAddresses && len(pointerChain) > 0 {
-		d.w.Write(openParenBytes)
-		for i, addr := range pointerChain {
-			if i > 0 {
-				d.w.Write(pointerChainBytes)
-			}
-			printHexPtr(d.w, addr)
-		}
-		d.w.Write(closeParenBytes)
-	}
-
-	// Display dereferenced value.
-	d.w.Write(openParenBytes)
-	switch {
-	case nilFound:
-		d.w.Write(nilAngleBytes)
-
-	case cycleFound:
-		d.w.Write(circularBytes)
-
-	default:
-		d.ignoreNextType = true
-		d.dump(ve)
-	}
-	d.w.Write(closeParenBytes)
-}
-
-// dumpSlice handles formatting of arrays and slices.  Byte (uint8 under
-// reflection) arrays and slices are dumped in hexdump -C fashion.
-func (d *dumpState) dumpSlice(v reflect.Value) {
-	// Determine whether this type should be hex dumped or not.  Also,
-	// for types which should be hexdumped, try to use the underlying data
-	// first, then fall back to trying to convert them to a uint8 slice.
-	var buf []uint8
-	doConvert := false
-	doHexDump := false
-	numEntries := v.Len()
-	if numEntries > 0 {
-		vt := v.Index(0).Type()
-		vts := vt.String()
-		switch {
-		// C types that need to be converted.
-		case cCharRE.MatchString(vts):
-			fallthrough
-		case cUnsignedCharRE.MatchString(vts):
-			fallthrough
-		case cUint8tCharRE.MatchString(vts):
-			doConvert = true
-
-		// Try to use existing uint8 slices and fall back to converting
-		// and copying if that fails.
-		case vt.Kind() == reflect.Uint8:
-			// We need an addressable interface to convert the type
-			// to a byte slice.  However, the reflect package won't
-			// give us an interface on certain things like
-			// unexported struct fields in order to enforce
-			// visibility rules.  We use unsafe, when available, to
-			// bypass these restrictions since this package does not
-			// mutate the values.
-			vs := v
-			if !vs.CanInterface() || !vs.CanAddr() {
-				vs = unsafeReflectValue(vs)
-			}
-			if !UnsafeDisabled {
-				vs = vs.Slice(0, numEntries)
-
-				// Use the existing uint8 slice if it can be
-				// type asserted.
-				iface := vs.Interface()
-				if slice, ok := iface.([]uint8); ok {
-					buf = slice
-					doHexDump = true
-					break
-				}
-			}
-
-			// The underlying data needs to be converted if it can't
-			// be type asserted to a uint8 slice.
-			doConvert = true
-		}
-
-		// Copy and convert the underlying type if needed.
-		if doConvert && vt.ConvertibleTo(uint8Type) {
-			// Convert and copy each element into a uint8 byte
-			// slice.
-			buf = make([]uint8, numEntries)
-			for i := 0; i < numEntries; i++ {
-				vv := v.Index(i)
-				buf[i] = uint8(vv.Convert(uint8Type).Uint())
-			}
-			doHexDump = true
-		}
-	}
-
-	// Hexdump the entire slice as needed.
-	if doHexDump {
-		indent := strings.Repeat(d.cs.Indent, d.depth)
-		str := indent + hex.Dump(buf)
-		str = strings.Replace(str, "\n", "\n"+indent, -1)
-		str = strings.TrimRight(str, d.cs.Indent)
-		d.w.Write([]byte(str))
-		return
-	}
-
-	// Recursively call dump for each item.
-	for i := 0; i < numEntries; i++ {
-		d.dump(d.unpackValue(v.Index(i)))
-		if i < (numEntries - 1) {
-			d.w.Write(commaNewlineBytes)
-		} else {
-			d.w.Write(newlineBytes)
-		}
-	}
-}
-
-// dump is the main workhorse for dumping a value.  It uses the passed reflect
-// value to figure out what kind of object we are dealing with and formats it
-// appropriately.  It is a recursive function, however circular data structures
-// are detected and handled properly.
-func (d *dumpState) dump(v reflect.Value) {
-	// Handle invalid reflect values immediately.
-	kind := v.Kind()
-	if kind == reflect.Invalid {
-		d.w.Write(invalidAngleBytes)
-		return
-	}
-
-	// Handle pointers specially.
-	if kind == reflect.Ptr {
-		d.indent()
-		d.dumpPtr(v)
-		return
-	}
-
-	// Print type information unless already handled elsewhere.
-	if !d.ignoreNextType {
-		d.indent()
-		d.w.Write(openParenBytes)
-		d.w.Write([]byte(v.Type().String()))
-		d.w.Write(closeParenBytes)
-		d.w.Write(spaceBytes)
-	}
-	d.ignoreNextType = false
-
-	// Display length and capacity if the built-in len and cap functions
-	// work with the value's kind and the len/cap itself is non-zero.
-	valueLen, valueCap := 0, 0
-	switch v.Kind() {
-	case reflect.Array, reflect.Slice, reflect.Chan:
-		valueLen, valueCap = v.Len(), v.Cap()
-	case reflect.Map, reflect.String:
-		valueLen = v.Len()
-	}
-	if valueLen != 0 || !d.cs.DisableCapacities && valueCap != 0 {
-		d.w.Write(openParenBytes)
-		if valueLen != 0 {
-			d.w.Write(lenEqualsBytes)
-			printInt(d.w, int64(valueLen), 10)
-		}
-		if !d.cs.DisableCapacities && valueCap != 0 {
-			if valueLen != 0 {
-				d.w.Write(spaceBytes)
-			}
-			d.w.Write(capEqualsBytes)
-			printInt(d.w, int64(valueCap), 10)
-		}
-		d.w.Write(closeParenBytes)
-		d.w.Write(spaceBytes)
-	}
-
-	// Call Stringer/error interfaces if they exist and the handle methods flag
-	// is enabled
-	if !d.cs.DisableMethods {
-		if (kind != reflect.Invalid) && (kind != reflect.Interface) {
-			if handled := handleMethods(d.cs, d.w, v); handled {
-				return
-			}
-		}
-	}
-
-	switch kind {
-	case reflect.Invalid:
-		// Do nothing.  We should never get here since invalid has already
-		// been handled above.
-
-	case reflect.Bool:
-		printBool(d.w, v.Bool())
-
-	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
-		printInt(d.w, v.Int(), 10)
-
-	case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
-		printUint(d.w, v.Uint(), 10)
-
-	case reflect.Float32:
-		printFloat(d.w, v.Float(), 32)
-
-	case reflect.Float64:
-		printFloat(d.w, v.Float(), 64)
-
-	case reflect.Complex64:
-		printComplex(d.w, v.Complex(), 32)
-
-	case reflect.Complex128:
-		printComplex(d.w, v.Complex(), 64)
-
-	case reflect.Slice:
-		if v.IsNil() {
-			d.w.Write(nilAngleBytes)
-			break
-		}
-		fallthrough
-
-	case reflect.Array:
-		d.w.Write(openBraceNewlineBytes)
-		d.depth++
-		if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
-			d.indent()
-			d.w.Write(maxNewlineBytes)
-		} else {
-			d.dumpSlice(v)
-		}
-		d.depth--
-		d.indent()
-		d.w.Write(closeBraceBytes)
-
-	case reflect.String:
-		d.w.Write([]byte(strconv.Quote(v.String())))
-
-	case reflect.Interface:
-		// The only time we should get here is for nil interfaces due to
-		// unpackValue calls.
-		if v.IsNil() {
-			d.w.Write(nilAngleBytes)
-		}
-
-	case reflect.Ptr:
-		// Do nothing.  We should never get here since pointers have already
-		// been handled above.
-
-	case reflect.Map:
-		// nil maps should be indicated as different than empty maps
-		if v.IsNil() {
-			d.w.Write(nilAngleBytes)
-			break
-		}
-
-		d.w.Write(openBraceNewlineBytes)
-		d.depth++
-		if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
-			d.indent()
-			d.w.Write(maxNewlineBytes)
-		} else {
-			numEntries := v.Len()
-			keys := v.MapKeys()
-			if d.cs.SortKeys {
-				sortValues(keys, d.cs)
-			}
-			for i, key := range keys {
-				d.dump(d.unpackValue(key))
-				d.w.Write(colonSpaceBytes)
-				d.ignoreNextIndent = true
-				d.dump(d.unpackValue(v.MapIndex(key)))
-				if i < (numEntries - 1) {
-					d.w.Write(commaNewlineBytes)
-				} else {
-					d.w.Write(newlineBytes)
-				}
-			}
-		}
-		d.depth--
-		d.indent()
-		d.w.Write(closeBraceBytes)
-
-	case reflect.Struct:
-		d.w.Write(openBraceNewlineBytes)
-		d.depth++
-		if (d.cs.MaxDepth != 0) && (d.depth > d.cs.MaxDepth) {
-			d.indent()
-			d.w.Write(maxNewlineBytes)
-		} else {
-			vt := v.Type()
-			numFields := v.NumField()
-			for i := 0; i < numFields; i++ {
-				d.indent()
-				vtf := vt.Field(i)
-				d.w.Write([]byte(vtf.Name))
-				d.w.Write(colonSpaceBytes)
-				d.ignoreNextIndent = true
-				d.dump(d.unpackValue(v.Field(i)))
-				if i < (numFields - 1) {
-					d.w.Write(commaNewlineBytes)
-				} else {
-					d.w.Write(newlineBytes)
-				}
-			}
-		}
-		d.depth--
-		d.indent()
-		d.w.Write(closeBraceBytes)
-
-	case reflect.Uintptr:
-		printHexPtr(d.w, uintptr(v.Uint()))
-
-	case reflect.UnsafePointer, reflect.Chan, reflect.Func:
-		printHexPtr(d.w, v.Pointer())
-
-	// There were not any other types at the time this code was written, but
-	// fall back to letting the default fmt package handle it in case any new
-	// types are added.
-	default:
-		if v.CanInterface() {
-			fmt.Fprintf(d.w, "%v", v.Interface())
-		} else {
-			fmt.Fprintf(d.w, "%v", v.String())
-		}
-	}
-}
-
-// fdump is a helper function to consolidate the logic from the various public
-// methods which take varying writers and config states.
-func fdump(cs *ConfigState, w io.Writer, a ...interface{}) {
-	for _, arg := range a {
-		if arg == nil {
-			w.Write(interfaceBytes)
-			w.Write(spaceBytes)
-			w.Write(nilAngleBytes)
-			w.Write(newlineBytes)
-			continue
-		}
-
-		d := dumpState{w: w, cs: cs}
-		d.pointers = make(map[uintptr]int)
-		d.dump(reflect.ValueOf(arg))
-		d.w.Write(newlineBytes)
-	}
-}
-
-// Fdump formats and displays the passed arguments to io.Writer w.  It formats
-// exactly the same as Dump.
-func Fdump(w io.Writer, a ...interface{}) {
-	fdump(&Config, w, a...)
-}
-
-// Sdump returns a string with the passed arguments formatted exactly the same
-// as Dump.
-func Sdump(a ...interface{}) string {
-	var buf bytes.Buffer
-	fdump(&Config, &buf, a...)
-	return buf.String()
-}
-
-/*
-Dump displays the passed parameters to standard out with newlines, customizable
-indentation, and additional debug information such as complete types and all
-pointer addresses used to indirect to the final value.  It provides the
-following features over the built-in printing facilities provided by the fmt
-package:
-
-	* Pointers are dereferenced and followed
-	* Circular data structures are detected and handled properly
-	* Custom Stringer/error interfaces are optionally invoked, including
-	  on unexported types
-	* Custom types which only implement the Stringer/error interfaces via
-	  a pointer receiver are optionally invoked when passing non-pointer
-	  variables
-	* Byte arrays and slices are dumped like the hexdump -C command which
-	  includes offsets, byte values in hex, and ASCII output
-
-The configuration options are controlled by an exported package global,
-spew.Config.  See ConfigState for options documentation.
-
-See Fdump if you would prefer dumping to an arbitrary io.Writer or Sdump to
-get the formatted result as a string.
-*/
-func Dump(a ...interface{}) {
-	fdump(&Config, os.Stdout, a...)
-}

+ 0 - 419
vendor/github.com/davecgh/go-spew/spew/format.go

@@ -1,419 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
-	"bytes"
-	"fmt"
-	"reflect"
-	"strconv"
-	"strings"
-)
-
-// supportedFlags is a list of all the character flags supported by fmt package.
-const supportedFlags = "0-+# "
-
-// formatState implements the fmt.Formatter interface and contains information
-// about the state of a formatting operation.  The NewFormatter function can
-// be used to get a new Formatter which can be used directly as arguments
-// in standard fmt package printing calls.
-type formatState struct {
-	value          interface{}
-	fs             fmt.State
-	depth          int
-	pointers       map[uintptr]int
-	ignoreNextType bool
-	cs             *ConfigState
-}
-
-// buildDefaultFormat recreates the original format string without precision
-// and width information to pass in to fmt.Sprintf in the case of an
-// unrecognized type.  Unless new types are added to the language, this
-// function won't ever be called.
-func (f *formatState) buildDefaultFormat() (format string) {
-	buf := bytes.NewBuffer(percentBytes)
-
-	for _, flag := range supportedFlags {
-		if f.fs.Flag(int(flag)) {
-			buf.WriteRune(flag)
-		}
-	}
-
-	buf.WriteRune('v')
-
-	format = buf.String()
-	return format
-}
-
-// constructOrigFormat recreates the original format string including precision
-// and width information to pass along to the standard fmt package.  This allows
-// automatic deferral of all format strings this package doesn't support.
-func (f *formatState) constructOrigFormat(verb rune) (format string) {
-	buf := bytes.NewBuffer(percentBytes)
-
-	for _, flag := range supportedFlags {
-		if f.fs.Flag(int(flag)) {
-			buf.WriteRune(flag)
-		}
-	}
-
-	if width, ok := f.fs.Width(); ok {
-		buf.WriteString(strconv.Itoa(width))
-	}
-
-	if precision, ok := f.fs.Precision(); ok {
-		buf.Write(precisionBytes)
-		buf.WriteString(strconv.Itoa(precision))
-	}
-
-	buf.WriteRune(verb)
-
-	format = buf.String()
-	return format
-}
-
-// unpackValue returns values inside of non-nil interfaces when possible and
-// ensures that types for values which have been unpacked from an interface
-// are displayed when the show types flag is also set.
-// This is useful for data types like structs, arrays, slices, and maps which
-// can contain varying types packed inside an interface.
-func (f *formatState) unpackValue(v reflect.Value) reflect.Value {
-	if v.Kind() == reflect.Interface {
-		f.ignoreNextType = false
-		if !v.IsNil() {
-			v = v.Elem()
-		}
-	}
-	return v
-}
-
-// formatPtr handles formatting of pointers by indirecting them as necessary.
-func (f *formatState) formatPtr(v reflect.Value) {
-	// Display nil if top level pointer is nil.
-	showTypes := f.fs.Flag('#')
-	if v.IsNil() && (!showTypes || f.ignoreNextType) {
-		f.fs.Write(nilAngleBytes)
-		return
-	}
-
-	// Remove pointers at or below the current depth from map used to detect
-	// circular refs.
-	for k, depth := range f.pointers {
-		if depth >= f.depth {
-			delete(f.pointers, k)
-		}
-	}
-
-	// Keep list of all dereferenced pointers to possibly show later.
-	pointerChain := make([]uintptr, 0)
-
-	// Figure out how many levels of indirection there are by derferencing
-	// pointers and unpacking interfaces down the chain while detecting circular
-	// references.
-	nilFound := false
-	cycleFound := false
-	indirects := 0
-	ve := v
-	for ve.Kind() == reflect.Ptr {
-		if ve.IsNil() {
-			nilFound = true
-			break
-		}
-		indirects++
-		addr := ve.Pointer()
-		pointerChain = append(pointerChain, addr)
-		if pd, ok := f.pointers[addr]; ok && pd < f.depth {
-			cycleFound = true
-			indirects--
-			break
-		}
-		f.pointers[addr] = f.depth
-
-		ve = ve.Elem()
-		if ve.Kind() == reflect.Interface {
-			if ve.IsNil() {
-				nilFound = true
-				break
-			}
-			ve = ve.Elem()
-		}
-	}
-
-	// Display type or indirection level depending on flags.
-	if showTypes && !f.ignoreNextType {
-		f.fs.Write(openParenBytes)
-		f.fs.Write(bytes.Repeat(asteriskBytes, indirects))
-		f.fs.Write([]byte(ve.Type().String()))
-		f.fs.Write(closeParenBytes)
-	} else {
-		if nilFound || cycleFound {
-			indirects += strings.Count(ve.Type().String(), "*")
-		}
-		f.fs.Write(openAngleBytes)
-		f.fs.Write([]byte(strings.Repeat("*", indirects)))
-		f.fs.Write(closeAngleBytes)
-	}
-
-	// Display pointer information depending on flags.
-	if f.fs.Flag('+') && (len(pointerChain) > 0) {
-		f.fs.Write(openParenBytes)
-		for i, addr := range pointerChain {
-			if i > 0 {
-				f.fs.Write(pointerChainBytes)
-			}
-			printHexPtr(f.fs, addr)
-		}
-		f.fs.Write(closeParenBytes)
-	}
-
-	// Display dereferenced value.
-	switch {
-	case nilFound:
-		f.fs.Write(nilAngleBytes)
-
-	case cycleFound:
-		f.fs.Write(circularShortBytes)
-
-	default:
-		f.ignoreNextType = true
-		f.format(ve)
-	}
-}
-
-// format is the main workhorse for providing the Formatter interface.  It
-// uses the passed reflect value to figure out what kind of object we are
-// dealing with and formats it appropriately.  It is a recursive function,
-// however circular data structures are detected and handled properly.
-func (f *formatState) format(v reflect.Value) {
-	// Handle invalid reflect values immediately.
-	kind := v.Kind()
-	if kind == reflect.Invalid {
-		f.fs.Write(invalidAngleBytes)
-		return
-	}
-
-	// Handle pointers specially.
-	if kind == reflect.Ptr {
-		f.formatPtr(v)
-		return
-	}
-
-	// Print type information unless already handled elsewhere.
-	if !f.ignoreNextType && f.fs.Flag('#') {
-		f.fs.Write(openParenBytes)
-		f.fs.Write([]byte(v.Type().String()))
-		f.fs.Write(closeParenBytes)
-	}
-	f.ignoreNextType = false
-
-	// Call Stringer/error interfaces if they exist and the handle methods
-	// flag is enabled.
-	if !f.cs.DisableMethods {
-		if (kind != reflect.Invalid) && (kind != reflect.Interface) {
-			if handled := handleMethods(f.cs, f.fs, v); handled {
-				return
-			}
-		}
-	}
-
-	switch kind {
-	case reflect.Invalid:
-		// Do nothing.  We should never get here since invalid has already
-		// been handled above.
-
-	case reflect.Bool:
-		printBool(f.fs, v.Bool())
-
-	case reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Int:
-		printInt(f.fs, v.Int(), 10)
-
-	case reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uint:
-		printUint(f.fs, v.Uint(), 10)
-
-	case reflect.Float32:
-		printFloat(f.fs, v.Float(), 32)
-
-	case reflect.Float64:
-		printFloat(f.fs, v.Float(), 64)
-
-	case reflect.Complex64:
-		printComplex(f.fs, v.Complex(), 32)
-
-	case reflect.Complex128:
-		printComplex(f.fs, v.Complex(), 64)
-
-	case reflect.Slice:
-		if v.IsNil() {
-			f.fs.Write(nilAngleBytes)
-			break
-		}
-		fallthrough
-
-	case reflect.Array:
-		f.fs.Write(openBracketBytes)
-		f.depth++
-		if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
-			f.fs.Write(maxShortBytes)
-		} else {
-			numEntries := v.Len()
-			for i := 0; i < numEntries; i++ {
-				if i > 0 {
-					f.fs.Write(spaceBytes)
-				}
-				f.ignoreNextType = true
-				f.format(f.unpackValue(v.Index(i)))
-			}
-		}
-		f.depth--
-		f.fs.Write(closeBracketBytes)
-
-	case reflect.String:
-		f.fs.Write([]byte(v.String()))
-
-	case reflect.Interface:
-		// The only time we should get here is for nil interfaces due to
-		// unpackValue calls.
-		if v.IsNil() {
-			f.fs.Write(nilAngleBytes)
-		}
-
-	case reflect.Ptr:
-		// Do nothing.  We should never get here since pointers have already
-		// been handled above.
-
-	case reflect.Map:
-		// nil maps should be indicated as different than empty maps
-		if v.IsNil() {
-			f.fs.Write(nilAngleBytes)
-			break
-		}
-
-		f.fs.Write(openMapBytes)
-		f.depth++
-		if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
-			f.fs.Write(maxShortBytes)
-		} else {
-			keys := v.MapKeys()
-			if f.cs.SortKeys {
-				sortValues(keys, f.cs)
-			}
-			for i, key := range keys {
-				if i > 0 {
-					f.fs.Write(spaceBytes)
-				}
-				f.ignoreNextType = true
-				f.format(f.unpackValue(key))
-				f.fs.Write(colonBytes)
-				f.ignoreNextType = true
-				f.format(f.unpackValue(v.MapIndex(key)))
-			}
-		}
-		f.depth--
-		f.fs.Write(closeMapBytes)
-
-	case reflect.Struct:
-		numFields := v.NumField()
-		f.fs.Write(openBraceBytes)
-		f.depth++
-		if (f.cs.MaxDepth != 0) && (f.depth > f.cs.MaxDepth) {
-			f.fs.Write(maxShortBytes)
-		} else {
-			vt := v.Type()
-			for i := 0; i < numFields; i++ {
-				if i > 0 {
-					f.fs.Write(spaceBytes)
-				}
-				vtf := vt.Field(i)
-				if f.fs.Flag('+') || f.fs.Flag('#') {
-					f.fs.Write([]byte(vtf.Name))
-					f.fs.Write(colonBytes)
-				}
-				f.format(f.unpackValue(v.Field(i)))
-			}
-		}
-		f.depth--
-		f.fs.Write(closeBraceBytes)
-
-	case reflect.Uintptr:
-		printHexPtr(f.fs, uintptr(v.Uint()))
-
-	case reflect.UnsafePointer, reflect.Chan, reflect.Func:
-		printHexPtr(f.fs, v.Pointer())
-
-	// There were not any other types at the time this code was written, but
-	// fall back to letting the default fmt package handle it if any get added.
-	default:
-		format := f.buildDefaultFormat()
-		if v.CanInterface() {
-			fmt.Fprintf(f.fs, format, v.Interface())
-		} else {
-			fmt.Fprintf(f.fs, format, v.String())
-		}
-	}
-}
-
-// Format satisfies the fmt.Formatter interface. See NewFormatter for usage
-// details.
-func (f *formatState) Format(fs fmt.State, verb rune) {
-	f.fs = fs
-
-	// Use standard formatting for verbs that are not v.
-	if verb != 'v' {
-		format := f.constructOrigFormat(verb)
-		fmt.Fprintf(fs, format, f.value)
-		return
-	}
-
-	if f.value == nil {
-		if fs.Flag('#') {
-			fs.Write(interfaceBytes)
-		}
-		fs.Write(nilAngleBytes)
-		return
-	}
-
-	f.format(reflect.ValueOf(f.value))
-}
-
-// newFormatter is a helper function to consolidate the logic from the various
-// public methods which take varying config states.
-func newFormatter(cs *ConfigState, v interface{}) fmt.Formatter {
-	fs := &formatState{value: v, cs: cs}
-	fs.pointers = make(map[uintptr]int)
-	return fs
-}
-
-/*
-NewFormatter returns a custom formatter that satisfies the fmt.Formatter
-interface.  As a result, it integrates cleanly with standard fmt package
-printing functions.  The formatter is useful for inline printing of smaller data
-types similar to the standard %v format specifier.
-
-The custom formatter only responds to the %v (most compact), %+v (adds pointer
-addresses), %#v (adds types), or %#+v (adds types and pointer addresses) verb
-combinations.  Any other verbs such as %x and %q will be sent to the the
-standard fmt package for formatting.  In addition, the custom formatter ignores
-the width and precision arguments (however they will still work on the format
-specifiers not handled by the custom formatter).
-
-Typically this function shouldn't be called directly.  It is much easier to make
-use of the custom formatter by calling one of the convenience functions such as
-Printf, Println, or Fprintf.
-*/
-func NewFormatter(v interface{}) fmt.Formatter {
-	return newFormatter(&Config, v)
-}

+ 0 - 148
vendor/github.com/davecgh/go-spew/spew/spew.go

@@ -1,148 +0,0 @@
-/*
- * Copyright (c) 2013-2016 Dave Collins <dave@davec.name>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-package spew
-
-import (
-	"fmt"
-	"io"
-)
-
-// Errorf is a wrapper for fmt.Errorf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the formatted string as a value that satisfies error.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Errorf(format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Errorf(format string, a ...interface{}) (err error) {
-	return fmt.Errorf(format, convertArgs(a)...)
-}
-
-// Fprint is a wrapper for fmt.Fprint that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Fprint(w, spew.NewFormatter(a), spew.NewFormatter(b))
-func Fprint(w io.Writer, a ...interface{}) (n int, err error) {
-	return fmt.Fprint(w, convertArgs(a)...)
-}
-
-// Fprintf is a wrapper for fmt.Fprintf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Fprintf(w, format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Fprintf(w io.Writer, format string, a ...interface{}) (n int, err error) {
-	return fmt.Fprintf(w, format, convertArgs(a)...)
-}
-
-// Fprintln is a wrapper for fmt.Fprintln that treats each argument as if it
-// passed with a default Formatter interface returned by NewFormatter.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Fprintln(w, spew.NewFormatter(a), spew.NewFormatter(b))
-func Fprintln(w io.Writer, a ...interface{}) (n int, err error) {
-	return fmt.Fprintln(w, convertArgs(a)...)
-}
-
-// Print is a wrapper for fmt.Print that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Print(spew.NewFormatter(a), spew.NewFormatter(b))
-func Print(a ...interface{}) (n int, err error) {
-	return fmt.Print(convertArgs(a)...)
-}
-
-// Printf is a wrapper for fmt.Printf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Printf(format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Printf(format string, a ...interface{}) (n int, err error) {
-	return fmt.Printf(format, convertArgs(a)...)
-}
-
-// Println is a wrapper for fmt.Println that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the number of bytes written and any write error encountered.  See
-// NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Println(spew.NewFormatter(a), spew.NewFormatter(b))
-func Println(a ...interface{}) (n int, err error) {
-	return fmt.Println(convertArgs(a)...)
-}
-
-// Sprint is a wrapper for fmt.Sprint that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the resulting string.  See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Sprint(spew.NewFormatter(a), spew.NewFormatter(b))
-func Sprint(a ...interface{}) string {
-	return fmt.Sprint(convertArgs(a)...)
-}
-
-// Sprintf is a wrapper for fmt.Sprintf that treats each argument as if it were
-// passed with a default Formatter interface returned by NewFormatter.  It
-// returns the resulting string.  See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Sprintf(format, spew.NewFormatter(a), spew.NewFormatter(b))
-func Sprintf(format string, a ...interface{}) string {
-	return fmt.Sprintf(format, convertArgs(a)...)
-}
-
-// Sprintln is a wrapper for fmt.Sprintln that treats each argument as if it
-// were passed with a default Formatter interface returned by NewFormatter.  It
-// returns the resulting string.  See NewFormatter for formatting details.
-//
-// This function is shorthand for the following syntax:
-//
-//	fmt.Sprintln(spew.NewFormatter(a), spew.NewFormatter(b))
-func Sprintln(a ...interface{}) string {
-	return fmt.Sprintln(convertArgs(a)...)
-}
-
-// convertArgs accepts a slice of arguments and returns a slice of the same
-// length with each argument converted to a default spew Formatter interface.
-func convertArgs(args []interface{}) (formatters []interface{}) {
-	formatters = make([]interface{}, len(args))
-	for index, arg := range args {
-		formatters[index] = NewFormatter(arg)
-	}
-	return formatters
-}

+ 0 - 21
vendor/github.com/dgryski/go-rendezvous/LICENSE

@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2017-2020 Damian Gryski <damian@gryski.com>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.

+ 0 - 79
vendor/github.com/dgryski/go-rendezvous/rdv.go

@@ -1,79 +0,0 @@
-package rendezvous
-
-type Rendezvous struct {
-	nodes map[string]int
-	nstr  []string
-	nhash []uint64
-	hash  Hasher
-}
-
-type Hasher func(s string) uint64
-
-func New(nodes []string, hash Hasher) *Rendezvous {
-	r := &Rendezvous{
-		nodes: make(map[string]int, len(nodes)),
-		nstr:  make([]string, len(nodes)),
-		nhash: make([]uint64, len(nodes)),
-		hash:  hash,
-	}
-
-	for i, n := range nodes {
-		r.nodes[n] = i
-		r.nstr[i] = n
-		r.nhash[i] = hash(n)
-	}
-
-	return r
-}
-
-func (r *Rendezvous) Lookup(k string) string {
-	// short-circuit if we're empty
-	if len(r.nodes) == 0 {
-		return ""
-	}
-
-	khash := r.hash(k)
-
-	var midx int
-	var mhash = xorshiftMult64(khash ^ r.nhash[0])
-
-	for i, nhash := range r.nhash[1:] {
-		if h := xorshiftMult64(khash ^ nhash); h > mhash {
-			midx = i + 1
-			mhash = h
-		}
-	}
-
-	return r.nstr[midx]
-}
-
-func (r *Rendezvous) Add(node string) {
-	r.nodes[node] = len(r.nstr)
-	r.nstr = append(r.nstr, node)
-	r.nhash = append(r.nhash, r.hash(node))
-}
-
-func (r *Rendezvous) Remove(node string) {
-	// find index of node to remove
-	nidx := r.nodes[node]
-
-	// remove from the slices
-	l := len(r.nstr)
-	r.nstr[nidx] = r.nstr[l]
-	r.nstr = r.nstr[:l]
-
-	r.nhash[nidx] = r.nhash[l]
-	r.nhash = r.nhash[:l]
-
-	// update the map
-	delete(r.nodes, node)
-	moved := r.nstr[nidx]
-	r.nodes[moved] = nidx
-}
-
-func xorshiftMult64(x uint64) uint64 {
-	x ^= x >> 12 // a
-	x ^= x << 25 // b
-	x ^= x >> 27 // c
-	return x * 2685821657736338717
-}

+ 0 - 71
vendor/github.com/emicklei/go-restful/v3/.gitignore

@@ -1,71 +0,0 @@
-# Compiled Object files, Static and Dynamic libs (Shared Objects)
-*.o
-*.a
-*.so
-
-# Folders
-_obj
-_test
-
-# Architecture specific extensions/prefixes
-*.[568vq]
-[568vq].out
-
-*.cgo1.go
-*.cgo2.c
-_cgo_defun.c
-_cgo_gotypes.go
-_cgo_export.*
-
-_testmain.go
-
-*.exe
-
-restful.html
-
-*.out
-
-tmp.prof
-
-go-restful.test
-
-examples/restful-basic-authentication
-
-examples/restful-encoding-filter
-
-examples/restful-filters
-
-examples/restful-hello-world
-
-examples/restful-resource-functions
-
-examples/restful-serve-static
-
-examples/restful-user-service
-
-*.DS_Store
-examples/restful-user-resource
-
-examples/restful-multi-containers
-
-examples/restful-form-handling
-
-examples/restful-CORS-filter
-
-examples/restful-options-filter
-
-examples/restful-curly-router
-
-examples/restful-cpuprofiler-service
-
-examples/restful-pre-post-filters
-
-curly.prof
-
-examples/restful-NCSA-logging
-
-examples/restful-html-template
-
-s.html
-restful-path-tail
-.idea

+ 0 - 1
vendor/github.com/emicklei/go-restful/v3/.goconvey

@@ -1 +0,0 @@
-ignore

+ 0 - 13
vendor/github.com/emicklei/go-restful/v3/.travis.yml

@@ -1,13 +0,0 @@
-language: go
-
-go:
-  - 1.x
-
-before_install:
-  - go test -v
-
-script:
-  - go test -race -coverprofile=coverage.txt -covermode=atomic
-
-after_success:
-  - bash <(curl -s https://codecov.io/bash)

+ 0 - 376
vendor/github.com/emicklei/go-restful/v3/CHANGES.md

@@ -1,376 +0,0 @@
-# Change history of go-restful
-
-## [v3.9.0] - 20221-07-21
-
-- add support for http.Handler implementations to work as FilterFunction, issue #504 (thanks to https://github.com/ggicci)
-
-## [v3.8.0] - 20221-06-06
-
-- use exact matching of allowed domain entries, issue #489 (#493)
-	- this changes fixes [security] Authorization Bypass Through User-Controlled Key
-	  by changing the behaviour of the AllowedDomains setting in the CORS filter.
-	  To support the previous behaviour, the CORS filter type now has a AllowedDomainFunc
-	  callback mechanism which is called when a simple domain match fails. 
-- add test and fix for POST without body and Content-type, issue #492 (#496)
-- [Minor] Bad practice to have a mix of Receiver types. (#491)
-
-## [v3.7.2] - 2021-11-24
-
-- restored FilterChain (#482 by SVilgelm)
-
-
-## [v3.7.1] - 2021-10-04
-
-- fix problem with contentEncodingEnabled setting (#479)
-
-## [v3.7.0] - 2021-09-24
-
-- feat(parameter): adds additional openapi mappings (#478)
-
-## [v3.6.0] - 2021-09-18
-
-- add support for vendor extensions (#477 thx erraggy)
-
-## [v3.5.2] - 2021-07-14
-
-- fix removing absent route from webservice (#472)
-
-## [v3.5.1] - 2021-04-12
-
-- fix handling no match access selected path
-- remove obsolete field
-
-## [v3.5.0] - 2021-04-10
-
-- add check for wildcard (#463) in CORS
-- add access to Route from Request, issue #459 (#462)
-
-## [v3.4.0] - 2020-11-10
-
-- Added OPTIONS to WebService
-
-## [v3.3.2] - 2020-01-23
-
-- Fixed duplicate compression in dispatch. #449
-
-
-## [v3.3.1] - 2020-08-31
-
-- Added check on writer to prevent compression of response twice. #447
-
-## [v3.3.0] - 2020-08-19
-
-- Enable content encoding on Handle and ServeHTTP (#446)
-- List available representations in 406 body (#437)
-- Convert to string using rune() (#443)
-
-## [v3.2.0] - 2020-06-21
-
-- 405 Method Not Allowed must have Allow header (#436) (thx Bracken <abdawson@gmail.com>)
-- add field allowedMethodsWithoutContentType (#424)
-
-## [v3.1.0]
-
-- support describing response headers (#426)
-- fix openapi examples (#425)
-
-v3.0.0
-
-- fix: use request/response resulting from filter chain
-- add Go module
-  Module consumer should use github.com/emicklei/go-restful/v3 as import path
-
-v2.10.0
-
-- support for Custom Verbs (thanks Vinci Xu <277040271@qq.com>)
-- fixed static example (thanks Arthur <yang_yapo@126.com>)
-- simplify code (thanks Christian Muehlhaeuser <muesli@gmail.com>)
-- added JWT HMAC with SHA-512 authentication code example (thanks Amim Knabben <amim.knabben@gmail.com>)
-
-v2.9.6
-
-- small optimization in filter code
-
-v2.11.1
-
-- fix WriteError return value (#415)
-
-v2.11.0 
-
-- allow prefix and suffix in path variable expression (#414)
-
-v2.9.6
-
-- support google custome verb (#413)
-
-v2.9.5
-
-- fix panic in Response.WriteError if err == nil
-
-v2.9.4
-
-- fix issue #400 , parsing mime type quality
-- Route Builder added option for contentEncodingEnabled (#398)
-
-v2.9.3
-
-- Avoid return of 415 Unsupported Media Type when request body is empty (#396)
-
-v2.9.2
-
-- Reduce allocations in per-request methods to improve performance (#395)
-
-v2.9.1
-
-- Fix issue with default responses and invalid status code 0. (#393)
-
-v2.9.0
-
-- add per Route content encoding setting (overrides container setting)
-
-v2.8.0
-
-- add Request.QueryParameters()
-- add json-iterator (via build tag)
-- disable vgo module (until log is moved)
-
-v2.7.1
-
-- add vgo module
-
-v2.6.1
-
-- add JSONNewDecoderFunc to allow custom JSON Decoder usage (go 1.10+)
-
-v2.6.0
-
-- Make JSR 311 routing and path param processing consistent
-- Adding description to RouteBuilder.Reads()
-- Update example for Swagger12 and OpenAPI
-
-2017-09-13
-
-- added route condition functions using `.If(func)` in route building.
-
-2017-02-16
-
-- solved issue #304, make operation names unique
-
-2017-01-30
- 
-	[IMPORTANT] For swagger users, change your import statement to:	
-	swagger "github.com/emicklei/go-restful-swagger12"
-
-- moved swagger 1.2 code to go-restful-swagger12
-- created TAG 2.0.0
-
-2017-01-27
-
-- remove defer request body close
-- expose Dispatch for testing filters and Routefunctions
-- swagger response model cannot be array 
-- created TAG 1.0.0
-
-2016-12-22
-
-- (API change) Remove code related to caching request content. Removes SetCacheReadEntity(doCache bool)
-
-2016-11-26
-
-- Default change! now use CurlyRouter (was RouterJSR311)
-- Default change! no more caching of request content
-- Default change! do not recover from panics
-
-2016-09-22
-
-- fix the DefaultRequestContentType feature
-
-2016-02-14
-
-- take the qualify factor of the Accept header mediatype into account when deciding the contentype of the response
-- add constructors for custom entity accessors for xml and json 
-
-2015-09-27
-
-- rename new WriteStatusAnd... to WriteHeaderAnd... for consistency
-
-2015-09-25
-
-- fixed problem with changing Header after WriteHeader (issue 235)
-
-2015-09-14
-
-- changed behavior of WriteHeader (immediate write) and WriteEntity (no status write)
-- added support for custom EntityReaderWriters.
-
-2015-08-06
-
-- add support for reading entities from compressed request content
-- use sync.Pool for compressors of http response and request body
-- add Description to Parameter for documentation in Swagger UI
-
-2015-03-20
-
-- add configurable logging
-
-2015-03-18
-
-- if not specified, the Operation is derived from the Route function
-
-2015-03-17
-
-- expose Parameter creation functions
-- make trace logger an interface
-- fix OPTIONSFilter
-- customize rendering of ServiceError
-- JSR311 router now handles wildcards
-- add Notes to Route
-
-2014-11-27
-
-- (api add) PrettyPrint per response. (as proposed in #167)
-
-2014-11-12
-
-- (api add) ApiVersion(.) for documentation in Swagger UI
-
-2014-11-10
-
-- (api change) struct fields tagged with "description" show up in Swagger UI
-
-2014-10-31
-
-- (api change) ReturnsError -> Returns
-- (api add)    RouteBuilder.Do(aBuilder) for DRY use of RouteBuilder
-- fix swagger nested structs
-- sort Swagger response messages by code
-
-2014-10-23
-
-- (api add) ReturnsError allows you to document Http codes in swagger
-- fixed problem with greedy CurlyRouter
-- (api add) Access-Control-Max-Age in CORS
-- add tracing functionality (injectable) for debugging purposes
-- support JSON parse 64bit int 
-- fix empty parameters for swagger
-- WebServicesUrl is now optional for swagger
-- fixed duplicate AccessControlAllowOrigin in CORS
-- (api change) expose ServeMux in container
-- (api add) added AllowedDomains in CORS
-- (api add) ParameterNamed for detailed documentation
-
-2014-04-16
-
-- (api add) expose constructor of Request for testing.
-
-2014-06-27
-
-- (api add) ParameterNamed gives access to a Parameter definition and its data (for further specification).
-- (api add) SetCacheReadEntity allow scontrol over whether or not the request body is being cached (default true for compatibility reasons).
-
-2014-07-03
-
-- (api add) CORS can be configured with a list of allowed domains
-
-2014-03-12
-
-- (api add) Route path parameters can use wildcard or regular expressions. (requires CurlyRouter)
-
-2014-02-26
-
-- (api add) Request now provides information about the matched Route, see method SelectedRoutePath 
-
-2014-02-17
-
-- (api change) renamed parameter constants (go-lint checks)
-
-2014-01-10
-
-- (api add) support for CloseNotify, see http://golang.org/pkg/net/http/#CloseNotifier
-
-2014-01-07
-
-- (api change) Write* methods in Response now return the error or nil.
-- added example of serving HTML from a Go template.
-- fixed comparing Allowed headers in CORS (is now case-insensitive)
-
-2013-11-13
-
-- (api add) Response knows how many bytes are written to the response body.
-
-2013-10-29
-
-- (api add) RecoverHandler(handler RecoverHandleFunction) to change how panic recovery is handled. Default behavior is to log and return a stacktrace. This may be a security issue as it exposes sourcecode information.
-
-2013-10-04
-
-- (api add) Response knows what HTTP status has been written
-- (api add) Request can have attributes (map of string->interface, also called request-scoped variables
-
-2013-09-12
-
-- (api change) Router interface simplified
-- Implemented CurlyRouter, a Router that does not use|allow regular expressions in paths
-
-2013-08-05
- - add OPTIONS support
- - add CORS support
-
-2013-08-27
-
-- fixed some reported issues (see github)
-- (api change) deprecated use of WriteError; use WriteErrorString instead
-
-2014-04-15
-
-- (fix) v1.0.1 tag: fix Issue 111: WriteErrorString
-
-2013-08-08
-
-- (api add) Added implementation Container: a WebServices collection with its own http.ServeMux allowing multiple endpoints per program. Existing uses of go-restful will register their services to the DefaultContainer.
-- (api add) the swagger package has be extended to have a UI per container.
-- if panic is detected then a small stack trace is printed (thanks to runner-mei)
-- (api add) WriteErrorString to Response
-
-Important API changes:
-
-- (api remove) package variable DoNotRecover no longer works ; use restful.DefaultContainer.DoNotRecover(true) instead.
-- (api remove) package variable EnableContentEncoding no longer works ; use restful.DefaultContainer.EnableContentEncoding(true) instead.
- 
- 
-2013-07-06
-
-- (api add) Added support for response encoding (gzip and deflate(zlib)). This feature is disabled on default (for backwards compatibility). Use restful.EnableContentEncoding = true in your initialization to enable this feature.
-
-2013-06-19
-
-- (improve) DoNotRecover option, moved request body closer, improved ReadEntity
-
-2013-06-03
-
-- (api change) removed Dispatcher interface, hide PathExpression
-- changed receiver names of type functions to be more idiomatic Go
-
-2013-06-02
-
-- (optimize) Cache the RegExp compilation of Paths.
-
-2013-05-22
-	
-- (api add) Added support for request/response filter functions
-
-2013-05-18
-
-
-- (api add) Added feature to change the default Http Request Dispatch function (travis cline)
-- (api change) Moved Swagger Webservice to swagger package (see example restful-user)
-
-[2012-11-14 .. 2013-05-18>
- 
-- See https://github.com/emicklei/go-restful/commits
-
-2012-11-14
-
-- Initial commit
-
-

+ 0 - 22
vendor/github.com/emicklei/go-restful/v3/LICENSE

@@ -1,22 +0,0 @@
-Copyright (c) 2012,2013 Ernest Micklei
-
-MIT License
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 0 - 8
vendor/github.com/emicklei/go-restful/v3/Makefile

@@ -1,8 +0,0 @@
-all: test
-
-test:
-	go vet .
-	go test -cover -v .
-
-ex:
-	find ./examples -type f -name "*.go" | xargs -I {} go build -o /tmp/ignore {}

+ 0 - 111
vendor/github.com/emicklei/go-restful/v3/README.md

@@ -1,111 +0,0 @@
-go-restful
-==========
-package for building REST-style Web Services using Google Go
-
-[![Build Status](https://travis-ci.org/emicklei/go-restful.png)](https://travis-ci.org/emicklei/go-restful)
-[![Go Report Card](https://goreportcard.com/badge/github.com/emicklei/go-restful)](https://goreportcard.com/report/github.com/emicklei/go-restful)
-[![GoDoc](https://godoc.org/github.com/emicklei/go-restful?status.svg)](https://pkg.go.dev/github.com/emicklei/go-restful)
-[![codecov](https://codecov.io/gh/emicklei/go-restful/branch/master/graph/badge.svg)](https://codecov.io/gh/emicklei/go-restful)
-
-- [Code examples use v3](https://github.com/emicklei/go-restful/tree/v3/examples)
-
-REST asks developers to use HTTP methods explicitly and in a way that's consistent with the protocol definition. This basic REST design principle establishes a one-to-one mapping between create, read, update, and delete (CRUD) operations and HTTP methods. According to this mapping:
-
-- GET = Retrieve a representation of a resource
-- POST = Create if you are sending content to the server to create a subordinate of the specified resource collection, using some server-side algorithm.
-- PUT = Create if you are sending the full content of the specified resource (URI).
-- PUT = Update if you are updating the full content of the specified resource.
-- DELETE = Delete if you are requesting the server to delete the resource
-- PATCH = Update partial content of a resource
-- OPTIONS = Get information about the communication options for the request URI
-    
-### Usage
-
-#### Without Go Modules
-
-All versions up to `v2.*.*` (on the master) are not supporting Go modules.
-
-```
-import (
-	restful "github.com/emicklei/go-restful"
-)
-```
-
-#### Using Go Modules
-
-As of version `v3.0.0` (on the v3 branch), this package supports Go modules.
-
-```
-import (
-	restful "github.com/emicklei/go-restful/v3"
-)
-```
-
-### Example
-
-```Go
-ws := new(restful.WebService)
-ws.
-	Path("/users").
-	Consumes(restful.MIME_XML, restful.MIME_JSON).
-	Produces(restful.MIME_JSON, restful.MIME_XML)
-
-ws.Route(ws.GET("/{user-id}").To(u.findUser).
-	Doc("get a user").
-	Param(ws.PathParameter("user-id", "identifier of the user").DataType("string")).
-	Writes(User{}))		
-...
-	
-func (u UserResource) findUser(request *restful.Request, response *restful.Response) {
-	id := request.PathParameter("user-id")
-	...
-}
-```
-	
-[Full API of a UserResource](https://github.com/emicklei/go-restful/blob/v3/examples/user-resource/restful-user-resource.go) 
-		
-### Features
-
-- Routes for request &#8594; function mapping with path parameter (e.g. {id} but also prefix_{var} and {var}_suffix) support
-- Configurable router:
-	- (default) Fast routing algorithm that allows static elements, [google custom method](https://cloud.google.com/apis/design/custom_methods), regular expressions and dynamic parameters in the URL path (e.g. /resource/name:customVerb, /meetings/{id} or /static/{subpath:*})
-	- Routing algorithm after [JSR311](http://jsr311.java.net/nonav/releases/1.1/spec/spec.html) that is implemented using (but does **not** accept) regular expressions
-- Request API for reading structs from JSON/XML and accessing parameters (path,query,header)
-- Response API for writing structs to JSON/XML and setting headers
-- Customizable encoding using EntityReaderWriter registration
-- Filters for intercepting the request &#8594; response flow on Service or Route level
-- Request-scoped variables using attributes
-- Containers for WebServices on different HTTP endpoints
-- Content encoding (gzip,deflate) of request and response payloads
-- Automatic responses on OPTIONS (using a filter)
-- Automatic CORS request handling (using a filter)
-- API declaration for Swagger UI ([go-restful-openapi](https://github.com/emicklei/go-restful-openapi), see [go-restful-swagger12](https://github.com/emicklei/go-restful-swagger12))
-- Panic recovery to produce HTTP 500, customizable using RecoverHandler(...)
-- Route errors produce HTTP 404/405/406/415 errors, customizable using ServiceErrorHandler(...)
-- Configurable (trace) logging
-- Customizable gzip/deflate readers and writers using CompressorProvider registration
-- Inject your own http.Handler using the `HttpMiddlewareHandlerToFilter` function
-
-## How to customize
-There are several hooks to customize the behavior of the go-restful package.
-
-- Router algorithm
-- Panic recovery
-- JSON decoder
-- Trace logging
-- Compression
-- Encoders for other serializers
-- Use [jsoniter](https://github.com/json-iterator/go) by building this package using a build tag, e.g. `go build -tags=jsoniter .` 
-
-## Resources
-
-- [Example programs](./examples)
-- [Example posted on blog](http://ernestmicklei.com/2012/11/go-restful-first-working-example/)
-- [Design explained on blog](http://ernestmicklei.com/2012/11/go-restful-api-design/)
-- [sourcegraph](https://sourcegraph.com/github.com/emicklei/go-restful)
-- [showcase: Zazkia - tcp proxy for testing resiliency](https://github.com/emicklei/zazkia)
-- [showcase: Mora - MongoDB REST Api server](https://github.com/emicklei/mora)
-
-Type ```git shortlog -s``` for a full list of contributors.
-
-© 2012 - 2022, http://ernestmicklei.com. MIT License. Contributions are welcome.

+ 0 - 13
vendor/github.com/emicklei/go-restful/v3/SECURITY.md

@@ -1,13 +0,0 @@
-# Security Policy
-
-## Supported Versions
-
-| Version | Supported          |
-| ------- | ------------------ |
-| v3.7.x     | :white_check_mark: |
-| < v3.0.1   | :x:                |
-
-## Reporting a Vulnerability
-
-Create an Issue and put the label `[security]` in the title of the issue.
-Valid reported security issues are expected to be solved within a week.

+ 0 - 1
vendor/github.com/emicklei/go-restful/v3/Srcfile

@@ -1 +0,0 @@
-{"SkipDirs": ["examples"]}

+ 0 - 10
vendor/github.com/emicklei/go-restful/v3/bench_test.sh

@@ -1,10 +0,0 @@
-#go test -run=none -file bench_test.go -test.bench . -cpuprofile=bench_test.out
-
-go test -c
-./go-restful.test -test.run=none -test.cpuprofile=tmp.prof -test.bench=BenchmarkMany
-./go-restful.test -test.run=none -test.cpuprofile=curly.prof -test.bench=BenchmarkManyCurly
-
-#go tool pprof go-restful.test tmp.prof
-go tool pprof go-restful.test curly.prof
-
-

+ 0 - 127
vendor/github.com/emicklei/go-restful/v3/compress.go

@@ -1,127 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"bufio"
-	"compress/gzip"
-	"compress/zlib"
-	"errors"
-	"io"
-	"net"
-	"net/http"
-	"strings"
-)
-
-// OBSOLETE : use restful.DefaultContainer.EnableContentEncoding(true) to change this setting.
-var EnableContentEncoding = false
-
-// CompressingResponseWriter is a http.ResponseWriter that can perform content encoding (gzip and zlib)
-type CompressingResponseWriter struct {
-	writer     http.ResponseWriter
-	compressor io.WriteCloser
-	encoding   string
-}
-
-// Header is part of http.ResponseWriter interface
-func (c *CompressingResponseWriter) Header() http.Header {
-	return c.writer.Header()
-}
-
-// WriteHeader is part of http.ResponseWriter interface
-func (c *CompressingResponseWriter) WriteHeader(status int) {
-	c.writer.WriteHeader(status)
-}
-
-// Write is part of http.ResponseWriter interface
-// It is passed through the compressor
-func (c *CompressingResponseWriter) Write(bytes []byte) (int, error) {
-	if c.isCompressorClosed() {
-		return -1, errors.New("Compressing error: tried to write data using closed compressor")
-	}
-	return c.compressor.Write(bytes)
-}
-
-// CloseNotify is part of http.CloseNotifier interface
-func (c *CompressingResponseWriter) CloseNotify() <-chan bool {
-	return c.writer.(http.CloseNotifier).CloseNotify()
-}
-
-// Close the underlying compressor
-func (c *CompressingResponseWriter) Close() error {
-	if c.isCompressorClosed() {
-		return errors.New("Compressing error: tried to close already closed compressor")
-	}
-
-	c.compressor.Close()
-	if ENCODING_GZIP == c.encoding {
-		currentCompressorProvider.ReleaseGzipWriter(c.compressor.(*gzip.Writer))
-	}
-	if ENCODING_DEFLATE == c.encoding {
-		currentCompressorProvider.ReleaseZlibWriter(c.compressor.(*zlib.Writer))
-	}
-	// gc hint needed?
-	c.compressor = nil
-	return nil
-}
-
-func (c *CompressingResponseWriter) isCompressorClosed() bool {
-	return nil == c.compressor
-}
-
-// Hijack implements the Hijacker interface
-// This is especially useful when combining Container.EnabledContentEncoding
-// in combination with websockets (for instance gorilla/websocket)
-func (c *CompressingResponseWriter) Hijack() (net.Conn, *bufio.ReadWriter, error) {
-	hijacker, ok := c.writer.(http.Hijacker)
-	if !ok {
-		return nil, nil, errors.New("ResponseWriter doesn't support Hijacker interface")
-	}
-	return hijacker.Hijack()
-}
-
-// WantsCompressedResponse reads the Accept-Encoding header to see if and which encoding is requested.
-// It also inspects the httpWriter whether its content-encoding is already set (non-empty).
-func wantsCompressedResponse(httpRequest *http.Request, httpWriter http.ResponseWriter) (bool, string) {
-	if contentEncoding := httpWriter.Header().Get(HEADER_ContentEncoding); contentEncoding != "" {
-		return false, ""
-	}
-	header := httpRequest.Header.Get(HEADER_AcceptEncoding)
-	gi := strings.Index(header, ENCODING_GZIP)
-	zi := strings.Index(header, ENCODING_DEFLATE)
-	// use in order of appearance
-	if gi == -1 {
-		return zi != -1, ENCODING_DEFLATE
-	} else if zi == -1 {
-		return gi != -1, ENCODING_GZIP
-	} else {
-		if gi < zi {
-			return true, ENCODING_GZIP
-		}
-		return true, ENCODING_DEFLATE
-	}
-}
-
-// NewCompressingResponseWriter create a CompressingResponseWriter for a known encoding = {gzip,deflate}
-func NewCompressingResponseWriter(httpWriter http.ResponseWriter, encoding string) (*CompressingResponseWriter, error) {
-	httpWriter.Header().Set(HEADER_ContentEncoding, encoding)
-	c := new(CompressingResponseWriter)
-	c.writer = httpWriter
-	var err error
-	if ENCODING_GZIP == encoding {
-		w := currentCompressorProvider.AcquireGzipWriter()
-		w.Reset(httpWriter)
-		c.compressor = w
-		c.encoding = ENCODING_GZIP
-	} else if ENCODING_DEFLATE == encoding {
-		w := currentCompressorProvider.AcquireZlibWriter()
-		w.Reset(httpWriter)
-		c.compressor = w
-		c.encoding = ENCODING_DEFLATE
-	} else {
-		return nil, errors.New("Unknown encoding:" + encoding)
-	}
-	return c, err
-}

+ 0 - 103
vendor/github.com/emicklei/go-restful/v3/compressor_cache.go

@@ -1,103 +0,0 @@
-package restful
-
-// Copyright 2015 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"compress/gzip"
-	"compress/zlib"
-)
-
-// BoundedCachedCompressors is a CompressorProvider that uses a cache with a fixed amount
-// of writers and readers (resources).
-// If a new resource is acquired and all are in use, it will return a new unmanaged resource.
-type BoundedCachedCompressors struct {
-	gzipWriters     chan *gzip.Writer
-	gzipReaders     chan *gzip.Reader
-	zlibWriters     chan *zlib.Writer
-	writersCapacity int
-	readersCapacity int
-}
-
-// NewBoundedCachedCompressors returns a new, with filled cache,  BoundedCachedCompressors.
-func NewBoundedCachedCompressors(writersCapacity, readersCapacity int) *BoundedCachedCompressors {
-	b := &BoundedCachedCompressors{
-		gzipWriters:     make(chan *gzip.Writer, writersCapacity),
-		gzipReaders:     make(chan *gzip.Reader, readersCapacity),
-		zlibWriters:     make(chan *zlib.Writer, writersCapacity),
-		writersCapacity: writersCapacity,
-		readersCapacity: readersCapacity,
-	}
-	for ix := 0; ix < writersCapacity; ix++ {
-		b.gzipWriters <- newGzipWriter()
-		b.zlibWriters <- newZlibWriter()
-	}
-	for ix := 0; ix < readersCapacity; ix++ {
-		b.gzipReaders <- newGzipReader()
-	}
-	return b
-}
-
-// AcquireGzipWriter returns an resettable *gzip.Writer. Needs to be released.
-func (b *BoundedCachedCompressors) AcquireGzipWriter() *gzip.Writer {
-	var writer *gzip.Writer
-	select {
-	case writer, _ = <-b.gzipWriters:
-	default:
-		// return a new unmanaged one
-		writer = newGzipWriter()
-	}
-	return writer
-}
-
-// ReleaseGzipWriter accepts a writer (does not have to be one that was cached)
-// only when the cache has room for it. It will ignore it otherwise.
-func (b *BoundedCachedCompressors) ReleaseGzipWriter(w *gzip.Writer) {
-	// forget the unmanaged ones
-	if len(b.gzipWriters) < b.writersCapacity {
-		b.gzipWriters <- w
-	}
-}
-
-// AcquireGzipReader returns a *gzip.Reader. Needs to be released.
-func (b *BoundedCachedCompressors) AcquireGzipReader() *gzip.Reader {
-	var reader *gzip.Reader
-	select {
-	case reader, _ = <-b.gzipReaders:
-	default:
-		// return a new unmanaged one
-		reader = newGzipReader()
-	}
-	return reader
-}
-
-// ReleaseGzipReader accepts a reader (does not have to be one that was cached)
-// only when the cache has room for it. It will ignore it otherwise.
-func (b *BoundedCachedCompressors) ReleaseGzipReader(r *gzip.Reader) {
-	// forget the unmanaged ones
-	if len(b.gzipReaders) < b.readersCapacity {
-		b.gzipReaders <- r
-	}
-}
-
-// AcquireZlibWriter returns an resettable *zlib.Writer. Needs to be released.
-func (b *BoundedCachedCompressors) AcquireZlibWriter() *zlib.Writer {
-	var writer *zlib.Writer
-	select {
-	case writer, _ = <-b.zlibWriters:
-	default:
-		// return a new unmanaged one
-		writer = newZlibWriter()
-	}
-	return writer
-}
-
-// ReleaseZlibWriter accepts a writer (does not have to be one that was cached)
-// only when the cache has room for it. It will ignore it otherwise.
-func (b *BoundedCachedCompressors) ReleaseZlibWriter(w *zlib.Writer) {
-	// forget the unmanaged ones
-	if len(b.zlibWriters) < b.writersCapacity {
-		b.zlibWriters <- w
-	}
-}

+ 0 - 91
vendor/github.com/emicklei/go-restful/v3/compressor_pools.go

@@ -1,91 +0,0 @@
-package restful
-
-// Copyright 2015 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"bytes"
-	"compress/gzip"
-	"compress/zlib"
-	"sync"
-)
-
-// SyncPoolCompessors is a CompressorProvider that use the standard sync.Pool.
-type SyncPoolCompessors struct {
-	GzipWriterPool *sync.Pool
-	GzipReaderPool *sync.Pool
-	ZlibWriterPool *sync.Pool
-}
-
-// NewSyncPoolCompessors returns a new ("empty") SyncPoolCompessors.
-func NewSyncPoolCompessors() *SyncPoolCompessors {
-	return &SyncPoolCompessors{
-		GzipWriterPool: &sync.Pool{
-			New: func() interface{} { return newGzipWriter() },
-		},
-		GzipReaderPool: &sync.Pool{
-			New: func() interface{} { return newGzipReader() },
-		},
-		ZlibWriterPool: &sync.Pool{
-			New: func() interface{} { return newZlibWriter() },
-		},
-	}
-}
-
-func (s *SyncPoolCompessors) AcquireGzipWriter() *gzip.Writer {
-	return s.GzipWriterPool.Get().(*gzip.Writer)
-}
-
-func (s *SyncPoolCompessors) ReleaseGzipWriter(w *gzip.Writer) {
-	s.GzipWriterPool.Put(w)
-}
-
-func (s *SyncPoolCompessors) AcquireGzipReader() *gzip.Reader {
-	return s.GzipReaderPool.Get().(*gzip.Reader)
-}
-
-func (s *SyncPoolCompessors) ReleaseGzipReader(r *gzip.Reader) {
-	s.GzipReaderPool.Put(r)
-}
-
-func (s *SyncPoolCompessors) AcquireZlibWriter() *zlib.Writer {
-	return s.ZlibWriterPool.Get().(*zlib.Writer)
-}
-
-func (s *SyncPoolCompessors) ReleaseZlibWriter(w *zlib.Writer) {
-	s.ZlibWriterPool.Put(w)
-}
-
-func newGzipWriter() *gzip.Writer {
-	// create with an empty bytes writer; it will be replaced before using the gzipWriter
-	writer, err := gzip.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed)
-	if err != nil {
-		panic(err.Error())
-	}
-	return writer
-}
-
-func newGzipReader() *gzip.Reader {
-	// create with an empty reader (but with GZIP header); it will be replaced before using the gzipReader
-	// we can safely use currentCompressProvider because it is set on package initialization.
-	w := currentCompressorProvider.AcquireGzipWriter()
-	defer currentCompressorProvider.ReleaseGzipWriter(w)
-	b := new(bytes.Buffer)
-	w.Reset(b)
-	w.Flush()
-	w.Close()
-	reader, err := gzip.NewReader(bytes.NewReader(b.Bytes()))
-	if err != nil {
-		panic(err.Error())
-	}
-	return reader
-}
-
-func newZlibWriter() *zlib.Writer {
-	writer, err := zlib.NewWriterLevel(new(bytes.Buffer), gzip.BestSpeed)
-	if err != nil {
-		panic(err.Error())
-	}
-	return writer
-}

+ 0 - 54
vendor/github.com/emicklei/go-restful/v3/compressors.go

@@ -1,54 +0,0 @@
-package restful
-
-// Copyright 2015 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"compress/gzip"
-	"compress/zlib"
-)
-
-// CompressorProvider describes a component that can provider compressors for the std methods.
-type CompressorProvider interface {
-	// Returns a *gzip.Writer which needs to be released later.
-	// Before using it, call Reset().
-	AcquireGzipWriter() *gzip.Writer
-
-	// Releases an acquired *gzip.Writer.
-	ReleaseGzipWriter(w *gzip.Writer)
-
-	// Returns a *gzip.Reader which needs to be released later.
-	AcquireGzipReader() *gzip.Reader
-
-	// Releases an acquired *gzip.Reader.
-	ReleaseGzipReader(w *gzip.Reader)
-
-	// Returns a *zlib.Writer which needs to be released later.
-	// Before using it, call Reset().
-	AcquireZlibWriter() *zlib.Writer
-
-	// Releases an acquired *zlib.Writer.
-	ReleaseZlibWriter(w *zlib.Writer)
-}
-
-// DefaultCompressorProvider is the actual provider of compressors (zlib or gzip).
-var currentCompressorProvider CompressorProvider
-
-func init() {
-	currentCompressorProvider = NewSyncPoolCompessors()
-}
-
-// CurrentCompressorProvider returns the current CompressorProvider.
-// It is initialized using a SyncPoolCompessors.
-func CurrentCompressorProvider() CompressorProvider {
-	return currentCompressorProvider
-}
-
-// SetCompressorProvider sets the actual provider of compressors (zlib or gzip).
-func SetCompressorProvider(p CompressorProvider) {
-	if p == nil {
-		panic("cannot set compressor provider to nil")
-	}
-	currentCompressorProvider = p
-}

+ 0 - 30
vendor/github.com/emicklei/go-restful/v3/constants.go

@@ -1,30 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-const (
-	MIME_XML   = "application/xml"          // Accept or Content-Type used in Consumes() and/or Produces()
-	MIME_JSON  = "application/json"         // Accept or Content-Type used in Consumes() and/or Produces()
-	MIME_OCTET = "application/octet-stream" // If Content-Type is not present in request, use the default
-
-	HEADER_Allow                         = "Allow"
-	HEADER_Accept                        = "Accept"
-	HEADER_Origin                        = "Origin"
-	HEADER_ContentType                   = "Content-Type"
-	HEADER_LastModified                  = "Last-Modified"
-	HEADER_AcceptEncoding                = "Accept-Encoding"
-	HEADER_ContentEncoding               = "Content-Encoding"
-	HEADER_AccessControlExposeHeaders    = "Access-Control-Expose-Headers"
-	HEADER_AccessControlRequestMethod    = "Access-Control-Request-Method"
-	HEADER_AccessControlRequestHeaders   = "Access-Control-Request-Headers"
-	HEADER_AccessControlAllowMethods     = "Access-Control-Allow-Methods"
-	HEADER_AccessControlAllowOrigin      = "Access-Control-Allow-Origin"
-	HEADER_AccessControlAllowCredentials = "Access-Control-Allow-Credentials"
-	HEADER_AccessControlAllowHeaders     = "Access-Control-Allow-Headers"
-	HEADER_AccessControlMaxAge           = "Access-Control-Max-Age"
-
-	ENCODING_GZIP    = "gzip"
-	ENCODING_DEFLATE = "deflate"
-)

+ 0 - 450
vendor/github.com/emicklei/go-restful/v3/container.go

@@ -1,450 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"bytes"
-	"errors"
-	"fmt"
-	"net/http"
-	"os"
-	"runtime"
-	"strings"
-	"sync"
-
-	"github.com/emicklei/go-restful/v3/log"
-)
-
-// Container holds a collection of WebServices and a http.ServeMux to dispatch http requests.
-// The requests are further dispatched to routes of WebServices using a RouteSelector
-type Container struct {
-	webServicesLock        sync.RWMutex
-	webServices            []*WebService
-	ServeMux               *http.ServeMux
-	isRegisteredOnRoot     bool
-	containerFilters       []FilterFunction
-	doNotRecover           bool // default is true
-	recoverHandleFunc      RecoverHandleFunction
-	serviceErrorHandleFunc ServiceErrorHandleFunction
-	router                 RouteSelector // default is a CurlyRouter (RouterJSR311 is a slower alternative)
-	contentEncodingEnabled bool          // default is false
-}
-
-// NewContainer creates a new Container using a new ServeMux and default router (CurlyRouter)
-func NewContainer() *Container {
-	return &Container{
-		webServices:            []*WebService{},
-		ServeMux:               http.NewServeMux(),
-		isRegisteredOnRoot:     false,
-		containerFilters:       []FilterFunction{},
-		doNotRecover:           true,
-		recoverHandleFunc:      logStackOnRecover,
-		serviceErrorHandleFunc: writeServiceError,
-		router:                 CurlyRouter{},
-		contentEncodingEnabled: false}
-}
-
-// RecoverHandleFunction declares functions that can be used to handle a panic situation.
-// The first argument is what recover() returns. The second must be used to communicate an error response.
-type RecoverHandleFunction func(interface{}, http.ResponseWriter)
-
-// RecoverHandler changes the default function (logStackOnRecover) to be called
-// when a panic is detected. DoNotRecover must be have its default value (=false).
-func (c *Container) RecoverHandler(handler RecoverHandleFunction) {
-	c.recoverHandleFunc = handler
-}
-
-// ServiceErrorHandleFunction declares functions that can be used to handle a service error situation.
-// The first argument is the service error, the second is the request that resulted in the error and
-// the third must be used to communicate an error response.
-type ServiceErrorHandleFunction func(ServiceError, *Request, *Response)
-
-// ServiceErrorHandler changes the default function (writeServiceError) to be called
-// when a ServiceError is detected.
-func (c *Container) ServiceErrorHandler(handler ServiceErrorHandleFunction) {
-	c.serviceErrorHandleFunc = handler
-}
-
-// DoNotRecover controls whether panics will be caught to return HTTP 500.
-// If set to true, Route functions are responsible for handling any error situation.
-// Default value is true.
-func (c *Container) DoNotRecover(doNot bool) {
-	c.doNotRecover = doNot
-}
-
-// Router changes the default Router (currently CurlyRouter)
-func (c *Container) Router(aRouter RouteSelector) {
-	c.router = aRouter
-}
-
-// EnableContentEncoding (default=false) allows for GZIP or DEFLATE encoding of responses.
-func (c *Container) EnableContentEncoding(enabled bool) {
-	c.contentEncodingEnabled = enabled
-}
-
-// Add a WebService to the Container. It will detect duplicate root paths and exit in that case.
-func (c *Container) Add(service *WebService) *Container {
-	c.webServicesLock.Lock()
-	defer c.webServicesLock.Unlock()
-
-	// if rootPath was not set then lazy initialize it
-	if len(service.rootPath) == 0 {
-		service.Path("/")
-	}
-
-	// cannot have duplicate root paths
-	for _, each := range c.webServices {
-		if each.RootPath() == service.RootPath() {
-			log.Printf("WebService with duplicate root path detected:['%v']", each)
-			os.Exit(1)
-		}
-	}
-
-	// If not registered on root then add specific mapping
-	if !c.isRegisteredOnRoot {
-		c.isRegisteredOnRoot = c.addHandler(service, c.ServeMux)
-	}
-	c.webServices = append(c.webServices, service)
-	return c
-}
-
-// addHandler may set a new HandleFunc for the serveMux
-// this function must run inside the critical region protected by the webServicesLock.
-// returns true if the function was registered on root ("/")
-func (c *Container) addHandler(service *WebService, serveMux *http.ServeMux) bool {
-	pattern := fixedPrefixPath(service.RootPath())
-	// check if root path registration is needed
-	if "/" == pattern || "" == pattern {
-		serveMux.HandleFunc("/", c.dispatch)
-		return true
-	}
-	// detect if registration already exists
-	alreadyMapped := false
-	for _, each := range c.webServices {
-		if each.RootPath() == service.RootPath() {
-			alreadyMapped = true
-			break
-		}
-	}
-	if !alreadyMapped {
-		serveMux.HandleFunc(pattern, c.dispatch)
-		if !strings.HasSuffix(pattern, "/") {
-			serveMux.HandleFunc(pattern+"/", c.dispatch)
-		}
-	}
-	return false
-}
-
-func (c *Container) Remove(ws *WebService) error {
-	if c.ServeMux == http.DefaultServeMux {
-		errMsg := fmt.Sprintf("cannot remove a WebService from a Container using the DefaultServeMux: ['%v']", ws)
-		log.Print(errMsg)
-		return errors.New(errMsg)
-	}
-	c.webServicesLock.Lock()
-	defer c.webServicesLock.Unlock()
-	// build a new ServeMux and re-register all WebServices
-	newServeMux := http.NewServeMux()
-	newServices := []*WebService{}
-	newIsRegisteredOnRoot := false
-	for _, each := range c.webServices {
-		if each.rootPath != ws.rootPath {
-			// If not registered on root then add specific mapping
-			if !newIsRegisteredOnRoot {
-				newIsRegisteredOnRoot = c.addHandler(each, newServeMux)
-			}
-			newServices = append(newServices, each)
-		}
-	}
-	c.webServices, c.ServeMux, c.isRegisteredOnRoot = newServices, newServeMux, newIsRegisteredOnRoot
-	return nil
-}
-
-// logStackOnRecover is the default RecoverHandleFunction and is called
-// when DoNotRecover is false and the recoverHandleFunc is not set for the container.
-// Default implementation logs the stacktrace and writes the stacktrace on the response.
-// This may be a security issue as it exposes sourcecode information.
-func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter) {
-	var buffer bytes.Buffer
-	buffer.WriteString(fmt.Sprintf("recover from panic situation: - %v\r\n", panicReason))
-	for i := 2; ; i += 1 {
-		_, file, line, ok := runtime.Caller(i)
-		if !ok {
-			break
-		}
-		buffer.WriteString(fmt.Sprintf("    %s:%d\r\n", file, line))
-	}
-	log.Print(buffer.String())
-	httpWriter.WriteHeader(http.StatusInternalServerError)
-	httpWriter.Write(buffer.Bytes())
-}
-
-// writeServiceError is the default ServiceErrorHandleFunction and is called
-// when a ServiceError is returned during route selection. Default implementation
-// calls resp.WriteErrorString(err.Code, err.Message)
-func writeServiceError(err ServiceError, req *Request, resp *Response) {
-	for header, values := range err.Header {
-		for _, value := range values {
-			resp.Header().Add(header, value)
-		}
-	}
-	resp.WriteErrorString(err.Code, err.Message)
-}
-
-// Dispatch the incoming Http Request to a matching WebService.
-func (c *Container) Dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) {
-	if httpWriter == nil {
-		panic("httpWriter cannot be nil")
-	}
-	if httpRequest == nil {
-		panic("httpRequest cannot be nil")
-	}
-	c.dispatch(httpWriter, httpRequest)
-}
-
-// Dispatch the incoming Http Request to a matching WebService.
-func (c *Container) dispatch(httpWriter http.ResponseWriter, httpRequest *http.Request) {
-	// so we can assign a compressing one later
-	writer := httpWriter
-
-	// CompressingResponseWriter should be closed after all operations are done
-	defer func() {
-		if compressWriter, ok := writer.(*CompressingResponseWriter); ok {
-			compressWriter.Close()
-		}
-	}()
-
-	// Instal panic recovery unless told otherwise
-	if !c.doNotRecover { // catch all for 500 response
-		defer func() {
-			if r := recover(); r != nil {
-				c.recoverHandleFunc(r, writer)
-				return
-			}
-		}()
-	}
-
-	// Find best match Route ; err is non nil if no match was found
-	var webService *WebService
-	var route *Route
-	var err error
-	func() {
-		c.webServicesLock.RLock()
-		defer c.webServicesLock.RUnlock()
-		webService, route, err = c.router.SelectRoute(
-			c.webServices,
-			httpRequest)
-	}()
-	if err != nil {
-		// a non-200 response (may be compressed) has already been written
-		// run container filters anyway ; they should not touch the response...
-		chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) {
-			switch err.(type) {
-			case ServiceError:
-				ser := err.(ServiceError)
-				c.serviceErrorHandleFunc(ser, req, resp)
-			}
-			// TODO
-		}}
-		chain.ProcessFilter(NewRequest(httpRequest), NewResponse(writer))
-		return
-	}
-
-	// Unless httpWriter is already an CompressingResponseWriter see if we need to install one
-	if _, isCompressing := httpWriter.(*CompressingResponseWriter); !isCompressing {
-		// Detect if compression is needed
-		// assume without compression, test for override
-		contentEncodingEnabled := c.contentEncodingEnabled
-		if route != nil && route.contentEncodingEnabled != nil {
-			contentEncodingEnabled = *route.contentEncodingEnabled
-		}
-		if contentEncodingEnabled {
-			doCompress, encoding := wantsCompressedResponse(httpRequest, httpWriter)
-			if doCompress {
-				var err error
-				writer, err = NewCompressingResponseWriter(httpWriter, encoding)
-				if err != nil {
-					log.Print("unable to install compressor: ", err)
-					httpWriter.WriteHeader(http.StatusInternalServerError)
-					return
-				}
-			}
-		}
-	}
-
-	pathProcessor, routerProcessesPath := c.router.(PathProcessor)
-	if !routerProcessesPath {
-		pathProcessor = defaultPathProcessor{}
-	}
-	pathParams := pathProcessor.ExtractParameters(route, webService, httpRequest.URL.Path)
-	wrappedRequest, wrappedResponse := route.wrapRequestResponse(writer, httpRequest, pathParams)
-	// pass through filters (if any)
-	if size := len(c.containerFilters) + len(webService.filters) + len(route.Filters); size > 0 {
-		// compose filter chain
-		allFilters := make([]FilterFunction, 0, size)
-		allFilters = append(allFilters, c.containerFilters...)
-		allFilters = append(allFilters, webService.filters...)
-		allFilters = append(allFilters, route.Filters...)
-		chain := FilterChain{
-			Filters:       allFilters,
-			Target:        route.Function,
-			ParameterDocs: route.ParameterDocs,
-			Operation:     route.Operation,
-		}
-		chain.ProcessFilter(wrappedRequest, wrappedResponse)
-	} else {
-		// no filters, handle request by route
-		route.Function(wrappedRequest, wrappedResponse)
-	}
-}
-
-// fixedPrefixPath returns the fixed part of the partspec ; it may include template vars {}
-func fixedPrefixPath(pathspec string) string {
-	varBegin := strings.Index(pathspec, "{")
-	if -1 == varBegin {
-		return pathspec
-	}
-	return pathspec[:varBegin]
-}
-
-// ServeHTTP implements net/http.Handler therefore a Container can be a Handler in a http.Server
-func (c *Container) ServeHTTP(httpWriter http.ResponseWriter, httpRequest *http.Request) {
-	// Skip, if content encoding is disabled
-	if !c.contentEncodingEnabled {
-		c.ServeMux.ServeHTTP(httpWriter, httpRequest)
-		return
-	}
-	// content encoding is enabled
-
-	// Skip, if httpWriter is already an CompressingResponseWriter
-	if _, ok := httpWriter.(*CompressingResponseWriter); ok {
-		c.ServeMux.ServeHTTP(httpWriter, httpRequest)
-		return
-	}
-
-	writer := httpWriter
-	// CompressingResponseWriter should be closed after all operations are done
-	defer func() {
-		if compressWriter, ok := writer.(*CompressingResponseWriter); ok {
-			compressWriter.Close()
-		}
-	}()
-
-	doCompress, encoding := wantsCompressedResponse(httpRequest, httpWriter)
-	if doCompress {
-		var err error
-		writer, err = NewCompressingResponseWriter(httpWriter, encoding)
-		if err != nil {
-			log.Print("unable to install compressor: ", err)
-			httpWriter.WriteHeader(http.StatusInternalServerError)
-			return
-		}
-	}
-
-	c.ServeMux.ServeHTTP(writer, httpRequest)
-}
-
-// Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics.
-func (c *Container) Handle(pattern string, handler http.Handler) {
-	c.ServeMux.Handle(pattern, http.HandlerFunc(func(httpWriter http.ResponseWriter, httpRequest *http.Request) {
-		// Skip, if httpWriter is already an CompressingResponseWriter
-		if _, ok := httpWriter.(*CompressingResponseWriter); ok {
-			handler.ServeHTTP(httpWriter, httpRequest)
-			return
-		}
-
-		writer := httpWriter
-
-		// CompressingResponseWriter should be closed after all operations are done
-		defer func() {
-			if compressWriter, ok := writer.(*CompressingResponseWriter); ok {
-				compressWriter.Close()
-			}
-		}()
-
-		if c.contentEncodingEnabled {
-			doCompress, encoding := wantsCompressedResponse(httpRequest, httpWriter)
-			if doCompress {
-				var err error
-				writer, err = NewCompressingResponseWriter(httpWriter, encoding)
-				if err != nil {
-					log.Print("unable to install compressor: ", err)
-					httpWriter.WriteHeader(http.StatusInternalServerError)
-					return
-				}
-			}
-		}
-
-		handler.ServeHTTP(writer, httpRequest)
-	}))
-}
-
-// HandleWithFilter registers the handler for the given pattern.
-// Container's filter chain is applied for handler.
-// If a handler already exists for pattern, HandleWithFilter panics.
-func (c *Container) HandleWithFilter(pattern string, handler http.Handler) {
-	f := func(httpResponse http.ResponseWriter, httpRequest *http.Request) {
-		if len(c.containerFilters) == 0 {
-			handler.ServeHTTP(httpResponse, httpRequest)
-			return
-		}
-
-		chain := FilterChain{Filters: c.containerFilters, Target: func(req *Request, resp *Response) {
-			handler.ServeHTTP(resp, req.Request)
-		}}
-		chain.ProcessFilter(NewRequest(httpRequest), NewResponse(httpResponse))
-	}
-
-	c.Handle(pattern, http.HandlerFunc(f))
-}
-
-// Filter appends a container FilterFunction. These are called before dispatching
-// a http.Request to a WebService from the container
-func (c *Container) Filter(filter FilterFunction) {
-	c.containerFilters = append(c.containerFilters, filter)
-}
-
-// RegisteredWebServices returns the collections of added WebServices
-func (c *Container) RegisteredWebServices() []*WebService {
-	c.webServicesLock.RLock()
-	defer c.webServicesLock.RUnlock()
-	result := make([]*WebService, len(c.webServices))
-	for ix := range c.webServices {
-		result[ix] = c.webServices[ix]
-	}
-	return result
-}
-
-// computeAllowedMethods returns a list of HTTP methods that are valid for a Request
-func (c *Container) computeAllowedMethods(req *Request) []string {
-	// Go through all RegisteredWebServices() and all its Routes to collect the options
-	methods := []string{}
-	requestPath := req.Request.URL.Path
-	for _, ws := range c.RegisteredWebServices() {
-		matches := ws.pathExpr.Matcher.FindStringSubmatch(requestPath)
-		if matches != nil {
-			finalMatch := matches[len(matches)-1]
-			for _, rt := range ws.Routes() {
-				matches := rt.pathExpr.Matcher.FindStringSubmatch(finalMatch)
-				if matches != nil {
-					lastMatch := matches[len(matches)-1]
-					if lastMatch == "" || lastMatch == "/" { // do not include if value is neither empty nor ‘/’.
-						methods = append(methods, rt.Method)
-					}
-				}
-			}
-		}
-	}
-	// methods = append(methods, "OPTIONS")  not sure about this
-	return methods
-}
-
-// newBasicRequestResponse creates a pair of Request,Response from its http versions.
-// It is basic because no parameter or (produces) content-type information is given.
-func newBasicRequestResponse(httpWriter http.ResponseWriter, httpRequest *http.Request) (*Request, *Response) {
-	resp := NewResponse(httpWriter)
-	resp.requestAccept = httpRequest.Header.Get(HEADER_Accept)
-	return NewRequest(httpRequest), resp
-}

+ 0 - 193
vendor/github.com/emicklei/go-restful/v3/cors_filter.go

@@ -1,193 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"regexp"
-	"strconv"
-	"strings"
-)
-
-// CrossOriginResourceSharing is used to create a Container Filter that implements CORS.
-// Cross-origin resource sharing (CORS) is a mechanism that allows JavaScript on a web page
-// to make XMLHttpRequests to another domain, not the domain the JavaScript originated from.
-//
-// http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
-// http://enable-cors.org/server.html
-// http://www.html5rocks.com/en/tutorials/cors/#toc-handling-a-not-so-simple-request
-type CrossOriginResourceSharing struct {
-	ExposeHeaders []string // list of Header names
-
-	// AllowedHeaders is alist of Header names. Checking is case-insensitive.
-	// The list may contain the special wildcard string ".*" ; all is allowed
-	AllowedHeaders []string
-
-	// AllowedDomains is a list of allowed values for Http Origin.
-	// The list may contain the special wildcard string ".*" ; all is allowed
-	// If empty all are allowed.
-	AllowedDomains []string
-
-	// AllowedDomainFunc is optional and is a function that will do the check
-	// when the origin is not part of the AllowedDomains and it does not contain the wildcard ".*".
-	AllowedDomainFunc func(origin string) bool
-
-	// AllowedMethods is either empty or has a list of http methods names. Checking is case-insensitive.
-	AllowedMethods []string
-	MaxAge         int // number of seconds before requiring new Options request
-	CookiesAllowed bool
-	Container      *Container
-
-	allowedOriginPatterns []*regexp.Regexp // internal field for origin regexp check.
-}
-
-// Filter is a filter function that implements the CORS flow as documented on http://enable-cors.org/server.html
-// and http://www.html5rocks.com/static/images/cors_server_flowchart.png
-func (c CrossOriginResourceSharing) Filter(req *Request, resp *Response, chain *FilterChain) {
-	origin := req.Request.Header.Get(HEADER_Origin)
-	if len(origin) == 0 {
-		if trace {
-			traceLogger.Print("no Http header Origin set")
-		}
-		chain.ProcessFilter(req, resp)
-		return
-	}
-	if !c.isOriginAllowed(origin) { // check whether this origin is allowed
-		if trace {
-			traceLogger.Printf("HTTP Origin:%s is not part of %v, neither matches any part of %v", origin, c.AllowedDomains, c.allowedOriginPatterns)
-		}
-		chain.ProcessFilter(req, resp)
-		return
-	}
-	if req.Request.Method != "OPTIONS" {
-		c.doActualRequest(req, resp)
-		chain.ProcessFilter(req, resp)
-		return
-	}
-	if acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod); acrm != "" {
-		c.doPreflightRequest(req, resp)
-	} else {
-		c.doActualRequest(req, resp)
-		chain.ProcessFilter(req, resp)
-		return
-	}
-}
-
-func (c CrossOriginResourceSharing) doActualRequest(req *Request, resp *Response) {
-	c.setOptionsHeaders(req, resp)
-	// continue processing the response
-}
-
-func (c *CrossOriginResourceSharing) doPreflightRequest(req *Request, resp *Response) {
-	if len(c.AllowedMethods) == 0 {
-		if c.Container == nil {
-			c.AllowedMethods = DefaultContainer.computeAllowedMethods(req)
-		} else {
-			c.AllowedMethods = c.Container.computeAllowedMethods(req)
-		}
-	}
-
-	acrm := req.Request.Header.Get(HEADER_AccessControlRequestMethod)
-	if !c.isValidAccessControlRequestMethod(acrm, c.AllowedMethods) {
-		if trace {
-			traceLogger.Printf("Http header %s:%s is not in %v",
-				HEADER_AccessControlRequestMethod,
-				acrm,
-				c.AllowedMethods)
-		}
-		return
-	}
-	acrhs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders)
-	if len(acrhs) > 0 {
-		for _, each := range strings.Split(acrhs, ",") {
-			if !c.isValidAccessControlRequestHeader(strings.Trim(each, " ")) {
-				if trace {
-					traceLogger.Printf("Http header %s:%s is not in %v",
-						HEADER_AccessControlRequestHeaders,
-						acrhs,
-						c.AllowedHeaders)
-				}
-				return
-			}
-		}
-	}
-	resp.AddHeader(HEADER_AccessControlAllowMethods, strings.Join(c.AllowedMethods, ","))
-	resp.AddHeader(HEADER_AccessControlAllowHeaders, acrhs)
-	c.setOptionsHeaders(req, resp)
-
-	// return http 200 response, no body
-}
-
-func (c CrossOriginResourceSharing) setOptionsHeaders(req *Request, resp *Response) {
-	c.checkAndSetExposeHeaders(resp)
-	c.setAllowOriginHeader(req, resp)
-	c.checkAndSetAllowCredentials(resp)
-	if c.MaxAge > 0 {
-		resp.AddHeader(HEADER_AccessControlMaxAge, strconv.Itoa(c.MaxAge))
-	}
-}
-
-func (c CrossOriginResourceSharing) isOriginAllowed(origin string) bool {
-	if len(origin) == 0 {
-		return false
-	}
-	lowerOrigin := strings.ToLower(origin)
-	if len(c.AllowedDomains) == 0 {
-		if c.AllowedDomainFunc != nil {
-			return c.AllowedDomainFunc(lowerOrigin)
-		}
-		return true
-	}
-
-	// exact match on each allowed domain
-	for _, domain := range c.AllowedDomains {
-		if domain == ".*" || strings.ToLower(domain) == lowerOrigin {
-			return true
-		}
-	}
-	if c.AllowedDomainFunc != nil {
-		return c.AllowedDomainFunc(origin)
-	}
-	return false
-}
-
-func (c CrossOriginResourceSharing) setAllowOriginHeader(req *Request, resp *Response) {
-	origin := req.Request.Header.Get(HEADER_Origin)
-	if c.isOriginAllowed(origin) {
-		resp.AddHeader(HEADER_AccessControlAllowOrigin, origin)
-	}
-}
-
-func (c CrossOriginResourceSharing) checkAndSetExposeHeaders(resp *Response) {
-	if len(c.ExposeHeaders) > 0 {
-		resp.AddHeader(HEADER_AccessControlExposeHeaders, strings.Join(c.ExposeHeaders, ","))
-	}
-}
-
-func (c CrossOriginResourceSharing) checkAndSetAllowCredentials(resp *Response) {
-	if c.CookiesAllowed {
-		resp.AddHeader(HEADER_AccessControlAllowCredentials, "true")
-	}
-}
-
-func (c CrossOriginResourceSharing) isValidAccessControlRequestMethod(method string, allowedMethods []string) bool {
-	for _, each := range allowedMethods {
-		if each == method {
-			return true
-		}
-	}
-	return false
-}
-
-func (c CrossOriginResourceSharing) isValidAccessControlRequestHeader(header string) bool {
-	for _, each := range c.AllowedHeaders {
-		if strings.ToLower(each) == strings.ToLower(header) {
-			return true
-		}
-		if each == "*" {
-			return true
-		}
-	}
-	return false
-}

+ 0 - 2
vendor/github.com/emicklei/go-restful/v3/coverage.sh

@@ -1,2 +0,0 @@
-go test -coverprofile=coverage.out
-go tool cover -html=coverage.out

+ 0 - 173
vendor/github.com/emicklei/go-restful/v3/curly.go

@@ -1,173 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"net/http"
-	"regexp"
-	"sort"
-	"strings"
-)
-
-// CurlyRouter expects Routes with paths that contain zero or more parameters in curly brackets.
-type CurlyRouter struct{}
-
-// SelectRoute is part of the Router interface and returns the best match
-// for the WebService and its Route for the given Request.
-func (c CurlyRouter) SelectRoute(
-	webServices []*WebService,
-	httpRequest *http.Request) (selectedService *WebService, selected *Route, err error) {
-
-	requestTokens := tokenizePath(httpRequest.URL.Path)
-
-	detectedService := c.detectWebService(requestTokens, webServices)
-	if detectedService == nil {
-		if trace {
-			traceLogger.Printf("no WebService was found to match URL path:%s\n", httpRequest.URL.Path)
-		}
-		return nil, nil, NewError(http.StatusNotFound, "404: Page Not Found")
-	}
-	candidateRoutes := c.selectRoutes(detectedService, requestTokens)
-	if len(candidateRoutes) == 0 {
-		if trace {
-			traceLogger.Printf("no Route in WebService with path %s was found to match URL path:%s\n", detectedService.rootPath, httpRequest.URL.Path)
-		}
-		return detectedService, nil, NewError(http.StatusNotFound, "404: Page Not Found")
-	}
-	selectedRoute, err := c.detectRoute(candidateRoutes, httpRequest)
-	if selectedRoute == nil {
-		return detectedService, nil, err
-	}
-	return detectedService, selectedRoute, nil
-}
-
-// selectRoutes return a collection of Route from a WebService that matches the path tokens from the request.
-func (c CurlyRouter) selectRoutes(ws *WebService, requestTokens []string) sortableCurlyRoutes {
-	candidates := make(sortableCurlyRoutes, 0, 8)
-	for _, each := range ws.routes {
-		matches, paramCount, staticCount := c.matchesRouteByPathTokens(each.pathParts, requestTokens, each.hasCustomVerb)
-		if matches {
-			candidates.add(curlyRoute{each, paramCount, staticCount}) // TODO make sure Routes() return pointers?
-		}
-	}
-	sort.Sort(candidates)
-	return candidates
-}
-
-// matchesRouteByPathTokens computes whether it matches, howmany parameters do match and what the number of static path elements are.
-func (c CurlyRouter) matchesRouteByPathTokens(routeTokens, requestTokens []string, routeHasCustomVerb bool) (matches bool, paramCount int, staticCount int) {
-	if len(routeTokens) < len(requestTokens) {
-		// proceed in matching only if last routeToken is wildcard
-		count := len(routeTokens)
-		if count == 0 || !strings.HasSuffix(routeTokens[count-1], "*}") {
-			return false, 0, 0
-		}
-		// proceed
-	}
-	for i, routeToken := range routeTokens {
-		if i == len(requestTokens) {
-			// reached end of request path
-			return false, 0, 0
-		}
-		requestToken := requestTokens[i]
-		if routeHasCustomVerb && hasCustomVerb(routeToken){
-			if !isMatchCustomVerb(routeToken, requestToken) {
-				return false, 0, 0
-			}
-			staticCount++
-			requestToken = removeCustomVerb(requestToken)
-			routeToken = removeCustomVerb(routeToken)
-		}
-
-		if strings.HasPrefix(routeToken, "{") {
-			paramCount++
-			if colon := strings.Index(routeToken, ":"); colon != -1 {
-				// match by regex
-				matchesToken, matchesRemainder := c.regularMatchesPathToken(routeToken, colon, requestToken)
-				if !matchesToken {
-					return false, 0, 0
-				}
-				if matchesRemainder {
-					break
-				}
-			}
-		} else { // no { prefix
-			if requestToken != routeToken {
-				return false, 0, 0
-			}
-			staticCount++
-		}
-	}
-	return true, paramCount, staticCount
-}
-
-// regularMatchesPathToken tests whether the regular expression part of routeToken matches the requestToken or all remaining tokens
-// format routeToken is {someVar:someExpression}, e.g. {zipcode:[\d][\d][\d][\d][A-Z][A-Z]}
-func (c CurlyRouter) regularMatchesPathToken(routeToken string, colon int, requestToken string) (matchesToken bool, matchesRemainder bool) {
-	regPart := routeToken[colon+1 : len(routeToken)-1]
-	if regPart == "*" {
-		if trace {
-			traceLogger.Printf("wildcard parameter detected in route token %s that matches %s\n", routeToken, requestToken)
-		}
-		return true, true
-	}
-	matched, err := regexp.MatchString(regPart, requestToken)
-	return (matched && err == nil), false
-}
-
-var jsr311Router = RouterJSR311{}
-
-// detectRoute selectes from a list of Route the first match by inspecting both the Accept and Content-Type
-// headers of the Request. See also RouterJSR311 in jsr311.go
-func (c CurlyRouter) detectRoute(candidateRoutes sortableCurlyRoutes, httpRequest *http.Request) (*Route, error) {
-	// tracing is done inside detectRoute
-	return jsr311Router.detectRoute(candidateRoutes.routes(), httpRequest)
-}
-
-// detectWebService returns the best matching webService given the list of path tokens.
-// see also computeWebserviceScore
-func (c CurlyRouter) detectWebService(requestTokens []string, webServices []*WebService) *WebService {
-	var best *WebService
-	score := -1
-	for _, each := range webServices {
-		matches, eachScore := c.computeWebserviceScore(requestTokens, each.pathExpr.tokens)
-		if matches && (eachScore > score) {
-			best = each
-			score = eachScore
-		}
-	}
-	return best
-}
-
-// computeWebserviceScore returns whether tokens match and
-// the weighted score of the longest matching consecutive tokens from the beginning.
-func (c CurlyRouter) computeWebserviceScore(requestTokens []string, tokens []string) (bool, int) {
-	if len(tokens) > len(requestTokens) {
-		return false, 0
-	}
-	score := 0
-	for i := 0; i < len(tokens); i++ {
-		each := requestTokens[i]
-		other := tokens[i]
-		if len(each) == 0 && len(other) == 0 {
-			score++
-			continue
-		}
-		if len(other) > 0 && strings.HasPrefix(other, "{") {
-			// no empty match
-			if len(each) == 0 {
-				return false, score
-			}
-			score += 1
-		} else {
-			// not a parameter
-			if each != other {
-				return false, score
-			}
-			score += (len(tokens) - i) * 10 //fuzzy
-		}
-	}
-	return true, score
-}

+ 0 - 54
vendor/github.com/emicklei/go-restful/v3/curly_route.go

@@ -1,54 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-// curlyRoute exits for sorting Routes by the CurlyRouter based on number of parameters and number of static path elements.
-type curlyRoute struct {
-	route       Route
-	paramCount  int
-	staticCount int
-}
-
-// sortableCurlyRoutes orders by most parameters and path elements first.
-type sortableCurlyRoutes []curlyRoute
-
-func (s *sortableCurlyRoutes) add(route curlyRoute) {
-	*s = append(*s, route)
-}
-
-func (s sortableCurlyRoutes) routes() (routes []Route) {
-	routes = make([]Route, 0, len(s))
-	for _, each := range s {
-		routes = append(routes, each.route) // TODO change return type
-	}
-	return routes
-}
-
-func (s sortableCurlyRoutes) Len() int {
-	return len(s)
-}
-func (s sortableCurlyRoutes) Swap(i, j int) {
-	s[i], s[j] = s[j], s[i]
-}
-func (s sortableCurlyRoutes) Less(i, j int) bool {
-	a := s[j]
-	b := s[i]
-
-	// primary key
-	if a.staticCount < b.staticCount {
-		return true
-	}
-	if a.staticCount > b.staticCount {
-		return false
-	}
-	// secundary key
-	if a.paramCount < b.paramCount {
-		return true
-	}
-	if a.paramCount > b.paramCount {
-		return false
-	}
-	return a.route.Path < b.route.Path
-}

+ 0 - 29
vendor/github.com/emicklei/go-restful/v3/custom_verb.go

@@ -1,29 +0,0 @@
-package restful
-
-import (
-	"fmt"
-	"regexp"
-)
-
-var (
-	customVerbReg = regexp.MustCompile(":([A-Za-z]+)$")
-)
-
-func hasCustomVerb(routeToken string) bool {
-	return customVerbReg.MatchString(routeToken)
-}
-
-func isMatchCustomVerb(routeToken string, pathToken string) bool {
-	rs := customVerbReg.FindStringSubmatch(routeToken)
-	if len(rs) < 2 {
-		return false
-	}
-
-	customVerb := rs[1]
-	specificVerbReg := regexp.MustCompile(fmt.Sprintf(":%s$", customVerb))
-	return specificVerbReg.MatchString(pathToken)
-}
-
-func removeCustomVerb(str string) string {
-	return customVerbReg.ReplaceAllString(str, "")
-}

+ 0 - 185
vendor/github.com/emicklei/go-restful/v3/doc.go

@@ -1,185 +0,0 @@
-/*
-Package restful , a lean package for creating REST-style WebServices without magic.
-
-WebServices and Routes
-
-A WebService has a collection of Route objects that dispatch incoming Http Requests to a function calls.
-Typically, a WebService has a root path (e.g. /users) and defines common MIME types for its routes.
-WebServices must be added to a container (see below) in order to handler Http requests from a server.
-
-A Route is defined by a HTTP method, an URL path and (optionally) the MIME types it consumes (Content-Type) and produces (Accept).
-This package has the logic to find the best matching Route and if found, call its Function.
-
-	ws := new(restful.WebService)
-	ws.
-		Path("/users").
-		Consumes(restful.MIME_JSON, restful.MIME_XML).
-		Produces(restful.MIME_JSON, restful.MIME_XML)
-
-	ws.Route(ws.GET("/{user-id}").To(u.findUser))  // u is a UserResource
-
-	...
-
-	// GET http://localhost:8080/users/1
-	func (u UserResource) findUser(request *restful.Request, response *restful.Response) {
-		id := request.PathParameter("user-id")
-		...
-	}
-
-The (*Request, *Response) arguments provide functions for reading information from the request and writing information back to the response.
-
-See the example https://github.com/emicklei/go-restful/blob/v3/examples/user-resource/restful-user-resource.go with a full implementation.
-
-Regular expression matching Routes
-
-A Route parameter can be specified using the format "uri/{var[:regexp]}" or the special version "uri/{var:*}" for matching the tail of the path.
-For example, /persons/{name:[A-Z][A-Z]} can be used to restrict values for the parameter "name" to only contain capital alphabetic characters.
-Regular expressions must use the standard Go syntax as described in the regexp package. (https://code.google.com/p/re2/wiki/Syntax)
-This feature requires the use of a CurlyRouter.
-
-Containers
-
-A Container holds a collection of WebServices, Filters and a http.ServeMux for multiplexing http requests.
-Using the statements "restful.Add(...) and restful.Filter(...)" will register WebServices and Filters to the Default Container.
-The Default container of go-restful uses the http.DefaultServeMux.
-You can create your own Container and create a new http.Server for that particular container.
-
-	container := restful.NewContainer()
-	server := &http.Server{Addr: ":8081", Handler: container}
-
-Filters
-
-A filter dynamically intercepts requests and responses to transform or use the information contained in the requests or responses.
-You can use filters to perform generic logging, measurement, authentication, redirect, set response headers etc.
-In the restful package there are three hooks into the request,response flow where filters can be added.
-Each filter must define a FilterFunction:
-
-	func (req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
-
-Use the following statement to pass the request,response pair to the next filter or RouteFunction
-
-	chain.ProcessFilter(req, resp)
-
-Container Filters
-
-These are processed before any registered WebService.
-
-	// install a (global) filter for the default container (processed before any webservice)
-	restful.Filter(globalLogging)
-
-WebService Filters
-
-These are processed before any Route of a WebService.
-
-	// install a webservice filter (processed before any route)
-	ws.Filter(webserviceLogging).Filter(measureTime)
-
-
-Route Filters
-
-These are processed before calling the function associated with the Route.
-
-	// install 2 chained route filters (processed before calling findUser)
-	ws.Route(ws.GET("/{user-id}").Filter(routeLogging).Filter(NewCountFilter().routeCounter).To(findUser))
-
-See the example https://github.com/emicklei/go-restful/blob/v3/examples/filters/restful-filters.go with full implementations.
-
-Response Encoding
-
-Two encodings are supported: gzip and deflate. To enable this for all responses:
-
-	restful.DefaultContainer.EnableContentEncoding(true)
-
-If a Http request includes the Accept-Encoding header then the response content will be compressed using the specified encoding.
-Alternatively, you can create a Filter that performs the encoding and install it per WebService or Route.
-
-See the example https://github.com/emicklei/go-restful/blob/v3/examples/encoding/restful-encoding-filter.go
-
-OPTIONS support
-
-By installing a pre-defined container filter, your Webservice(s) can respond to the OPTIONS Http request.
-
-	Filter(OPTIONSFilter())
-
-CORS
-
-By installing the filter of a CrossOriginResourceSharing (CORS), your WebService(s) can handle CORS requests.
-
-	cors := CrossOriginResourceSharing{ExposeHeaders: []string{"X-My-Header"}, CookiesAllowed: false, Container: DefaultContainer}
-	Filter(cors.Filter)
-
-Error Handling
-
-Unexpected things happen. If a request cannot be processed because of a failure, your service needs to tell via the response what happened and why.
-For this reason HTTP status codes exist and it is important to use the correct code in every exceptional situation.
-
-	400: Bad Request
-
-If path or query parameters are not valid (content or type) then use http.StatusBadRequest.
-
-	404: Not Found
-
-Despite a valid URI, the resource requested may not be available
-
-	500: Internal Server Error
-
-If the application logic could not process the request (or write the response) then use http.StatusInternalServerError.
-
-	405: Method Not Allowed
-
-The request has a valid URL but the method (GET,PUT,POST,...) is not allowed.
-
-	406: Not Acceptable
-
-The request does not have or has an unknown Accept Header set for this operation.
-
-	415: Unsupported Media Type
-
-The request does not have or has an unknown Content-Type Header set for this operation.
-
-ServiceError
-
-In addition to setting the correct (error) Http status code, you can choose to write a ServiceError message on the response.
-
-Performance options
-
-This package has several options that affect the performance of your service. It is important to understand them and how you can change it.
-
-	restful.DefaultContainer.DoNotRecover(false)
-
-DoNotRecover controls whether panics will be caught to return HTTP 500.
-If set to false, the container will recover from panics.
-Default value is true
-
-	restful.SetCompressorProvider(NewBoundedCachedCompressors(20, 20))
-
-If content encoding is enabled then the default strategy for getting new gzip/zlib writers and readers is to use a sync.Pool.
-Because writers are expensive structures, performance is even more improved when using a preloaded cache. You can also inject your own implementation.
-
-Trouble shooting
-
-This package has the means to produce detail logging of the complete Http request matching process and filter invocation.
-Enabling this feature requires you to set an implementation of restful.StdLogger (e.g. log.Logger) instance such as:
-
-	restful.TraceLogger(log.New(os.Stdout, "[restful] ", log.LstdFlags|log.Lshortfile))
-
-Logging
-
-The restful.SetLogger() method allows you to override the logger used by the package. By default restful
-uses the standard library `log` package and logs to stdout. Different logging packages are supported as
-long as they conform to `StdLogger` interface defined in the `log` sub-package, writing an adapter for your
-preferred package is simple.
-
-Resources
-
-[project]: https://github.com/emicklei/go-restful
-
-[examples]: https://github.com/emicklei/go-restful/blob/master/examples
-
-[design]:  http://ernestmicklei.com/2012/11/11/go-restful-api-design/
-
-[showcases]: https://github.com/emicklei/mora, https://github.com/emicklei/landskape
-
-(c) 2012-2015, http://ernestmicklei.com. MIT License
-*/
-package restful

+ 0 - 162
vendor/github.com/emicklei/go-restful/v3/entity_accessors.go

@@ -1,162 +0,0 @@
-package restful
-
-// Copyright 2015 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"encoding/xml"
-	"strings"
-	"sync"
-)
-
-// EntityReaderWriter can read and write values using an encoding such as JSON,XML.
-type EntityReaderWriter interface {
-	// Read a serialized version of the value from the request.
-	// The Request may have a decompressing reader. Depends on Content-Encoding.
-	Read(req *Request, v interface{}) error
-
-	// Write a serialized version of the value on the response.
-	// The Response may have a compressing writer. Depends on Accept-Encoding.
-	// status should be a valid Http Status code
-	Write(resp *Response, status int, v interface{}) error
-}
-
-// entityAccessRegistry is a singleton
-var entityAccessRegistry = &entityReaderWriters{
-	protection: new(sync.RWMutex),
-	accessors:  map[string]EntityReaderWriter{},
-}
-
-// entityReaderWriters associates MIME to an EntityReaderWriter
-type entityReaderWriters struct {
-	protection *sync.RWMutex
-	accessors  map[string]EntityReaderWriter
-}
-
-func init() {
-	RegisterEntityAccessor(MIME_JSON, NewEntityAccessorJSON(MIME_JSON))
-	RegisterEntityAccessor(MIME_XML, NewEntityAccessorXML(MIME_XML))
-}
-
-// RegisterEntityAccessor add/overrides the ReaderWriter for encoding content with this MIME type.
-func RegisterEntityAccessor(mime string, erw EntityReaderWriter) {
-	entityAccessRegistry.protection.Lock()
-	defer entityAccessRegistry.protection.Unlock()
-	entityAccessRegistry.accessors[mime] = erw
-}
-
-// NewEntityAccessorJSON returns a new EntityReaderWriter for accessing JSON content.
-// This package is already initialized with such an accessor using the MIME_JSON contentType.
-func NewEntityAccessorJSON(contentType string) EntityReaderWriter {
-	return entityJSONAccess{ContentType: contentType}
-}
-
-// NewEntityAccessorXML returns a new EntityReaderWriter for accessing XML content.
-// This package is already initialized with such an accessor using the MIME_XML contentType.
-func NewEntityAccessorXML(contentType string) EntityReaderWriter {
-	return entityXMLAccess{ContentType: contentType}
-}
-
-// accessorAt returns the registered ReaderWriter for this MIME type.
-func (r *entityReaderWriters) accessorAt(mime string) (EntityReaderWriter, bool) {
-	r.protection.RLock()
-	defer r.protection.RUnlock()
-	er, ok := r.accessors[mime]
-	if !ok {
-		// retry with reverse lookup
-		// more expensive but we are in an exceptional situation anyway
-		for k, v := range r.accessors {
-			if strings.Contains(mime, k) {
-				return v, true
-			}
-		}
-	}
-	return er, ok
-}
-
-// entityXMLAccess is a EntityReaderWriter for XML encoding
-type entityXMLAccess struct {
-	// This is used for setting the Content-Type header when writing
-	ContentType string
-}
-
-// Read unmarshalls the value from XML
-func (e entityXMLAccess) Read(req *Request, v interface{}) error {
-	return xml.NewDecoder(req.Request.Body).Decode(v)
-}
-
-// Write marshalls the value to JSON and set the Content-Type Header.
-func (e entityXMLAccess) Write(resp *Response, status int, v interface{}) error {
-	return writeXML(resp, status, e.ContentType, v)
-}
-
-// writeXML marshalls the value to JSON and set the Content-Type Header.
-func writeXML(resp *Response, status int, contentType string, v interface{}) error {
-	if v == nil {
-		resp.WriteHeader(status)
-		// do not write a nil representation
-		return nil
-	}
-	if resp.prettyPrint {
-		// pretty output must be created and written explicitly
-		output, err := xml.MarshalIndent(v, " ", " ")
-		if err != nil {
-			return err
-		}
-		resp.Header().Set(HEADER_ContentType, contentType)
-		resp.WriteHeader(status)
-		_, err = resp.Write([]byte(xml.Header))
-		if err != nil {
-			return err
-		}
-		_, err = resp.Write(output)
-		return err
-	}
-	// not-so-pretty
-	resp.Header().Set(HEADER_ContentType, contentType)
-	resp.WriteHeader(status)
-	return xml.NewEncoder(resp).Encode(v)
-}
-
-// entityJSONAccess is a EntityReaderWriter for JSON encoding
-type entityJSONAccess struct {
-	// This is used for setting the Content-Type header when writing
-	ContentType string
-}
-
-// Read unmarshalls the value from JSON
-func (e entityJSONAccess) Read(req *Request, v interface{}) error {
-	decoder := NewDecoder(req.Request.Body)
-	decoder.UseNumber()
-	return decoder.Decode(v)
-}
-
-// Write marshalls the value to JSON and set the Content-Type Header.
-func (e entityJSONAccess) Write(resp *Response, status int, v interface{}) error {
-	return writeJSON(resp, status, e.ContentType, v)
-}
-
-// write marshalls the value to JSON and set the Content-Type Header.
-func writeJSON(resp *Response, status int, contentType string, v interface{}) error {
-	if v == nil {
-		resp.WriteHeader(status)
-		// do not write a nil representation
-		return nil
-	}
-	if resp.prettyPrint {
-		// pretty output must be created and written explicitly
-		output, err := MarshalIndent(v, "", " ")
-		if err != nil {
-			return err
-		}
-		resp.Header().Set(HEADER_ContentType, contentType)
-		resp.WriteHeader(status)
-		_, err = resp.Write(output)
-		return err
-	}
-	// not-so-pretty
-	resp.Header().Set(HEADER_ContentType, contentType)
-	resp.WriteHeader(status)
-	return NewEncoder(resp).Encode(v)
-}

+ 0 - 21
vendor/github.com/emicklei/go-restful/v3/extensions.go

@@ -1,21 +0,0 @@
-package restful
-
-// Copyright 2021 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-// ExtensionProperties provides storage of vendor extensions for entities
-type ExtensionProperties struct {
-	// Extensions vendor extensions used to describe extra functionality
-	// (https://swagger.io/docs/specification/2-0/swagger-extensions/)
-	Extensions map[string]interface{}
-}
-
-// AddExtension adds or updates a key=value pair to the extension map.
-func (ep *ExtensionProperties) AddExtension(key string, value interface{}) {
-	if ep.Extensions == nil {
-		ep.Extensions = map[string]interface{}{key: value}
-	} else {
-		ep.Extensions[key] = value
-	}
-}

+ 0 - 37
vendor/github.com/emicklei/go-restful/v3/filter.go

@@ -1,37 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-// FilterChain is a request scoped object to process one or more filters before calling the target RouteFunction.
-type FilterChain struct {
-	Filters       []FilterFunction // ordered list of FilterFunction
-	Index         int              // index into filters that is currently in progress
-	Target        RouteFunction    // function to call after passing all filters
-	ParameterDocs []*Parameter     // the parameter docs for the route
-	Operation     string           // the name of the operation
-}
-
-// ProcessFilter passes the request,response pair through the next of Filters.
-// Each filter can decide to proceed to the next Filter or handle the Response itself.
-func (f *FilterChain) ProcessFilter(request *Request, response *Response) {
-	if f.Index < len(f.Filters) {
-		f.Index++
-		f.Filters[f.Index-1](request, response, f)
-	} else {
-		f.Target(request, response)
-	}
-}
-
-// FilterFunction definitions must call ProcessFilter on the FilterChain to pass on the control and eventually call the RouteFunction
-type FilterFunction func(*Request, *Response, *FilterChain)
-
-// NoBrowserCacheFilter is a filter function to set HTTP headers that disable browser caching
-// See examples/restful-no-cache-filter.go for usage
-func NoBrowserCacheFilter(req *Request, resp *Response, chain *FilterChain) {
-	resp.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate") // HTTP 1.1.
-	resp.Header().Set("Pragma", "no-cache")                                   // HTTP 1.0.
-	resp.Header().Set("Expires", "0")                                         // Proxies.
-	chain.ProcessFilter(req, resp)
-}

+ 0 - 21
vendor/github.com/emicklei/go-restful/v3/filter_adapter.go

@@ -1,21 +0,0 @@
-package restful
-
-import (
-	"net/http"
-)
-
-// HttpMiddlewareHandler is a function that takes a http.Handler and returns a http.Handler
-type HttpMiddlewareHandler func(http.Handler) http.Handler
-
-// HttpMiddlewareHandlerToFilter converts a HttpMiddlewareHandler to a FilterFunction.
-func HttpMiddlewareHandlerToFilter(middleware HttpMiddlewareHandler) FilterFunction {
-	return func(req *Request, resp *Response, chain *FilterChain) {
-		next := http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) {
-			req.Request = r
-			resp.ResponseWriter = rw
-			chain.ProcessFilter(req, resp)
-		})
-
-		middleware(next).ServeHTTP(resp.ResponseWriter, req.Request)
-	}
-}

+ 0 - 11
vendor/github.com/emicklei/go-restful/v3/json.go

@@ -1,11 +0,0 @@
-// +build !jsoniter
-
-package restful
-
-import "encoding/json"
-
-var (
-	MarshalIndent = json.MarshalIndent
-	NewDecoder    = json.NewDecoder
-	NewEncoder    = json.NewEncoder
-)

+ 0 - 12
vendor/github.com/emicklei/go-restful/v3/jsoniter.go

@@ -1,12 +0,0 @@
-// +build jsoniter
-
-package restful
-
-import "github.com/json-iterator/go"
-
-var (
-	json          = jsoniter.ConfigCompatibleWithStandardLibrary
-	MarshalIndent = json.MarshalIndent
-	NewDecoder    = json.NewDecoder
-	NewEncoder    = json.NewEncoder
-)

+ 0 - 326
vendor/github.com/emicklei/go-restful/v3/jsr311.go

@@ -1,326 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"errors"
-	"fmt"
-	"net/http"
-	"sort"
-	"strings"
-)
-
-// RouterJSR311 implements the flow for matching Requests to Routes (and consequently Resource Functions)
-// as specified by the JSR311 http://jsr311.java.net/nonav/releases/1.1/spec/spec.html.
-// RouterJSR311 implements the Router interface.
-// Concept of locators is not implemented.
-type RouterJSR311 struct{}
-
-// SelectRoute is part of the Router interface and returns the best match
-// for the WebService and its Route for the given Request.
-func (r RouterJSR311) SelectRoute(
-	webServices []*WebService,
-	httpRequest *http.Request) (selectedService *WebService, selectedRoute *Route, err error) {
-
-	// Identify the root resource class (WebService)
-	dispatcher, finalMatch, err := r.detectDispatcher(httpRequest.URL.Path, webServices)
-	if err != nil {
-		return nil, nil, NewError(http.StatusNotFound, "")
-	}
-	// Obtain the set of candidate methods (Routes)
-	routes := r.selectRoutes(dispatcher, finalMatch)
-	if len(routes) == 0 {
-		return dispatcher, nil, NewError(http.StatusNotFound, "404: Page Not Found")
-	}
-
-	// Identify the method (Route) that will handle the request
-	route, ok := r.detectRoute(routes, httpRequest)
-	return dispatcher, route, ok
-}
-
-// ExtractParameters is used to obtain the path parameters from the route using the same matching
-// engine as the JSR 311 router.
-func (r RouterJSR311) ExtractParameters(route *Route, webService *WebService, urlPath string) map[string]string {
-	webServiceExpr := webService.pathExpr
-	webServiceMatches := webServiceExpr.Matcher.FindStringSubmatch(urlPath)
-	pathParameters := r.extractParams(webServiceExpr, webServiceMatches)
-	routeExpr := route.pathExpr
-	routeMatches := routeExpr.Matcher.FindStringSubmatch(webServiceMatches[len(webServiceMatches)-1])
-	routeParams := r.extractParams(routeExpr, routeMatches)
-	for key, value := range routeParams {
-		pathParameters[key] = value
-	}
-	return pathParameters
-}
-
-func (RouterJSR311) extractParams(pathExpr *pathExpression, matches []string) map[string]string {
-	params := map[string]string{}
-	for i := 1; i < len(matches); i++ {
-		if len(pathExpr.VarNames) >= i {
-			params[pathExpr.VarNames[i-1]] = matches[i]
-		}
-	}
-	return params
-}
-
-// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
-func (r RouterJSR311) detectRoute(routes []Route, httpRequest *http.Request) (*Route, error) {
-	candidates := make([]*Route, 0, 8)
-	for i, each := range routes {
-		ok := true
-		for _, fn := range each.If {
-			if !fn(httpRequest) {
-				ok = false
-				break
-			}
-		}
-		if ok {
-			candidates = append(candidates, &routes[i])
-		}
-	}
-	if len(candidates) == 0 {
-		if trace {
-			traceLogger.Printf("no Route found (from %d) that passes conditional checks", len(routes))
-		}
-		return nil, NewError(http.StatusNotFound, "404: Not Found")
-	}
-
-	// http method
-	previous := candidates
-	candidates = candidates[:0]
-	for _, each := range previous {
-		if httpRequest.Method == each.Method {
-			candidates = append(candidates, each)
-		}
-	}
-	if len(candidates) == 0 {
-		if trace {
-			traceLogger.Printf("no Route found (in %d routes) that matches HTTP method %s\n", len(previous), httpRequest.Method)
-		}
-		allowed := []string{}
-	allowedLoop:
-		for _, candidate := range previous {
-			for _, method := range allowed {
-				if method == candidate.Method {
-					continue allowedLoop
-				}
-			}
-			allowed = append(allowed, candidate.Method)
-		}
-		header := http.Header{"Allow": []string{strings.Join(allowed, ", ")}}
-		return nil, NewErrorWithHeader(http.StatusMethodNotAllowed, "405: Method Not Allowed", header)
-	}
-
-	// content-type
-	contentType := httpRequest.Header.Get(HEADER_ContentType)
-	previous = candidates
-	candidates = candidates[:0]
-	for _, each := range previous {
-		if each.matchesContentType(contentType) {
-			candidates = append(candidates, each)
-		}
-	}
-	if len(candidates) == 0 {
-		if trace {
-			traceLogger.Printf("no Route found (from %d) that matches HTTP Content-Type: %s\n", len(previous), contentType)
-		}
-		if httpRequest.ContentLength > 0 {
-			return nil, NewError(http.StatusUnsupportedMediaType, "415: Unsupported Media Type")
-		}
-	}
-
-	// accept
-	previous = candidates
-	candidates = candidates[:0]
-	accept := httpRequest.Header.Get(HEADER_Accept)
-	if len(accept) == 0 {
-		accept = "*/*"
-	}
-	for _, each := range previous {
-		if each.matchesAccept(accept) {
-			candidates = append(candidates, each)
-		}
-	}
-	if len(candidates) == 0 {
-		if trace {
-			traceLogger.Printf("no Route found (from %d) that matches HTTP Accept: %s\n", len(previous), accept)
-		}
-		available := []string{}
-		for _, candidate := range previous {
-			available = append(available, candidate.Produces...)
-		}
-		// if POST,PUT,PATCH without body
-		method, length := httpRequest.Method, httpRequest.Header.Get("Content-Length")
-		if (method == http.MethodPost ||
-			method == http.MethodPut ||
-			method == http.MethodPatch) && length == "" {
-			return nil, NewError(
-				http.StatusUnsupportedMediaType,
-				fmt.Sprintf("415: Unsupported Media Type\n\nAvailable representations: %s", strings.Join(available, ", ")),
-			)
-		}
-		return nil, NewError(
-			http.StatusNotAcceptable,
-			fmt.Sprintf("406: Not Acceptable\n\nAvailable representations: %s", strings.Join(available, ", ")),
-		)
-	}
-	// return r.bestMatchByMedia(outputMediaOk, contentType, accept), nil
-	return candidates[0], nil
-}
-
-// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2
-// n/m > n/* > */*
-func (r RouterJSR311) bestMatchByMedia(routes []Route, contentType string, accept string) *Route {
-	// TODO
-	return &routes[0]
-}
-
-// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2  (step 2)
-func (r RouterJSR311) selectRoutes(dispatcher *WebService, pathRemainder string) []Route {
-	filtered := &sortableRouteCandidates{}
-	for _, each := range dispatcher.Routes() {
-		pathExpr := each.pathExpr
-		matches := pathExpr.Matcher.FindStringSubmatch(pathRemainder)
-		if matches != nil {
-			lastMatch := matches[len(matches)-1]
-			if len(lastMatch) == 0 || lastMatch == "/" { // do not include if value is neither empty nor ‘/’.
-				filtered.candidates = append(filtered.candidates,
-					routeCandidate{each, len(matches) - 1, pathExpr.LiteralCount, pathExpr.VarCount})
-			}
-		}
-	}
-	if len(filtered.candidates) == 0 {
-		if trace {
-			traceLogger.Printf("WebService on path %s has no routes that match URL path remainder:%s\n", dispatcher.rootPath, pathRemainder)
-		}
-		return []Route{}
-	}
-	sort.Sort(sort.Reverse(filtered))
-
-	// select other routes from candidates whoes expression matches rmatch
-	matchingRoutes := []Route{filtered.candidates[0].route}
-	for c := 1; c < len(filtered.candidates); c++ {
-		each := filtered.candidates[c]
-		if each.route.pathExpr.Matcher.MatchString(pathRemainder) {
-			matchingRoutes = append(matchingRoutes, each.route)
-		}
-	}
-	return matchingRoutes
-}
-
-// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-360003.7.2 (step 1)
-func (r RouterJSR311) detectDispatcher(requestPath string, dispatchers []*WebService) (*WebService, string, error) {
-	filtered := &sortableDispatcherCandidates{}
-	for _, each := range dispatchers {
-		matches := each.pathExpr.Matcher.FindStringSubmatch(requestPath)
-		if matches != nil {
-			filtered.candidates = append(filtered.candidates,
-				dispatcherCandidate{each, matches[len(matches)-1], len(matches), each.pathExpr.LiteralCount, each.pathExpr.VarCount})
-		}
-	}
-	if len(filtered.candidates) == 0 {
-		if trace {
-			traceLogger.Printf("no WebService was found to match URL path:%s\n", requestPath)
-		}
-		return nil, "", errors.New("not found")
-	}
-	sort.Sort(sort.Reverse(filtered))
-	return filtered.candidates[0].dispatcher, filtered.candidates[0].finalMatch, nil
-}
-
-// Types and functions to support the sorting of Routes
-
-type routeCandidate struct {
-	route           Route
-	matchesCount    int // the number of capturing groups
-	literalCount    int // the number of literal characters (means those not resulting from template variable substitution)
-	nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^  /]+?)’)
-}
-
-func (r routeCandidate) expressionToMatch() string {
-	return r.route.pathExpr.Source
-}
-
-func (r routeCandidate) String() string {
-	return fmt.Sprintf("(m=%d,l=%d,n=%d)", r.matchesCount, r.literalCount, r.nonDefaultCount)
-}
-
-type sortableRouteCandidates struct {
-	candidates []routeCandidate
-}
-
-func (rcs *sortableRouteCandidates) Len() int {
-	return len(rcs.candidates)
-}
-func (rcs *sortableRouteCandidates) Swap(i, j int) {
-	rcs.candidates[i], rcs.candidates[j] = rcs.candidates[j], rcs.candidates[i]
-}
-func (rcs *sortableRouteCandidates) Less(i, j int) bool {
-	ci := rcs.candidates[i]
-	cj := rcs.candidates[j]
-	// primary key
-	if ci.literalCount < cj.literalCount {
-		return true
-	}
-	if ci.literalCount > cj.literalCount {
-		return false
-	}
-	// secundary key
-	if ci.matchesCount < cj.matchesCount {
-		return true
-	}
-	if ci.matchesCount > cj.matchesCount {
-		return false
-	}
-	// tertiary key
-	if ci.nonDefaultCount < cj.nonDefaultCount {
-		return true
-	}
-	if ci.nonDefaultCount > cj.nonDefaultCount {
-		return false
-	}
-	// quaternary key ("source" is interpreted as Path)
-	return ci.route.Path < cj.route.Path
-}
-
-// Types and functions to support the sorting of Dispatchers
-
-type dispatcherCandidate struct {
-	dispatcher      *WebService
-	finalMatch      string
-	matchesCount    int // the number of capturing groups
-	literalCount    int // the number of literal characters (means those not resulting from template variable substitution)
-	nonDefaultCount int // the number of capturing groups with non-default regular expressions (i.e. not ‘([^  /]+?)’)
-}
-type sortableDispatcherCandidates struct {
-	candidates []dispatcherCandidate
-}
-
-func (dc *sortableDispatcherCandidates) Len() int {
-	return len(dc.candidates)
-}
-func (dc *sortableDispatcherCandidates) Swap(i, j int) {
-	dc.candidates[i], dc.candidates[j] = dc.candidates[j], dc.candidates[i]
-}
-func (dc *sortableDispatcherCandidates) Less(i, j int) bool {
-	ci := dc.candidates[i]
-	cj := dc.candidates[j]
-	// primary key
-	if ci.matchesCount < cj.matchesCount {
-		return true
-	}
-	if ci.matchesCount > cj.matchesCount {
-		return false
-	}
-	// secundary key
-	if ci.literalCount < cj.literalCount {
-		return true
-	}
-	if ci.literalCount > cj.literalCount {
-		return false
-	}
-	// tertiary key
-	return ci.nonDefaultCount < cj.nonDefaultCount
-}

+ 0 - 34
vendor/github.com/emicklei/go-restful/v3/log/log.go

@@ -1,34 +0,0 @@
-package log
-
-import (
-	stdlog "log"
-	"os"
-)
-
-// StdLogger corresponds to a minimal subset of the interface satisfied by stdlib log.Logger
-type StdLogger interface {
-	Print(v ...interface{})
-	Printf(format string, v ...interface{})
-}
-
-var Logger StdLogger
-
-func init() {
-	// default Logger
-	SetLogger(stdlog.New(os.Stderr, "[restful] ", stdlog.LstdFlags|stdlog.Lshortfile))
-}
-
-// SetLogger sets the logger for this package
-func SetLogger(customLogger StdLogger) {
-	Logger = customLogger
-}
-
-// Print delegates to the Logger
-func Print(v ...interface{}) {
-	Logger.Print(v...)
-}
-
-// Printf delegates to the Logger
-func Printf(format string, v ...interface{}) {
-	Logger.Printf(format, v...)
-}

+ 0 - 32
vendor/github.com/emicklei/go-restful/v3/logger.go

@@ -1,32 +0,0 @@
-package restful
-
-// Copyright 2014 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-import (
-	"github.com/emicklei/go-restful/v3/log"
-)
-
-var trace bool = false
-var traceLogger log.StdLogger
-
-func init() {
-	traceLogger = log.Logger // use the package logger by default
-}
-
-// TraceLogger enables detailed logging of Http request matching and filter invocation. Default no logger is set.
-// You may call EnableTracing() directly to enable trace logging to the package-wide logger.
-func TraceLogger(logger log.StdLogger) {
-	traceLogger = logger
-	EnableTracing(logger != nil)
-}
-
-// SetLogger exposes the setter for the global logger on the top-level package
-func SetLogger(customLogger log.StdLogger) {
-	log.SetLogger(customLogger)
-}
-
-// EnableTracing can be used to Trace logging on and off.
-func EnableTracing(enabled bool) {
-	trace = enabled
-}

+ 0 - 50
vendor/github.com/emicklei/go-restful/v3/mime.go

@@ -1,50 +0,0 @@
-package restful
-
-import (
-	"strconv"
-	"strings"
-)
-
-type mime struct {
-	media   string
-	quality float64
-}
-
-// insertMime adds a mime to a list and keeps it sorted by quality.
-func insertMime(l []mime, e mime) []mime {
-	for i, each := range l {
-		// if current mime has lower quality then insert before
-		if e.quality > each.quality {
-			left := append([]mime{}, l[0:i]...)
-			return append(append(left, e), l[i:]...)
-		}
-	}
-	return append(l, e)
-}
-
-const qFactorWeightingKey = "q"
-
-// sortedMimes returns a list of mime sorted (desc) by its specified quality.
-// e.g. text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3
-func sortedMimes(accept string) (sorted []mime) {
-	for _, each := range strings.Split(accept, ",") {
-		typeAndQuality := strings.Split(strings.Trim(each, " "), ";")
-		if len(typeAndQuality) == 1 {
-			sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0})
-		} else {
-			// take factor
-			qAndWeight := strings.Split(typeAndQuality[1], "=")
-			if len(qAndWeight) == 2 && strings.Trim(qAndWeight[0], " ") == qFactorWeightingKey {
-				f, err := strconv.ParseFloat(qAndWeight[1], 64)
-				if err != nil {
-					traceLogger.Printf("unable to parse quality in %s, %v", each, err)
-				} else {
-					sorted = insertMime(sorted, mime{typeAndQuality[0], f})
-				}
-			} else {
-				sorted = insertMime(sorted, mime{typeAndQuality[0], 1.0})
-			}
-		}
-	}
-	return
-}

+ 0 - 34
vendor/github.com/emicklei/go-restful/v3/options_filter.go

@@ -1,34 +0,0 @@
-package restful
-
-import "strings"
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method
-// and provides the response with a set of allowed methods for the request URL Path.
-// As for any filter, you can also install it for a particular WebService within a Container.
-// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS).
-func (c *Container) OPTIONSFilter(req *Request, resp *Response, chain *FilterChain) {
-	if "OPTIONS" != req.Request.Method {
-		chain.ProcessFilter(req, resp)
-		return
-	}
-
-	archs := req.Request.Header.Get(HEADER_AccessControlRequestHeaders)
-	methods := strings.Join(c.computeAllowedMethods(req), ",")
-	origin := req.Request.Header.Get(HEADER_Origin)
-
-	resp.AddHeader(HEADER_Allow, methods)
-	resp.AddHeader(HEADER_AccessControlAllowOrigin, origin)
-	resp.AddHeader(HEADER_AccessControlAllowHeaders, archs)
-	resp.AddHeader(HEADER_AccessControlAllowMethods, methods)
-}
-
-// OPTIONSFilter is a filter function that inspects the Http Request for the OPTIONS method
-// and provides the response with a set of allowed methods for the request URL Path.
-// Note: this filter is not needed when using CrossOriginResourceSharing (for CORS).
-func OPTIONSFilter() FilterFunction {
-	return DefaultContainer.OPTIONSFilter
-}

+ 0 - 242
vendor/github.com/emicklei/go-restful/v3/parameter.go

@@ -1,242 +0,0 @@
-package restful
-
-import "sort"
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-const (
-	// PathParameterKind = indicator of Request parameter type "path"
-	PathParameterKind = iota
-
-	// QueryParameterKind = indicator of Request parameter type "query"
-	QueryParameterKind
-
-	// BodyParameterKind = indicator of Request parameter type "body"
-	BodyParameterKind
-
-	// HeaderParameterKind = indicator of Request parameter type "header"
-	HeaderParameterKind
-
-	// FormParameterKind = indicator of Request parameter type "form"
-	FormParameterKind
-
-	// MultiPartFormParameterKind = indicator of Request parameter type "multipart/form-data"
-	MultiPartFormParameterKind
-
-	// CollectionFormatCSV comma separated values `foo,bar`
-	CollectionFormatCSV = CollectionFormat("csv")
-
-	// CollectionFormatSSV space separated values `foo bar`
-	CollectionFormatSSV = CollectionFormat("ssv")
-
-	// CollectionFormatTSV tab separated values `foo\tbar`
-	CollectionFormatTSV = CollectionFormat("tsv")
-
-	// CollectionFormatPipes pipe separated values `foo|bar`
-	CollectionFormatPipes = CollectionFormat("pipes")
-
-	// CollectionFormatMulti corresponds to multiple parameter instances instead of multiple values for a single
-	// instance `foo=bar&foo=baz`. This is valid only for QueryParameters and FormParameters
-	CollectionFormatMulti = CollectionFormat("multi")
-)
-
-type CollectionFormat string
-
-func (cf CollectionFormat) String() string {
-	return string(cf)
-}
-
-// Parameter is for documententing the parameter used in a Http Request
-// ParameterData kinds are Path,Query and Body
-type Parameter struct {
-	data *ParameterData
-}
-
-// ParameterData represents the state of a Parameter.
-// It is made public to make it accessible to e.g. the Swagger package.
-type ParameterData struct {
-	ExtensionProperties
-	Name, Description, DataType, DataFormat string
-	Kind                                    int
-	Required                                bool
-	// AllowableValues is deprecated. Use PossibleValues instead
-	AllowableValues  map[string]string
-	PossibleValues   []string
-	AllowMultiple    bool
-	AllowEmptyValue  bool
-	DefaultValue     string
-	CollectionFormat string
-	Pattern          string
-	Minimum          *float64
-	Maximum          *float64
-	MinLength        *int64
-	MaxLength        *int64
-	MinItems         *int64
-	MaxItems         *int64
-	UniqueItems      bool
-}
-
-// Data returns the state of the Parameter
-func (p *Parameter) Data() ParameterData {
-	return *p.data
-}
-
-// Kind returns the parameter type indicator (see const for valid values)
-func (p *Parameter) Kind() int {
-	return p.data.Kind
-}
-
-func (p *Parameter) bePath() *Parameter {
-	p.data.Kind = PathParameterKind
-	return p
-}
-func (p *Parameter) beQuery() *Parameter {
-	p.data.Kind = QueryParameterKind
-	return p
-}
-func (p *Parameter) beBody() *Parameter {
-	p.data.Kind = BodyParameterKind
-	return p
-}
-
-func (p *Parameter) beHeader() *Parameter {
-	p.data.Kind = HeaderParameterKind
-	return p
-}
-
-func (p *Parameter) beForm() *Parameter {
-	p.data.Kind = FormParameterKind
-	return p
-}
-
-func (p *Parameter) beMultiPartForm() *Parameter {
-	p.data.Kind = MultiPartFormParameterKind
-	return p
-}
-
-// Required sets the required field and returns the receiver
-func (p *Parameter) Required(required bool) *Parameter {
-	p.data.Required = required
-	return p
-}
-
-// AllowMultiple sets the allowMultiple field and returns the receiver
-func (p *Parameter) AllowMultiple(multiple bool) *Parameter {
-	p.data.AllowMultiple = multiple
-	return p
-}
-
-// AddExtension adds or updates a key=value pair to the extension map
-func (p *Parameter) AddExtension(key string, value interface{}) *Parameter {
-	p.data.AddExtension(key, value)
-	return p
-}
-
-// AllowEmptyValue sets the AllowEmptyValue field and returns the receiver
-func (p *Parameter) AllowEmptyValue(multiple bool) *Parameter {
-	p.data.AllowEmptyValue = multiple
-	return p
-}
-
-// AllowableValues is deprecated. Use PossibleValues instead. Both will be set.
-func (p *Parameter) AllowableValues(values map[string]string) *Parameter {
-	p.data.AllowableValues = values
-
-	allowableSortedKeys := make([]string, 0, len(values))
-	for k := range values {
-		allowableSortedKeys = append(allowableSortedKeys, k)
-	}
-	sort.Strings(allowableSortedKeys)
-
-	p.data.PossibleValues = make([]string, 0, len(values))
-	for _, k := range allowableSortedKeys {
-		p.data.PossibleValues = append(p.data.PossibleValues, values[k])
-	}
-	return p
-}
-
-// PossibleValues sets the possible values field and returns the receiver
-func (p *Parameter) PossibleValues(values []string) *Parameter {
-	p.data.PossibleValues = values
-	return p
-}
-
-// DataType sets the dataType field and returns the receiver
-func (p *Parameter) DataType(typeName string) *Parameter {
-	p.data.DataType = typeName
-	return p
-}
-
-// DataFormat sets the dataFormat field for Swagger UI
-func (p *Parameter) DataFormat(formatName string) *Parameter {
-	p.data.DataFormat = formatName
-	return p
-}
-
-// DefaultValue sets the default value field and returns the receiver
-func (p *Parameter) DefaultValue(stringRepresentation string) *Parameter {
-	p.data.DefaultValue = stringRepresentation
-	return p
-}
-
-// Description sets the description value field and returns the receiver
-func (p *Parameter) Description(doc string) *Parameter {
-	p.data.Description = doc
-	return p
-}
-
-// CollectionFormat sets the collection format for an array type
-func (p *Parameter) CollectionFormat(format CollectionFormat) *Parameter {
-	p.data.CollectionFormat = format.String()
-	return p
-}
-
-// Pattern sets the pattern field and returns the receiver
-func (p *Parameter) Pattern(pattern string) *Parameter {
-	p.data.Pattern = pattern
-	return p
-}
-
-// Minimum sets the minimum field and returns the receiver
-func (p *Parameter) Minimum(minimum float64) *Parameter {
-	p.data.Minimum = &minimum
-	return p
-}
-
-// Maximum sets the maximum field and returns the receiver
-func (p *Parameter) Maximum(maximum float64) *Parameter {
-	p.data.Maximum = &maximum
-	return p
-}
-
-// MinLength sets the minLength field and returns the receiver
-func (p *Parameter) MinLength(minLength int64) *Parameter {
-	p.data.MinLength = &minLength
-	return p
-}
-
-// MaxLength sets the maxLength field and returns the receiver
-func (p *Parameter) MaxLength(maxLength int64) *Parameter {
-	p.data.MaxLength = &maxLength
-	return p
-}
-
-// MinItems sets the minItems field and returns the receiver
-func (p *Parameter) MinItems(minItems int64) *Parameter {
-	p.data.MinItems = &minItems
-	return p
-}
-
-// MaxItems sets the maxItems field and returns the receiver
-func (p *Parameter) MaxItems(maxItems int64) *Parameter {
-	p.data.MaxItems = &maxItems
-	return p
-}
-
-// UniqueItems sets the uniqueItems field and returns the receiver
-func (p *Parameter) UniqueItems(uniqueItems bool) *Parameter {
-	p.data.UniqueItems = uniqueItems
-	return p
-}

+ 0 - 74
vendor/github.com/emicklei/go-restful/v3/path_expression.go

@@ -1,74 +0,0 @@
-package restful
-
-// Copyright 2013 Ernest Micklei. All rights reserved.
-// Use of this source code is governed by a license
-// that can be found in the LICENSE file.
-
-import (
-	"bytes"
-	"fmt"
-	"regexp"
-	"strings"
-)
-
-// PathExpression holds a compiled path expression (RegExp) needed to match against
-// Http request paths and to extract path parameter values.
-type pathExpression struct {
-	LiteralCount int      // the number of literal characters (means those not resulting from template variable substitution)
-	VarNames     []string // the names of parameters (enclosed by {}) in the path
-	VarCount     int      // the number of named parameters (enclosed by {}) in the path
-	Matcher      *regexp.Regexp
-	Source       string // Path as defined by the RouteBuilder
-	tokens       []string
-}
-
-// NewPathExpression creates a PathExpression from the input URL path.
-// Returns an error if the path is invalid.
-func newPathExpression(path string) (*pathExpression, error) {
-	expression, literalCount, varNames, varCount, tokens := templateToRegularExpression(path)
-	compiled, err := regexp.Compile(expression)
-	if err != nil {
-		return nil, err
-	}
-	return &pathExpression{literalCount, varNames, varCount, compiled, expression, tokens}, nil
-}
-
-// http://jsr311.java.net/nonav/releases/1.1/spec/spec3.html#x3-370003.7.3
-func templateToRegularExpression(template string) (expression string, literalCount int, varNames []string, varCount int, tokens []string) {
-	var buffer bytes.Buffer
-	buffer.WriteString("^")
-	//tokens = strings.Split(template, "/")
-	tokens = tokenizePath(template)
-	for _, each := range tokens {
-		if each == "" {
-			continue
-		}
-		buffer.WriteString("/")
-		if strings.HasPrefix(each, "{") {
-			// check for regular expression in variable
-			colon := strings.Index(each, ":")
-			var varName string
-			if colon != -1 {
-				// extract expression
-				varName = strings.TrimSpace(each[1:colon])
-				paramExpr := strings.TrimSpace(each[colon+1 : len(each)-1])
-				if paramExpr == "*" { // special case
-					buffer.WriteString("(.*)")
-				} else {
-					buffer.WriteString(fmt.Sprintf("(%s)", paramExpr)) // between colon and closing moustache
-				}
-			} else {
-				// plain var
-				varName = strings.TrimSpace(each[1 : len(each)-1])
-				buffer.WriteString("([^/]+?)")
-			}
-			varNames = append(varNames, varName)
-			varCount += 1
-		} else {
-			literalCount += len(each)
-			encoded := each // TODO URI encode
-			buffer.WriteString(regexp.QuoteMeta(encoded))
-		}
-	}
-	return strings.TrimRight(buffer.String(), "/") + "(/.*)?$", literalCount, varNames, varCount, tokens
-}

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно