diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..187a094 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +**/go.sum -diff -merge +**/go.sum linguist-generated=true diff --git a/go.mod b/go.mod index d0a4884..888bf06 100644 --- a/go.mod +++ b/go.mod @@ -12,14 +12,12 @@ require ( github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.4.1 github.com/Azure/go-autorest/autorest v0.11.29 github.com/Azure/go-autorest/autorest/azure/auth v0.5.13 - github.com/KimMachineGun/automemlimit v0.6.1 github.com/alicebob/miniredis/v2 v2.32.1 github.com/fxamacker/cbor/v2 v2.7.0 github.com/go-redis/redis/v8 v8.11.5 github.com/google/uuid v1.6.0 github.com/gorilla/securecookie v1.1.2 github.com/gorilla/sessions v1.3.0 - github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 github.com/ldclabs/cose/go v0.0.0-20221214142927-d22c1cfc2154 github.com/lestrrat-go/jwx v1.2.29 @@ -28,12 +26,9 @@ require ( github.com/opentracing/opentracing-go v1.2.0 github.com/openzipkin-contrib/zipkin-go-opentracing v0.5.0 github.com/openzipkin/zipkin-go v0.4.3 - github.com/prometheus/client_golang v1.20.5 github.com/stretchr/testify v1.10.0 github.com/veraison/go-cose v1.1.0 - go.uber.org/automaxprocs v1.5.3 go.uber.org/zap v1.27.0 - golang.org/x/sync v0.9.0 google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 google.golang.org/grpc v1.69.0-dev ) @@ -42,29 +37,21 @@ require ( github.com/Azure/go-amqp v1.0.5 // indirect github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect - github.com/beorn7/perks v1.0.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/goccy/go-json v0.10.3 // indirect github.com/golang-jwt/jwt/v5 v5.2.1 // indirect - github.com/klauspost/compress v1.17.9 // indirect github.com/kylelemons/godebug v1.1.0 // indirect github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect github.com/lestrrat-go/blackmagic v1.0.2 // indirect github.com/lestrrat-go/httpcc v1.0.1 // indirect github.com/lestrrat-go/iter v1.0.2 // indirect github.com/lestrrat-go/option v1.0.1 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect github.com/pkg/errors v0.9.1 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.55.0 // indirect - github.com/prometheus/procfs v0.15.1 // indirect github.com/shengdoushi/base58 v1.0.0 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yuin/gopher-lua v1.1.1 // indirect - golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect ) require ( @@ -78,21 +65,14 @@ require ( github.com/Azure/go-autorest/logger v0.2.1 // indirect github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/cilium/ebpf v0.15.0 // indirect - github.com/containerd/cgroups/v3 v3.0.3 // indirect - github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/dimchansky/utfbom v1.1.1 // indirect - github.com/docker/go-units v0.5.0 // indirect github.com/gabriel-vasile/mimetype v1.4.4 - github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang-jwt/jwt/v4 v4.5.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect - github.com/opencontainers/runtime-spec v1.2.0 // indirect github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/sirupsen/logrus v1.9.3 // indirect github.com/stretchr/objx v0.5.2 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.29.0 // indirect diff --git a/go.sum b/go.sum index 665eacf..9fcefc0 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU= github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.12.0 h1:1nGuui+4POelzDwI7RG56yfQJHCnKvwfMoU7VsEp+Zg= @@ -41,30 +40,15 @@ github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUM github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 h1:XHOnouVk1mxXfQidrMEnLlPk9UMeRtyBTnEFtxkV0kU= github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= -github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/KimMachineGun/automemlimit v0.6.1 h1:ILa9j1onAAMadBsyyUJv5cack8Y1WT26yLj/V+ulKp8= -github.com/KimMachineGun/automemlimit v0.6.1/go.mod h1:T7xYht7B8r6AG/AqFcUdc7fzd2bIdBKmepfP2S1svPY= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= github.com/alicebob/miniredis/v2 v2.32.1 h1:Bz7CciDnYSaa0mX5xODh6GUITRSx+cVhjNoOR4JssBo= github.com/alicebob/miniredis/v2 v2.32.1/go.mod h1:AqkLNAfUm0K07J28hnAyyQKf/x0YkCY/g5DCtuL01Mw= -github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= -github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= -github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/cilium/ebpf v0.15.0 h1:7NxJhNiBT3NG8pZJ3c+yfrVdHY8ScgKD27sScgjLMMk= -github.com/cilium/ebpf v0.15.0/go.mod h1:DHp1WyrLeiBh19Cf/tfiSMhqheEiK8fXFZ4No0P1Hso= -github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/containerd/cgroups/v3 v3.0.3 h1:S5ByHZ/h9PMe5IOQoN7E+nMc2UcLEM/V48DGDJ9kip0= -github.com/containerd/cgroups/v3 v3.0.3/go.mod h1:8HBe7V3aWGLFPd/k03swSIsGjZhHI2WzJmticMgVuz0= -github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8iXXhfZs= -github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= @@ -77,12 +61,6 @@ github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/r github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= -github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= -github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= -github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= -github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= @@ -91,21 +69,11 @@ github.com/fxamacker/cbor/v2 v2.7.0 h1:iM5WgngdRBanHcxugY4JySA0nk1wZorNOpTgCMedv github.com/fxamacker/cbor/v2 v2.7.0/go.mod h1:pxXPTn3joSm21Gbwsv0w9OSA2y1HFR9qXEeXQVeNoDQ= github.com/gabriel-vasile/mimetype v1.4.4 h1:QjV6pZ7/XZ7ryI2KuyeEDE8wnh7fHP9YnQy+R0LnH8I= github.com/gabriel-vasile/mimetype v1.4.4/go.mod h1:JwLei5XPtWdGiMFB5Pjle1oEeoSeEuJfJE+TtfvdB/s= -github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= -github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= -github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= -github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/goccy/go-json v0.10.3 h1:KZ5WoDbxAIgm2HNbYckL0se1fHD6rz5j4ywS6ebzDqA= github.com/goccy/go-json v0.10.3/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M= -github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= -github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= @@ -113,16 +81,8 @@ github.com/golang-jwt/jwt/v4 v4.5.1 h1:JdqV9zKUdtaa9gdPlywC3aeoEsR681PlKC+4F5gQg github.com/golang-jwt/jwt/v4 v4.5.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= -github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= -github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= @@ -133,22 +93,12 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= github.com/gorilla/sessions v1.3.0 h1:XYlkq7KcpOB2ZhHBPv5WpjMIxrQosiZanfoy1HLZFzg= github.com/gorilla/sessions v1.3.0/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 h1:UH//fgunKIs4JdUbpDl1VZCDaL56wXCB/5+wF6uHfaI= -github.com/grpc-ecosystem/go-grpc-middleware v1.4.0/go.mod h1:g5qyo/la0ALbONm6Vbp88Yd8NsDy6rZz+RcrMPxvld8= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 h1:bkypFPDjIYGfCYD5mRBvpqxfYX1YCS1PXdKYWi8FsN0= github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0/go.mod h1:P+Lt/0by1T8bfcF3z737NnSbmxQAppXMRziHUxPOC8k= github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -170,8 +120,6 @@ github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNB github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/nuts-foundation/go-did v0.6.4 h1:cy7BTM7MaL/bY2JbGUAy/8R9DGEM7FYg3rT5qt6oazs= github.com/nuts-foundation/go-did v0.6.4/go.mod h1:Jb3IgnO2Zeed970JMIlfjr4g1kvikmgWUJA0EfeDEFE= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= @@ -180,8 +128,6 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/opencontainers/runtime-spec v1.2.0 h1:z97+pHb3uELt/yiAWD691HNHQIF07bE7dzrbT927iTk= -github.com/opencontainers/runtime-spec v1.2.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492 h1:lM6RxxfUMrYL/f8bWEUqdXrANWtrL7Nndbm9iFN0DlU= github.com/opentracing-contrib/go-observer v0.0.0-20170622124052-a52f23424492/go.mod h1:Ngi6UdF0k5OKD5t5wlmGhe/EDKPoUM3BXZSSfIuJbis= github.com/opentracing-contrib/go-stdlib v1.0.0 h1:TBS7YuVotp8myLon4Pv7BtCBzOTo1DeZCld0Z63mW2w= @@ -193,45 +139,24 @@ github.com/openzipkin-contrib/zipkin-go-opentracing v0.5.0 h1:uhcF5Jd7rP9DVEL10S github.com/openzipkin-contrib/zipkin-go-opentracing v0.5.0/go.mod h1:+oCZ5GXXr7KPI/DNOQORPTq5AWHfALJj9c72b0+YsEY= github.com/openzipkin/zipkin-go v0.4.3 h1:9EGwpqkgnwdEIJ+Od7QVSEIH+ocmm5nPat0G7sjsSdg= github.com/openzipkin/zipkin-go v0.4.3/go.mod h1:M9wCJZFWCo2RiY+o1eBCEMe0Dp2S5LDHcMZmk3RmK7c= -github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= -github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU= -github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.55.0 h1:KEi6DK7lXW/m7Ig5i47x0vRzuBsHuvJdi5ee6Y3G1dc= -github.com/prometheus/common v0.55.0/go.mod h1:2SECS4xJG1kd8XF9IcM1gMX6510RAEL65zxzNImwdc8= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/shengdoushi/base58 v1.0.0 h1:tGe4o6TmdXFJWoI31VoSWvuaKxf0Px3gqa3sUWhAxBs= github.com/shengdoushi/base58 v1.0.0/go.mod h1:m5uIILfzcKMw6238iWAhP4l3s5+uXyF3+bJKUNhAL9I= -github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= -github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= -github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= @@ -243,26 +168,16 @@ github.com/veraison/go-cose v1.1.0 h1:AalPS4VGiKavpAzIlBjrn7bhqXiXi4jbMYY/2+UC+4 github.com/veraison/go-cose v1.1.0/go.mod h1:7ziE85vSq4ScFTg6wyoMXjucIGOf4JkFEZi/an96Ct4= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.1 h1:kYKnWBjvbNP4XLT3+bPEwAXJx262OhaHDWDVOPjL46M= github.com/yuin/gopher-lua v1.1.1/go.mod h1:GBR0iDaNXjAgGg9zfCvksxSRnQx76gclCIb7kdAd1Pw= -go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= -go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= -go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= -go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.18.1/go.mod h1:xg/QME4nWcxGxrpdeYfq7UvYrLh66cuVKdrbD1XF/NI= go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= @@ -271,25 +186,9 @@ golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDf golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/crypto v0.29.0 h1:L5SG1JTTXupVV3n6sUqMTeWbjAyfPwoda2DLX8J8FrQ= golang.org/x/crypto v0.29.0/go.mod h1:+F4F4N5hv6v38hfeYwTdx20oUvLLc+QfrE9Ax9HtgRg= -golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= -golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= -golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= -golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -298,28 +197,15 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ= -golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -346,51 +232,25 @@ golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.20.0 h1:gK/Kv2otX8gz+wn7Rmb3vT96ZwuoxnQlY+HlJVj7Qug= golang.org/x/text v0.20.0/go.mod h1:D4IsuqiFMhST5bX19pQ9ikHC2GsaKyk/oF+pn3ducp4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= -golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= -golang.org/x/tools v0.0.0-20191108193012-7d206e10da11/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= -google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1 h1:hjSy6tcFQZ171igDaN5QHOw2n6vx40juYbC/x67CEhc= google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:qpvKtACPCQhAdu3PyQgV4l3LMXZEtft7y8QcarRsp9I= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= -google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= -google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= -google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= -google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= -google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.69.0-dev h1:apWegzBczine6VjRA1FpkZ9LVAvNINTqDPbiRDD4D/g= google.golang.org/grpc v1.69.0-dev/go.mod h1:2RINgKHklVDGHlkF/BfDsmIw0xdarBnd0YM+g7Fc0Fk= google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg= google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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= -honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= nhooyr.io/websocket v1.8.11 h1:f/qXNc2/3DpoSZkHt1DQu6rj4zGC8JmkkLkWss0MgN0= nhooyr.io/websocket v1.8.11/go.mod h1:rN9OFWIUwuxg4fR5tELlYC04bXYowCP9GX47ivo2l+c= diff --git a/grpchealth/grpchealth.go b/grpchealth/grpchealth.go deleted file mode 100644 index 7d61ef3..0000000 --- a/grpchealth/grpchealth.go +++ /dev/null @@ -1,107 +0,0 @@ -// Package grpchealth package provides server implementing Check rpc that meets https://github.com/grpc/grpc/blob/master/doc/health-checking.md -package grpchealth - -import ( - "context" - "sync" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - "google.golang.org/grpc/health/grpc_health_v1" -) - -const ( - livenessServiceName = "liveness" - readinessServiceName = "readiness" -) - -type HealthCheckingService struct { - grpc_health_v1.UnimplementedHealthServer - sync.RWMutex - healthStatus map[string]grpc_health_v1.HealthCheckResponse_ServingStatus - log Logger -} - -func New(log Logger) HealthCheckingService { - return HealthCheckingService{ - healthStatus: map[string]grpc_health_v1.HealthCheckResponse_ServingStatus{ - livenessServiceName: grpc_health_v1.HealthCheckResponse_SERVING, - readinessServiceName: grpc_health_v1.HealthCheckResponse_NOT_SERVING, - }, - log: log, - } -} - -func (s *HealthCheckingService) serving(service string) { - s.Lock() - defer s.Unlock() - s.healthStatus[service] = grpc_health_v1.HealthCheckResponse_SERVING - s.log.Infof("Health set to 'SERVING': %s", service) -} - -func (s *HealthCheckingService) notServing(service string) { - s.Lock() - defer s.Unlock() - s.healthStatus[service] = grpc_health_v1.HealthCheckResponse_NOT_SERVING - s.log.Infof("Health set to 'NOT_SERVING': %s", service) -} - -// Dead - changes status of service to dead -func (s *HealthCheckingService) Dead() { - s.notServing(livenessServiceName) -} - -// Live - changes status of service to alive -func (s *HealthCheckingService) Live() { - s.serving(livenessServiceName) -} - -// NotReady - changes status of service to not ready -func (s *HealthCheckingService) NotReady() { - s.notServing(readinessServiceName) -} - -// Ready - changes status of service to ready -func (s *HealthCheckingService) Ready() { - s.serving(readinessServiceName) -} - -// Check implements `service Health`. -func (s *HealthCheckingService) Check(ctx context.Context, in *grpc_health_v1.HealthCheckRequest) ( - *grpc_health_v1.HealthCheckResponse, error) { - s.RLock() - defer s.RUnlock() - - // logger.Sugar.Debugf("Health Check for '%s'", in.Service) - if in.Service == "" { - for _, v := range s.healthStatus { - // logger.Sugar.Debugf("Health Check for '%s'-> '%s'", in.Service, v.String()) - if v != grpc_health_v1.HealthCheckResponse_SERVING { - s.log.Infof("Health Check '%s' is NOT SERVING: '%s'", in.Service, v.String()) - return &grpc_health_v1.HealthCheckResponse{ - Status: v, - }, nil - } - } - s.log.Infof("Health Check '%s' is SERVING", in.Service) - return &grpc_health_v1.HealthCheckResponse{ - Status: grpc_health_v1.HealthCheckResponse_SERVING, - }, nil - } - if stat, ok := s.healthStatus[in.Service]; ok { - s.log.Debugf("Health Check '%s' is `%s'", in.Service, stat) - return &grpc_health_v1.HealthCheckResponse{ - Status: stat, - }, nil - } - err := status.Error(codes.NotFound, "unknown service: "+in.Service) - - s.log.Infof("Health Check failed: %v", err) - return nil, err -} - -func (s *HealthCheckingService) Watch(in *grpc_health_v1.HealthCheckRequest, w grpc_health_v1.Health_WatchServer) error { - s.log.Infof("Health Check watch not supported") - return status.Error(codes.Unimplemented, "watch not supported") -} diff --git a/grpchealth/logger.go b/grpchealth/logger.go deleted file mode 100644 index e26bffb..0000000 --- a/grpchealth/logger.go +++ /dev/null @@ -1,7 +0,0 @@ -package grpchealth - -import ( - "github.com/datatrails/go-datatrails-common/logger" -) - -type Logger = logger.Logger diff --git a/grpcserver/grpcserver.go b/grpcserver/grpcserver.go deleted file mode 100644 index 280d52c..0000000 --- a/grpcserver/grpcserver.go +++ /dev/null @@ -1,150 +0,0 @@ -package grpcserver - -import ( - "context" - "errors" - "fmt" - "net" - "strings" - - grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" - grpc_otrace "github.com/grpc-ecosystem/go-grpc-middleware/tracing/opentracing" - grpc_validator "github.com/grpc-ecosystem/go-grpc-middleware/validator" - "google.golang.org/grpc" - "google.golang.org/grpc/reflection" - - "github.com/datatrails/go-datatrails-common/grpchealth" - grpcHealth "google.golang.org/grpc/health/grpc_health_v1" -) - -// so we dont have to import grpc when using this package. -type grpcServer = grpc.Server -type grpcUnaryServerInterceptor = grpc.UnaryServerInterceptor - -type RegisterServer func(*grpcServer) - -func defaultRegisterServer(g *grpcServer) {} - -type GRPCServer struct { - name string - log Logger - listenStr string - health bool - healthService *grpchealth.HealthCheckingService - interceptors []grpcUnaryServerInterceptor - register RegisterServer - server *grpcServer - reflection bool -} - -type GRPCServerOption func(*GRPCServer) - -func WithAppendedInterceptor(i grpcUnaryServerInterceptor) GRPCServerOption { - return func(g *GRPCServer) { - g.interceptors = append(g.interceptors, i) - } -} - -func WithPrependedInterceptor(i grpcUnaryServerInterceptor) GRPCServerOption { - return func(g *GRPCServer) { - g.interceptors = append([]grpcUnaryServerInterceptor{i}, g.interceptors...) - } -} - -func WithRegisterServer(r RegisterServer) GRPCServerOption { - return func(g *GRPCServer) { - g.register = r - } -} - -func WithoutHealth() GRPCServerOption { - return func(g *GRPCServer) { - g.health = false - } -} - -func WithReflection(r bool) GRPCServerOption { - return func(g *GRPCServer) { - g.reflection = r - } -} - -func tracingFilter(ctx context.Context, fullMethodName string) bool { - if fullMethodName == grpcHealth.Health_Check_FullMethodName { - return false - } - return true -} - -// New creates a new GRPCServer that is bound to a specific GRPC API. This object complies with -// the standard Listener service and can be managed by the startup.Listeners object. -func New(log Logger, name string, port string, opts ...GRPCServerOption) GRPCServer { - - g := GRPCServer{ - name: strings.ToLower(name), - listenStr: fmt.Sprintf(":%s", port), - register: defaultRegisterServer, - interceptors: []grpc.UnaryServerInterceptor{ - grpc_otrace.UnaryServerInterceptor(grpc_otrace.WithFilterFunc(tracingFilter)), - grpc_validator.UnaryServerInterceptor(), - }, - health: true, - } - for _, opt := range opts { - opt(&g) - } - server := grpc.NewServer( - grpc.UnaryInterceptor( - grpc_middleware.ChainUnaryServer(g.interceptors...), - ), - ) - - g.register(server) - - if g.health { - healthService := grpchealth.New(log) - g.healthService = &healthService - grpcHealth.RegisterHealthServer(server, g.healthService) - } - - if g.reflection { - reflection.Register(server) - } - - g.server = server - g.log = log.WithIndex("grpcserver", g.String()) - return g -} - -func (g *GRPCServer) String() string { - // No logging in this method please. - return fmt.Sprintf("%s%s", g.name, g.listenStr) -} - -func (g *GRPCServer) Listen() error { - listen, err := net.Listen("tcp", g.listenStr) - if err != nil { - return fmt.Errorf("failed to listen %s: %w", g, err) - } - - if g.healthService != nil { - g.healthService.Ready() // readiness - } - - g.log.Infof("Listen") - err = g.server.Serve(listen) - if err != nil && !errors.Is(err, context.Canceled) { - return fmt.Errorf("failed to serve %s: %w", g, err) - } - return nil -} - -func (g *GRPCServer) Shutdown(_ context.Context) error { - g.log.Infof("Shutdown") - if g.healthService != nil { - g.healthService.NotReady() // readiness - g.healthService.Dead() // liveness - } - g.server.GracefulStop() - return nil -} diff --git a/grpcserver/logger.go b/grpcserver/logger.go deleted file mode 100644 index 2975292..0000000 --- a/grpcserver/logger.go +++ /dev/null @@ -1,7 +0,0 @@ -package grpcserver - -import ( - "github.com/datatrails/go-datatrails-common/logger" -) - -type Logger = logger.Logger diff --git a/httpserver/httpserver.go b/httpserver/httpserver.go deleted file mode 100644 index 64b12f8..0000000 --- a/httpserver/httpserver.go +++ /dev/null @@ -1,114 +0,0 @@ -package httpserver - -import ( - "context" - "errors" - "fmt" - "net/http" - "reflect" - "strings" - "time" -) - -var ( - ErrNilHandler = errors.New("Nil Handler") - ErrNilHandlerValue = errors.New("Nil Handler value") - ErrHandlerFuncReturnsNil = errors.New("Handler function returns nil") -) - -type HandleChainFunc func(http.Handler) http.Handler - -// A http server that has an inbuilt logger, name and complies wuth the Listener interface in -// startup.Listeners. - -type Server struct { - log Logger - name string - server http.Server - handler http.Handler - handlers []HandleChainFunc -} - -type ServerOption func(*Server) - -// WithHandlers adds a handler on the http endpoint. If the handler is nil -// then an error will occur when executing the Listen() method. -func WithHandlers(handlers ...HandleChainFunc) ServerOption { - return func(s *Server) { - s.handlers = append(s.handlers, handlers...) - } -} - -// WithOptionalHandlers adds a handler on the http endpoint. If the handler is nil -// it is ignored. -func WithOptionalHandlers(handlers ...HandleChainFunc) ServerOption { - return func(s *Server) { - for i := range len(handlers) { - handler := handlers[i] - if handler != nil && !reflect.ValueOf(handler).IsNil() { - s.handlers = append(s.handlers, handler) - } - } - } -} - -// New creates a new httpserver. -func New(log Logger, name string, port string, h http.Handler, opts ...ServerOption) *Server { - s := Server{ - server: http.Server{ - Addr: ":" + port, - }, - handler: h, - name: strings.ToLower(name), - } - s.log = log.WithIndex("httpserver", s.String()) - for _, opt := range opts { - opt(&s) - } - // It is preferable to return a copy rather than a reference. Unfortunately http.Server has an - // internal mutex and this cannot or should not be copied so we will return a reference instead. - return &s -} - -func (s *Server) String() string { - // No logging here please - return fmt.Sprintf("%s%s", s.name, s.server.Addr) -} - -func (s *Server) Listen() error { - s.log.Infof("Listen") - h := s.handler - for i, handler := range s.handlers { - s.log.Debugf("%d: handler %v", i, handler) - if handler == nil { - return ErrNilHandler - } - if reflect.ValueOf(handler).IsNil() { - return ErrNilHandlerValue - } - h1 := handler(h) - if h1 == nil { - return ErrHandlerFuncReturnsNil - } - h = h1 - } - s.server.Handler = h - - // this is a blocking operation - err := s.server.ListenAndServe() - if err != nil { - return fmt.Errorf("%s server terminated: %v", s, err) - } - return nil -} - -func (s *Server) Shutdown(ctx context.Context) error { - ctx, cancel := context.WithTimeout(ctx, 5*time.Second) - defer cancel() - s.log.Infof("Shutdown") - err := s.server.Shutdown(ctx) - if err != nil && !errors.Is(err, http.ErrServerClosed) && !errors.Is(err, context.Canceled) { - return err - } - return nil -} diff --git a/httpserver/logger.go b/httpserver/logger.go deleted file mode 100644 index 20a6841..0000000 --- a/httpserver/logger.go +++ /dev/null @@ -1,7 +0,0 @@ -package httpserver - -import ( - "github.com/datatrails/go-datatrails-common/logger" -) - -type Logger = logger.Logger diff --git a/k8sworker/k8soptions.go b/k8sworker/k8soptions.go deleted file mode 100644 index d709139..0000000 --- a/k8sworker/k8soptions.go +++ /dev/null @@ -1,25 +0,0 @@ -package k8sworker - -type K8sOptions struct { - - // logger used for GoMaxProcs - logger func(string, ...any) -} - -type K8sOption func(*K8sOptions) - -// WithLogger sets the optional logger for goMaxProcs -func WithLogger(logger func(string, ...any)) K8sOption { - return func(ko *K8sOptions) { ko.logger = logger } -} - -// ParseOptions parses the given options into a K8sOptions struct -func ParseOptions(options ...K8sOption) K8sOptions { - k8sOptions := K8sOptions{} - - for _, option := range options { - option(&k8sOptions) - } - - return k8sOptions -} diff --git a/k8sworker/k8sworker.go b/k8sworker/k8sworker.go deleted file mode 100644 index 7c50ab7..0000000 --- a/k8sworker/k8sworker.go +++ /dev/null @@ -1,109 +0,0 @@ -package k8sworker - -import ( - "log/slog" - "runtime" - "runtime/debug" - - "github.com/KimMachineGun/automemlimit/memlimit" - "go.uber.org/automaxprocs/maxprocs" -) - -var ( - undoMaxProcs func() -) - -// K8sConfig sets the cpu and memory -// -// go configuration for kubernetes. -type K8sConfig struct { - GoMaxProcs int - - GoMemLimit int64 - - GoVersion string -} - -func NewK8Config(opts ...K8sOption) (*K8sConfig, error) { - - options := ParseOptions(opts...) - - k8Config := K8sConfig{ - GoVersion: runtime.Version(), - } - - // first set the go mem limit - var err error - if options.logger != nil { - - _, err = memlimit.SetGoMemLimitWithOpts( - memlimit.WithRatio(0.9), - memlimit.WithProvider(memlimit.FromCgroup), - memlimit.WithLogger(slog.Default()), - ) - } else { - - _, err = memlimit.SetGoMemLimitWithOpts( - memlimit.WithRatio(0.9), - memlimit.WithProvider(memlimit.FromCgroup), - ) - } - - if err != nil { - return nil, err - } - - // Set CPU quota correctly so that stalls on non-existent cores do not occur. - // This must be done as early as possible on task startup - this way all services - // will have this behaviour as this method is called by everyone.. - // - // Refs: https://groups.google.com/forum/#%21topic/prometheus-users/QPQ-UbtvS44 - // https://github.com/golang/go/issues/19378 - // - // To summarise golang applications in kubernetes suffer from intermittent gc - // pauses when the golang application thinks it has access to more cores than - // really available. This results in intermittently high latency when the the - // gc thread stalls when it cannot access the cores it thinks it has.. Both - // Uber and Google noticed this and the solution is to set GOMAXPROCS to the - // number of cores allocated by Kubernetes. This is obtained from the cgroups - // setting and the logic is encapsulated in the automaxprocs package. - // - // At time of writing. archivist has GOMAXPROCS set to 4 but the kubernetes - // setting is 1. This could result in 75% of CPU cycles being lost when the gc - // thread is stalled. - // - // When load testing is implemented, benchmarks should be run and this code - // modified/removed and/or kubernetes limits set more cleverly. - // - // Please note that the runtime.GOMAXPROCS setting will be removed at some - // future date. - // - // See https://github.com/golang/go/issues/33803 for proposal to make this - // go away so that automaxprocs is no longer reqyuired. - k8Config.GoMaxProcs = runtime.GOMAXPROCS(-1) - - // modified/removed and/or kubernetes limits set more cleverly. - - if options.logger != nil { - - undoMaxProcs, err = maxprocs.Set(maxprocs.Logger(options.logger)) - } else { - - undoMaxProcs, err = maxprocs.Set() - } - - if err != nil { - return nil, err - } - - // If AUTOMEMLIMIT is not set, it defaults to 0.9. (10% is the headroom for memory sources the Go runtime is unaware of.) - // If GOMEMLIMIT is already set or AUTOMEMLIMIT=off, automatic setting og GMEMLIMIT is disabled. - k8Config.GoMemLimit = debug.SetMemoryLimit(-1) - - return &k8Config, nil -} - -// Close undoes any changes to GoMaxProcs. -func Close() { - undoMaxProcs() -} diff --git a/metrics/handler.go b/metrics/handler.go deleted file mode 100644 index aa1ee18..0000000 --- a/metrics/handler.go +++ /dev/null @@ -1,59 +0,0 @@ -package metrics - -import ( - "net/http" - "strings" - "time" -) - -// Tailored Prometheus metrics -const ( - URLPrefix = "archivist" -) - -// we have to intercept the ResponseWriter in order to get the statuscode -type LoggingResponseWriter struct { - http.ResponseWriter - StatusCode int -} - -func (m *Metrics) NewLatencyMetricsHandler(h http.Handler) http.Handler { - - if m == nil { - return h - } - m.log.Debugf("NewLatencyMetricsHandler") - observer := NewLatencyObservers(m) - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - log := m.log.FromContext(r.Context()) - defer log.Close() - - log.Debugf("Request URL Path: '%s'", r.URL.Path) - fields := strings.Split(strings.Trim(r.URL.Path, "/ "), "/") - log.Debugf("Fields: %v (%d)", fields, len(fields)) - if fields[0] != URLPrefix { - h.ServeHTTP(w, r) - return - } - // generate pre-process metrics here... - // nothing at the moment... - - // WriteHeader(int) is not called if our response implicitly returns 200 OK, so - // we default to that status code. - lrw := &LoggingResponseWriter{ - ResponseWriter: w, - StatusCode: http.StatusOK, - } - - start := time.Now() - // process original handler - h.ServeHTTP(lrw, r) - - latency := time.Since(start).Seconds() - - // generate post-process metrics here... - - observer.ObserveRequestsCount(fields, r.Method) - observer.ObserveRequestsLatency(latency, fields, r.Method) - }) -} diff --git a/metrics/logger.go b/metrics/logger.go deleted file mode 100644 index dadadb8..0000000 --- a/metrics/logger.go +++ /dev/null @@ -1,7 +0,0 @@ -package metrics - -import ( - "github.com/datatrails/go-datatrails-common/logger" -) - -type Logger = logger.Logger diff --git a/metrics/metrics.go b/metrics/metrics.go deleted file mode 100644 index f256997..0000000 --- a/metrics/metrics.go +++ /dev/null @@ -1,136 +0,0 @@ -package metrics - -import ( - "fmt" - "net/http" - "strings" - - "github.com/prometheus/client_golang/prometheus" - "github.com/prometheus/client_golang/prometheus/promhttp" -) - -const ( - TenanciesIdentityPrefix = "tenant/" -) - -// CosmosChargeMetric measures cosmos request charge per tenant using inbuilt Set method -func CosmosChargeMetric() *prometheus.GaugeVec { - return prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Name: "archivist_cosmos_charge", - Help: "Cosmos charge by method and resource.", - }, - []string{"method", "resource"}, - ) -} - -// CosmosDurationMetric measures cosmos request duration(ms) per tenant using inbuilt Set method -func CosmosDurationMetric() *prometheus.GaugeVec { - return prometheus.NewGaugeVec( - prometheus.GaugeOpts{ - Name: "archivist_cosmos_duration", - Help: "Cosmos duration by method and resource.", - }, - []string{"method", "resource"}, - ) -} - -// RequestsCounterMetric measures consumption per tenant -func RequestsCounterMetric() *prometheus.CounterVec { - return prometheus.NewCounterVec( - prometheus.CounterOpts{ - Name: "archivist_requests_total", - Help: "Total number of requests by method, service and resource.", - }, - []string{"method", "service", "resource"}, - ) -} - -// RequestsLatencyMetric measures an SLA "95% of all requests must be made in less than 100ms" and to -// plot average response latency and the apdex score. -// https://www.bookstack.cn/read/prometheus-en/1e87bb1c6ea1f003.md -// bucket limits are in seconds... -func RequestsLatencyMetric() *prometheus.HistogramVec { - return prometheus.NewHistogramVec( - prometheus.HistogramOpts{ - Name: "archivist_requests_latency", - Help: "Histogram of time to reply to request.", - Buckets: []float64{.005, .01, .02, .04, .08, .16, .32}, - }, - []string{"method", "service", "resource"}, - ) -} - -// create metric according to duration. -// DurationMetric measures an SLA "95% of all confirmations must be made in less than 5minutes" and to -// plot average confirmation time and the apdex score. -// https://www.bookstack.cn/read/prometheus-en/1e87bb1c6ea1f003.md -// bucket limits are in seconds... and may be different for simple hash, merkle log or other duration metrics. -func NewDurationMetric(name string, buckets []float64) *prometheus.HistogramVec { - return prometheus.NewHistogramVec( - prometheus.HistogramOpts{ - Name: fmt.Sprintf("archivist_%s_duration", name), - Help: fmt.Sprintf("Histogram of duration of a %s event.", name), - Buckets: buckets, - }, - []string{"operation"}, - ) -} - -// Metrics. Only those metrics specified -// are returned. The GoCollector and ProcessCollector metrics are omitted by -// using our own registry. -type Metrics struct { - serviceName string - port string - registry *prometheus.Registry - labels []latencyObserveOffset - log Logger -} - -type MetricsOption func(*Metrics) - -func WithLabel(label string, offset int) MetricsOption { - return func(m *Metrics) { - m.labels = append(m.labels, latencyObserveOffset{label: label, offset: offset}) - } -} - -func New(log Logger, serviceName string, port string, opts ...MetricsOption) *Metrics { - var m Metrics - return new_(&m, log, serviceName, port, opts...) -} - -func new_(m *Metrics, log Logger, serviceName string, port string, opts ...MetricsOption) *Metrics { - m.log = log - m.serviceName = strings.ToLower(serviceName) - m.registry = prometheus.NewRegistry() - m.labels = []latencyObserveOffset{} - m.port = port - for _, opt := range opts { - opt(m) - } - return m -} - -func (m *Metrics) String() string { - return m.serviceName -} - -func (m *Metrics) Register(cs ...prometheus.Collector) { - m.registry.MustRegister(cs...) -} - -func (m *Metrics) Port() string { - if m != nil { - return m.port - } - return "" -} - -// NewPromHandler - this handler is used on the endpoint that serves metrics endpoint -// which is provided on a different port to the service. -// The default InstrumentMetricHandler is suppressed. -func (m *Metrics) NewPromHandler() http.Handler { - return promhttp.HandlerFor(m.registry, promhttp.HandlerOpts{}) -} diff --git a/metrics/observers.go b/metrics/observers.go deleted file mode 100644 index 5b8b84c..0000000 --- a/metrics/observers.go +++ /dev/null @@ -1,61 +0,0 @@ -package metrics - -import ( - "strings" - - "github.com/prometheus/client_golang/prometheus" -) - -type Prometheus interface { -} - -type latencyObserveOffset struct { - label string - offset int -} - -// Latency observers -type LatencyObservers struct { - requestsCounter *prometheus.CounterVec - requestsLatency *prometheus.HistogramVec - serviceName string - labels []latencyObserveOffset - log Logger -} - -// NewLatencyObservers is specific to calculating the network latency and packet count. -func NewLatencyObservers(m *Metrics) LatencyObservers { - - o := LatencyObservers{ - log: m.log, - requestsCounter: RequestsCounterMetric(), - requestsLatency: RequestsLatencyMetric(), - serviceName: strings.ToLower(m.serviceName), - labels: m.labels, - } - - m.Register(o.requestsCounter, o.requestsLatency) - return o -} - -func (o *LatencyObservers) ObserveRequestsCount(fields []string, method string) { - - for _, label := range o.labels { - if len(fields) > label.offset && fields[label.offset] == label.label { - o.log.Infof("Count %s: %s", label.label, method) - o.requestsCounter.WithLabelValues(method, o.serviceName, label.label).Inc() - return - } - } -} - -func (o *LatencyObservers) ObserveRequestsLatency(elapsed float64, fields []string, method string) { - - for _, label := range o.labels { - if len(fields) > label.offset && fields[label.offset] == label.label { - o.log.Infof("Latency %v %s: %s", elapsed, label.label, method) - o.requestsLatency.WithLabelValues(method, o.serviceName, label.label).Observe(elapsed) - return - } - } -} diff --git a/readiness/error.go b/readiness/error.go deleted file mode 100644 index 3ea3611..0000000 --- a/readiness/error.go +++ /dev/null @@ -1,22 +0,0 @@ -package readiness - -type UnrecoverableError struct { - desc string - err error -} - -func (e *UnrecoverableError) Error() string { - return e.desc + ": " + e.err.Error() -} - -func (e *UnrecoverableError) Unwrap() error { - return e.err -} - -// NewUnrecoverableError creates an Error object that is not recoverable -func NewUnrecoverableError(err error) error { - return &UnrecoverableError{ - desc: "Unrecoverable", - err: err, - } -} diff --git a/readiness/repeat.go b/readiness/repeat.go deleted file mode 100644 index 717904d..0000000 --- a/readiness/repeat.go +++ /dev/null @@ -1,44 +0,0 @@ -package readiness - -// For utilities that assist checking if other things are ready or repeating -// things until they are. - -import ( - "context" - "errors" - "time" - - "github.com/datatrails/go-datatrails-common/logger" -) - -// Repeat repeatedly calls func until it returns without a recoverable error -// or attempts are exhausted. attempts = -1 to try forever. interval is the delay between -// attempts. -func Repeat(ctx context.Context, attempts int, interval time.Duration, f func() error) error { - var err error - - log := logger.Sugar.FromContext(ctx) - defer log.Close() - - for i := 0; ; i++ { - err = f() - if err == nil { - return nil - } - - // exit early if error is unrecoverable - var e *UnrecoverableError - if errors.As(err, &e) { - return err - } - - if attempts > -1 && i >= (attempts-1) { - break - } - log.Debugf("retrying ... count: %d interval: %s err: %v", i, interval, err) - - time.Sleep(interval) - } - - return err -} diff --git a/restproxyserver/defaulthttperrorhandler.go b/restproxyserver/defaulthttperrorhandler.go deleted file mode 100644 index 59ccf91..0000000 --- a/restproxyserver/defaulthttperrorhandler.go +++ /dev/null @@ -1,12 +0,0 @@ -package restproxyserver - -import ( - "context" - "net/http" - - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" -) - -func DefaultHTTPErrorHandler(ctx context.Context, mux *ServeMux, marshaler Marshaler, w http.ResponseWriter, r *http.Request, err error) { - runtime.DefaultHTTPErrorHandler(ctx, mux, marshaler, w, r, err) -} diff --git a/restproxyserver/logger.go b/restproxyserver/logger.go deleted file mode 100644 index 3ca9872..0000000 --- a/restproxyserver/logger.go +++ /dev/null @@ -1,7 +0,0 @@ -package restproxyserver - -import ( - "github.com/datatrails/go-datatrails-common/logger" -) - -type Logger = logger.Logger diff --git a/restproxyserver/restproxyserver.go b/restproxyserver/restproxyserver.go deleted file mode 100644 index 67f1593..0000000 --- a/restproxyserver/restproxyserver.go +++ /dev/null @@ -1,250 +0,0 @@ -package restproxyserver - -import ( - "context" - "errors" - "fmt" - "net/http" - "reflect" - "strings" - - env "github.com/datatrails/go-datatrails-common/environment" - "github.com/datatrails/go-datatrails-common/httpserver" - "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" - - "google.golang.org/grpc" -) - -const ( - defaultGRPCHost = "localhost" - MIMEWildcard = runtime.MIMEWildcard -) - -var ( - ErrNilRegisterer = errors.New("Nil Registerer") - ErrNilRegistererValue = errors.New("Nil Registerer value") -) - -type Marshaler = runtime.Marshaler -type ServeMux = runtime.ServeMux -type QueryParameterParser = runtime.QueryParameterParser -type HeaderMatcherFunc = runtime.HeaderMatcherFunc -type ErrorHandlerFunc = runtime.ErrorHandlerFunc -type DialOption = grpc.DialOption - -type RegisterRESTProxyServer func(context.Context, *ServeMux, string, []DialOption) error - -type HandleChainFunc = httpserver.HandleChainFunc - -type filePath struct { - verb string - urlPath string - fileHandler func(http.ResponseWriter, *http.Request, map[string]string) -} - -// RESTProxyServer represents the grpc-gateway rest serve endpoint. -type RESTProxyServer struct { - name string - port string - log Logger - grpcAddress string - grpcHost string - dialOptions []DialOption - options []runtime.ServeMuxOption - filePaths []filePath - handlers []HandleChainFunc - registers []RegisterRESTProxyServer - mux *runtime.ServeMux - server *httpserver.Server -} - -type RESTProxyServerOption func(*RESTProxyServer) - -// WithMarshaler specifies an optional marshaler. -func WithMarshaler(mime string, m Marshaler) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.options = append(g.options, runtime.WithMarshalerOption(mime, m)) - } -} - -// SetQueryParameterParser adds an intercepror that matches header values. -func SetQueryParameterParser(p QueryParameterParser) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.options = append(g.options, runtime.SetQueryParameterParser(p)) - } -} - -// WithIncomingHeaderMatcher adds an interceptor that matches header values. -func WithIncomingHeaderMatcher(o HeaderMatcherFunc) RESTProxyServerOption { - return func(g *RESTProxyServer) { - if o != nil && !reflect.ValueOf(o).IsNil() { - g.options = append(g.options, runtime.WithIncomingHeaderMatcher(o)) - } - } -} - -// WithOutgoingHeaderMatcher matches header values on output. Nil argument is ignored. -func WithOutgoingHeaderMatcher(o HeaderMatcherFunc) RESTProxyServerOption { - return func(g *RESTProxyServer) { - if o != nil && !reflect.ValueOf(o).IsNil() { - g.options = append(g.options, runtime.WithOutgoingHeaderMatcher(o)) - } - } -} - -// WithErrorHandler adds error handling in special cases - e.g on 402 or 429. Nil argument is ignored. -func WithErrorHandler(o ErrorHandlerFunc) RESTProxyServerOption { - return func(g *RESTProxyServer) { - if o != nil && !reflect.ValueOf(o).IsNil() { - g.options = append(g.options, runtime.WithErrorHandler(o)) - } - } -} - -// WithGRPCAddress - overides the defaultGRPCAddress ('localhost:') -func WithGRPCAddress(a string) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.grpcAddress = a - } -} - -// WithRegisterHandlers adds grpc-gateway handlers. A nil value will emit an -// error from the Listen() method. -func WithRegisterHandlers(registerers ...RegisterRESTProxyServer) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.registers = append(g.registers, registerers...) - } -} - -// WithOptionalRegisterHandler adds grpc-gateway handlers. A nil value will be -// ignored. -func WithOptionalRegisterHandlers(registerers ...RegisterRESTProxyServer) RESTProxyServerOption { - return func(g *RESTProxyServer) { - for i := range len(registerers) { - registerer := registerers[i] - if registerer != nil && !reflect.ValueOf(registerer).IsNil() { - g.registers = append(g.registers, registerer) - } - } - } -} - -// WithHTTPHandlers adds handlers on the http endpoint. A nil value will -// return an error on executiong Listen() -func WithHTTPHandlers(handlers ...HandleChainFunc) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.handlers = append(g.handlers, handlers...) - } -} - -// WithOptionalHTTPHandlers adds handlers on the http endpoint. A nil value will -// be ignored. -func WithOptionalHTTPHandlers(handlers ...HandleChainFunc) RESTProxyServerOption { - return func(g *RESTProxyServer) { - for i := range len(handlers) { - handler := handlers[i] - if handler != nil && !reflect.ValueOf(handler).IsNil() { - g.handlers = append(g.handlers, handler) - } - } - } -} - -// WithAppendedDialOption appends a grpc dial option. -func WithAppendedDialOption(d DialOption) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.dialOptions = append(g.dialOptions, d) - } -} - -// WithPrependedDialOption prepends a grpc dial option. -func WithPrependedDialOptions(d ...DialOption) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.dialOptions = append(d, g.dialOptions...) - } -} - -// WithHandlePath add REST file path handler. -func WithHandlePath(verb string, urlPath string, f func(http.ResponseWriter, *http.Request, map[string]string)) RESTProxyServerOption { - return func(g *RESTProxyServer) { - g.filePaths = append( - g.filePaths, - filePath{ - verb: verb, - urlPath: urlPath, - fileHandler: f, - }, - ) - } -} - -// New creates a new RESTProxyServer that is bound to a specific GRPC Gateway API. This object complies with -// the standard Listener interface and can be managed by the startup.Listeners object. -func New(log Logger, name string, port string, opts ...RESTProxyServerOption) RESTProxyServer { - - g := RESTProxyServer{ - name: strings.ToLower(name), - port: port, - dialOptions: []grpc.DialOption{}, - options: []runtime.ServeMuxOption{}, - filePaths: []filePath{}, - handlers: []HandleChainFunc{}, - registers: []RegisterRESTProxyServer{}, - } - g.log = log.WithIndex("restproxyserver", g.String()) - for _, opt := range opts { - opt(&g) - } - - if g.grpcAddress == "" { - port := env.GetOrFatal("PORT") - g.grpcAddress = fmt.Sprintf("localhost:%s", port) - } - - g.mux = runtime.NewServeMux(g.options...) - return g -} - -func (g *RESTProxyServer) String() string { - // No logging in this method please. - return fmt.Sprintf("%s:%s", g.name, g.port) -} - -func (g *RESTProxyServer) Listen() error { - - for _, p := range g.filePaths { - err := g.mux.HandlePath(p.verb, p.urlPath, p.fileHandler) - if err != nil { - return fmt.Errorf("cannot handle path %s: %w", p.urlPath, err) - } - } - - for _, register := range g.registers { - if register == nil { - return ErrNilRegisterer - } - if reflect.ValueOf(register).IsNil() { - return ErrNilRegistererValue - } - err := register(context.Background(), g.mux, g.grpcAddress, g.dialOptions) - if err != nil { - return err - } - } - g.server = httpserver.New( - g.log, - fmt.Sprintf("proxy %s", g.name), - g.port, - g.mux, - httpserver.WithHandlers(g.handlers...), - ) - - g.log.Debugf("server %v", g.server) - g.log.Infof("Listen") - return g.server.Listen() -} - -func (g *RESTProxyServer) Shutdown(ctx context.Context) error { - g.log.Infof("Shutdown") - return g.server.Shutdown(ctx) -} diff --git a/startup/listener.go b/startup/listener.go deleted file mode 100644 index e701218..0000000 --- a/startup/listener.go +++ /dev/null @@ -1,116 +0,0 @@ -package startup - -import ( - "context" - "errors" - "fmt" - "os/signal" - "reflect" - "strings" - "syscall" - "time" - - "golang.org/x/sync/errgroup" -) - -var ( - ErrNilListener = errors.New("Nil Listener") - ErrNilListenerValue = errors.New("Nil Listener value") -) - -// based on gist found at https://gist.github.com/pteich/c0bb58b0b7c8af7cc6a689dd0d3d26ef?permalink_comment_id=4053701 - -// Listener is an interface that describes any kind of listener - HTTP Server, GRPC Server -// or servicebus receiver. -type Listener interface { - Listen() error - Shutdown(context.Context) error -} - -// Listeners contains all servers that comply with the service. -type Listeners struct { - name string - log Logger - listeners []Listener -} - -type ListenersOption func(*Listeners) - -// WithListeners add multiple listeners. Nil listeners will cause -// an error to be returned. -func WithListeners(listeners ...Listener) ListenersOption { - return func(l *Listeners) { - l.listeners = append(l.listeners, listeners...) - } -} - -func NewListeners(log Logger, name string, opts ...ListenersOption) Listeners { - l := Listeners{name: strings.ToLower(name)} - for _, opt := range opts { - opt(&l) - } - l.log = log.WithIndex("listener", l.String()) - return l -} - -func (l *Listeners) String() string { - return l.name -} - -func (l *Listeners) Listen() error { - - ctx, stop := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM) - defer stop() - - g, errCtx := errgroup.WithContext(ctx) - - for i := range l.listeners { - h := l.listeners[i] - if h == nil { - return ErrNilListener - } - if reflect.ValueOf(h).IsNil() { - return ErrNilListenerValue - } - l.log.Debugf("Start %d %s", i, h) - g.Go(func() error { - err := h.Listen() - if err != nil { - return err - } - return nil - }) - } - - g.Go(func() error { - <-errCtx.Done() - l.log.Infof("Cancel from signal") - return l.Shutdown() - }) - - err := g.Wait() - if err != nil && !errors.Is(err, context.Canceled) { - return err - } - - return nil -} - -func (l *Listeners) Shutdown() error { - var err error - for _, h := range l.listeners { - func() { - ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) - defer cancel() - e := h.Shutdown(ctx) - if e != nil { - if err != nil { - err = fmt.Errorf("Cannot shutdown %s: %w: %w", h, err, e) - } else { - err = fmt.Errorf("Cannot shutdown %s: %w", h, e) - } - } - }() - } - return err -} diff --git a/startup/logger.go b/startup/logger.go deleted file mode 100644 index ff304f8..0000000 --- a/startup/logger.go +++ /dev/null @@ -1,7 +0,0 @@ -package startup - -import ( - "github.com/datatrails/go-datatrails-common/logger" -) - -type Logger = logger.Logger diff --git a/startup/run.go b/startup/run.go deleted file mode 100644 index c8ab233..0000000 --- a/startup/run.go +++ /dev/null @@ -1,85 +0,0 @@ -// Package startup is intended as a helper package to -// run services in go routines in main -package startup - -import ( - "os" - - "github.com/datatrails/go-datatrails-common/environment" - "github.com/datatrails/go-datatrails-common/k8sworker" - "github.com/datatrails/go-datatrails-common/logger" - "github.com/datatrails/go-datatrails-common/tracing" -) - -const ( - restProxyPort = "RESTPROXY_PORT" - port = "PORT" -) - -type runOptions struct { - portName string -} - -type RunOption func(*runOptions) - -func UseRestproxyTracingPort() RunOption { - return func(o *runOptions) { - o.portName = restProxyPort - } -} - -func NoTracingPort() RunOption { - return func(o *runOptions) { - o.portName = "" - } -} - -type Runner func(logger.Logger) error - -// defers do not work in main() because of the os.Exit( -func Run(serviceName string, run Runner, opts ...RunOption) { - - logger.New(environment.GetLogLevel()) - log := logger.Sugar.WithServiceName(serviceName) - - o := runOptions{portName: port} - - for _, opt := range opts { - opt(&o) - } - - exitCode := func() int { - var exitCode int - var err error - // ensure we configure go max procs and memlimit - // for kubernetes. - k8Config, err := k8sworker.NewK8Config(k8sworker.WithLogger(log.Infof)) - if err != nil { - log.Infof("Error configuring go for kubernetes: %v", err) - return 1 - } - defer k8sworker.Close() - - // log the useful kubernetes go configuration - log.Infof("Go Configuration: %+v", k8Config) - - if o.portName != "" { - closer := tracing.NewTracer(log, o.portName) - if closer != nil { - defer closer.Close() - } - } - err = run(log) - if err != nil { - log.Infof("Error at startup: %v", err) - exitCode = 1 - } - return exitCode - }() - - log.Infof("Shutting down") - logger.OnExit() - - os.Exit(exitCode) - -} diff --git a/tenantid/tenantID.go b/tenantid/tenantID.go deleted file mode 100644 index af20d4e..0000000 --- a/tenantid/tenantID.go +++ /dev/null @@ -1,25 +0,0 @@ -package tenantid - -import ( - "net/http" -) - -const ( - grpcMetadataHeaderKey = "grpc-metadata-archivist-internal-tenant-id" - headerKey = "archivist-internal-tenant-id" - Prefix = "tenant/" -) - -func GetTenantIDFromHeader(h http.Header) string { - t := h.Get(headerKey) - if t != "" { - return t - } - t = h.Get(grpcMetadataHeaderKey) - return t -} - -func DeleteTenantIDFromHeader(h http.Header) { - h.Del(headerKey) - h.Del(grpcMetadataHeaderKey) -}