From 3df2387b2200d251a1f3eb0cc0d22164790be57f Mon Sep 17 00:00:00 2001 From: fogfish Date: Sat, 9 Mar 2024 18:38:53 +0200 Subject: [PATCH] update deps with refactoring of api changes (#45) --- go.mod | 45 +++++++++--------- go.sum | 93 ++++++++++++++++++++----------------- internal/storage/storage.go | 32 +++++-------- 3 files changed, 87 insertions(+), 83 deletions(-) diff --git a/go.mod b/go.mod index f4a46df..74fd6e6 100644 --- a/go.mod +++ b/go.mod @@ -4,38 +4,41 @@ go 1.20 require ( github.com/ajg/form v1.5.2-0.20200323032839-9aeb3cf462e1 // indirect - github.com/aws/aws-cdk-go/awscdk/v2 v2.67.0 - github.com/aws/aws-lambda-go v1.38.0 - github.com/aws/constructs-go/constructs/v10 v10.1.270 - github.com/aws/jsii-runtime-go v1.77.0 - github.com/fogfish/it v1.0.0 // indirect + github.com/aws/aws-cdk-go/awscdk/v2 v2.132.0 + github.com/aws/aws-lambda-go v1.46.0 + github.com/aws/constructs-go/constructs/v10 v10.3.0 + github.com/aws/jsii-runtime-go v1.95.0 github.com/fogfish/scud v0.6.0 ) require ( github.com/fogfish/faults v0.2.0 - github.com/fogfish/gouldian/v2 v2.0.1 - github.com/fogfish/guid/v2 v2.0.2 - github.com/fogfish/gurl/v2 v2.5.0 + github.com/fogfish/gouldian/v2 v2.0.5 + github.com/fogfish/guid/v2 v2.0.4 + github.com/fogfish/gurl/v2 v2.8.2 github.com/fogfish/it/v2 v2.0.1 - github.com/fogfish/schemaorg v1.14.1 - github.com/fogfish/skiplist v0.9.2 + github.com/fogfish/schemaorg v1.22.0 + github.com/fogfish/skiplist v0.15.0 github.com/golang/mock v1.6.0 ) require ( - github.com/Masterminds/semver/v3 v3.2.0 // indirect - github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.97 // indirect - github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.1 // indirect - github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv5/v2 v2.0.77 // indirect - github.com/fogfish/golem v0.9.2 // indirect + github.com/Masterminds/semver/v3 v3.2.1 // indirect + github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 // indirect + github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 // indirect + github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 // indirect + github.com/fatih/color v1.16.0 // indirect + github.com/fogfish/golem/hseq v1.1.2 // indirect + github.com/fogfish/golem/optics v0.11.2 // indirect + github.com/fogfish/golem/trait v0.2.0 // indirect github.com/fogfish/logger v1.1.0 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/yuin/goldmark v1.5.4 // indirect golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect - golang.org/x/mod v0.9.0 // indirect - golang.org/x/net v0.8.0 // indirect - golang.org/x/sys v0.6.0 // indirect - golang.org/x/tools v0.7.0 // indirect + golang.org/x/mod v0.14.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/tools v0.17.0 // indirect ) diff --git a/go.sum b/go.sum index d78ef76..926725e 100644 --- a/go.sum +++ b/go.sum @@ -1,53 +1,61 @@ -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/semver/v3 v3.2.1 h1:RN9w6+7QoMeJVGyfmbcgs28Br8cvmnucEXnY0rYXWg0= +github.com/Masterminds/semver/v3 v3.2.1/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/ajg/form v1.5.2-0.20200323032839-9aeb3cf462e1 h1:8Qzi+0Uch1VJvdrOhJ8U8FqoPLbUdETPgMqGJ6DSMSQ= github.com/ajg/form v1.5.2-0.20200323032839-9aeb3cf462e1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/aws/aws-cdk-go/awscdk/v2 v2.67.0 h1:fKxY8oYygqp5rScwd6SaPLVM85uK3WrFDOcknn/zo3Q= -github.com/aws/aws-cdk-go/awscdk/v2 v2.67.0/go.mod h1:VUgy7k4jFLyep9Mm4f1aKLpji2w5nQs7mxDrw49SN40= -github.com/aws/aws-lambda-go v1.38.0 h1:4CUdxGzvuQp0o8Zh7KtupB9XvCiiY8yKqJtzco+gsDw= -github.com/aws/aws-lambda-go v1.38.0/go.mod h1:jwFe2KmMsHmffA1X2R09hH6lFzJQxzI8qK17ewzbQMM= -github.com/aws/constructs-go/constructs/v10 v10.1.270 h1:MDjG2YpaauSCjl230HLRo+AD6vNclPv148zkFEn4cSc= -github.com/aws/constructs-go/constructs/v10 v10.1.270/go.mod h1:0kRYiOOoiEo4YOzVYzonyhdYs78G89qLl0YeasyIONA= -github.com/aws/jsii-runtime-go v1.77.0 h1:jhb0H395us+QzIG3yUuzgoP63cL2YQPnSlMQ572WoYM= -github.com/aws/jsii-runtime-go v1.77.0/go.mod h1:1YWJ9VJ3bwe03Nsq2rsGFA0uQIiJZo0FEKfxK6j7cGg= -github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.97 h1:djh/IxEOenTcd3r5PqdI/oG+0DejpcDFgc7YzCjVQW4= -github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.97/go.mod h1:PkuOc2PJS/vvkezj7ROedaZ9RrIH6BFy07izhAn4ZQ8= -github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.1 h1:l5N27aCCjAB5cgW5pI4/ujnasPL8hUcJ9KBxrKk6UiQ= -github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.1/go.mod h1:CvFHBo0qcg8LUkJqIxQtP1rD/sNGv9bX3L2vHT2FUAo= -github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv5/v2 v2.0.77 h1:Dz48ATZZyiWfGc93tUyCZh7Aoquno5G7g/azPYnlRdI= -github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv5/v2 v2.0.77/go.mod h1:xuNRPgwJuKObjPrOjEI7kv7A0Z8F1lNiwSdCEFJQfMc= +github.com/aws/aws-cdk-go/awscdk/v2 v2.132.0 h1:eKGjvml5VBFv7EAQHOPBf3KcfkssT5DUiYw0//BotOM= +github.com/aws/aws-cdk-go/awscdk/v2 v2.132.0/go.mod h1:TpmJwOnoajvRtwnLlJoxEoppb9sVoCLfPGLdgoTDH7o= +github.com/aws/aws-lambda-go v1.46.0 h1:UWVnvh2h2gecOlFhHQfIPQcD8pL/f7pVCutmFl+oXU8= +github.com/aws/aws-lambda-go v1.46.0/go.mod h1:dpMpZgvWx5vuQJfBt0zqBha60q7Dd7RfgJv23DymV8A= +github.com/aws/constructs-go/constructs/v10 v10.3.0 h1:LsjBIMiaDX/vqrXWhzTquBJ9pPdi02/H+z1DCwg0PEM= +github.com/aws/constructs-go/constructs/v10 v10.3.0/go.mod h1:GgzwIwoRJ2UYsr3SU+JhAl+gq5j39bEMYf8ev3J+s9s= +github.com/aws/jsii-runtime-go v1.95.0 h1:I43Ye2AI8YNul6aWgtsvE76Vq6K6OzDEnZa/3g+sNtM= +github.com/aws/jsii-runtime-go v1.95.0/go.mod h1:ltYD/GbXiTKFeEUn03Ypwhl75N1Rwj4G2094XHjc+LM= +github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202 h1:VixXB9DnHN8oP7pXipq8GVFPjWCOdeNxIaS/ZyUwTkI= +github.com/cdklabs/awscdk-asset-awscli-go/awscliv1/v2 v2.2.202/go.mod h1:iPUti/SWjA3XAS3CpnLciFjS8TN9Y+8mdZgDfSgcyus= +github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2 h1:k+WD+6cERd59Mao84v0QtRrcdZuuSMfzlEmuIypKnVs= +github.com/cdklabs/awscdk-asset-kubectl-go/kubectlv20/v2 v2.1.2/go.mod h1:CvFHBo0qcg8LUkJqIxQtP1rD/sNGv9bX3L2vHT2FUAo= +github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1 h1:MBBQNKKPJ5GArbctgwpiCy7KmwGjHDjUUH5wEzwIq8w= +github.com/cdklabs/awscdk-asset-node-proxy-agent-go/nodeproxyagentv6/v2 v2.0.1/go.mod h1:/2WiXEft9s8ViJjD01CJqDuyJ8HXBjhBLtK5OvJfdSc= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/fogfish/faults v0.2.0 h1:3KHvZN3cgv2omAGw0MCVH/AbrqxfNag+TFGpgUp6m1w= github.com/fogfish/faults v0.2.0/go.mod h1:PtvzLt9TP4IF/hRkwRp4dZub42oaMrLbxdS6vmSCJOs= -github.com/fogfish/golem v0.9.2 h1:tESSlzo+wih7fLfLFFegKOU8l45Ew9A8a9JU84rGtGY= -github.com/fogfish/golem v0.9.2/go.mod h1:lj7cttUvvjAE4KZU4RzHHw0o2pYozkPqat5ff38u71c= -github.com/fogfish/gouldian/v2 v2.0.1 h1:7rAtSjv/31SRf+dROiTFmsF9UmQysSega54BFq50Yhw= -github.com/fogfish/gouldian/v2 v2.0.1/go.mod h1:m5lLg+DvIFucQ7rzFAWsZ5ZtIuSmnCNBoP3HY+Pncds= -github.com/fogfish/guid/v2 v2.0.2 h1:apsRAnSTkft8izOvLipUstHtWYDmVum7kcunYTR5Kv8= -github.com/fogfish/guid/v2 v2.0.2/go.mod h1:KkZ5T4EE3BqWQJFZBPLSHV/tBe23Xq4KvuPfwtNtepU= -github.com/fogfish/gurl/v2 v2.5.0 h1:S60X6w7mpPkiGL2kbBUgEh7U2o75hfKt5Bv3YnQxgtM= -github.com/fogfish/gurl/v2 v2.5.0/go.mod h1:MMSAHe+Vo+EhJZ6iH1CYeKw64T11G/NAUPK0cZ2RyS4= +github.com/fogfish/golem/hseq v1.1.2 h1:jgmMSo+d3KUAQr87U6coQtrTHNL4RTd0/qTocn4ReAQ= +github.com/fogfish/golem/hseq v1.1.2/go.mod h1:N5y7RLLJyL8iNxFOcD6mkciIBx5TJ9mT1fRszr+ByhQ= +github.com/fogfish/golem/optics v0.11.2 h1:RzHClHoIZsO/HZqs1E6axeNu8e/mn+Q2aSGGVkb9tCM= +github.com/fogfish/golem/optics v0.11.2/go.mod h1:ICzDm+HkWu732lHaHYJTSSEKz9rwyiLKJR/C4QWF0WY= +github.com/fogfish/golem/trait v0.2.0 h1:cgc+5TEpmoYfR3hMZZAJDvp7k9wRrYbrGT93isKHq28= +github.com/fogfish/golem/trait v0.2.0/go.mod h1:MLcG+cb4EQvdvyW/dFUpm+1WWsmS/khiOlfs7Eoe1ko= +github.com/fogfish/gouldian/v2 v2.0.5 h1:ixk6WG/Is8HmphScmpkKZgNjVWXLUuqyEyuBp0jtERw= +github.com/fogfish/gouldian/v2 v2.0.5/go.mod h1:NRPBfFZnGmEOIIRIu9knukoFfrCKXFmXO6GR4MD+BOU= +github.com/fogfish/guid/v2 v2.0.4 h1:EZiPlM4UAghqf7DU5/nLEF+iRH7ODe0AiFuYOMRvITQ= +github.com/fogfish/guid/v2 v2.0.4/go.mod h1:KkZ5T4EE3BqWQJFZBPLSHV/tBe23Xq4KvuPfwtNtepU= +github.com/fogfish/gurl/v2 v2.8.2 h1:VB+3lsNg1i9XPm8pDVaZongNfk17NfS5FG2TFtTeLno= +github.com/fogfish/gurl/v2 v2.8.2/go.mod h1:VDPaGeyMSZsbFByZXwKZuwKgOC1mOQNlOYhM4RgOVWQ= github.com/fogfish/it v0.9.1/go.mod h1:NQJG4Ygvek85y7zGj0Gny8+6ygAnHjfBORhI7TdQhp4= github.com/fogfish/it v1.0.0 h1:kiwFHZcrkRLUydZoIoY0gTuMfj38trwvLo0YRyIkeG8= -github.com/fogfish/it v1.0.0/go.mod h1:NQJG4Ygvek85y7zGj0Gny8+6ygAnHjfBORhI7TdQhp4= github.com/fogfish/it/v2 v2.0.1 h1:vu3kV2xzYDPHoMHMABxXeu5CoMcTfRc4gkWkzOUkRJY= github.com/fogfish/it/v2 v2.0.1/go.mod h1:h5FdKaEQT4sUEykiVkB8VV4jX27XabFVeWhoDZaRZtE= github.com/fogfish/logger v1.1.0 h1:IZncrh4+Q7yyngcIq8lBr2VwcYE2huXcgCPKcT+zPOY= github.com/fogfish/logger v1.1.0/go.mod h1:o9Url3zZMjg87bOJKZTdWIX3aRmClY+3Ld97Jc2Podg= -github.com/fogfish/schemaorg v1.14.1 h1:HItbmxuaoD/tgylPyfIop+8ebJPKSDgmCLeOrYrVy4c= -github.com/fogfish/schemaorg v1.14.1/go.mod h1:CDOmEVSdag/o66Y3qjFROm0mUjJxDvSzAOXQwd+ZFrs= +github.com/fogfish/schemaorg v1.22.0 h1:0laPbToW8lVxdx7hPgc8qukZfrewBJYNf4ffpZn/6HQ= +github.com/fogfish/schemaorg v1.22.0/go.mod h1:CDOmEVSdag/o66Y3qjFROm0mUjJxDvSzAOXQwd+ZFrs= github.com/fogfish/scud v0.6.0 h1:sJsWAvvRcX4kRYYUXbOTw9hyZV+ax01TxpXlHKeTJGg= github.com/fogfish/scud v0.6.0/go.mod h1:7EH9GAGQK4oux9sTMhtSEfEVbism2ED+2gTb/UNFqvs= -github.com/fogfish/skiplist v0.9.2 h1:JCJfJqNPDEq5JSQtvJc2B/9h+JCmBLUYYIhRiAyKld0= -github.com/fogfish/skiplist v0.9.2/go.mod h1:tda0SRPKXYyUIGVDrqsJwn6B18oOYmv1xrnQ+VKTHrc= +github.com/fogfish/skiplist v0.15.0 h1:o3f6I20LsT4D17Vf9eyNyFd5CCGOXo147x1DSi4RbpE= +github.com/fogfish/skiplist v0.15.0/go.mod h1:giiFtWK+lmnpgQQJzWFydHoTTGRzP+8kcBsKoS30iO8= 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/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +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/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= -github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.5.4 h1:2uY/xC0roWy8IBEGLgB1ywIoEJFGmRrX21YQcvGZzjU= github.com/yuin/goldmark v1.5.4/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= @@ -57,24 +65,25 @@ golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhp golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.9.0 h1:KENHtAZL2y3NLMYZeHY9DW8HW8V+kQyJsY/V9JlKvCs= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= -golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= +golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= 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-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -82,8 +91,8 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.7.0 h1:W4OVu8VVOaIO0yzWMNdepAulS7YfoS3Zabrm8DOXXU4= -golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= 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-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/internal/storage/storage.go b/internal/storage/storage.go index 6522f5b..24b53ba 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -6,18 +6,18 @@ import ( "sync" "github.com/fogfish/skiplist" - "github.com/fogfish/skiplist/ord" + // "github.com/fogfish/skiplist/ord" ) -type Cache[K ord.Comparable, V any] struct { +type Cache[K skiplist.Key, V any] struct { lock *sync.Mutex - store *skiplist.SkipList[K, V] + store *skiplist.Map[K, V] } -func New[K ord.Comparable, V any]() *Cache[K, V] { +func New[K skiplist.Key, V any]() *Cache[K, V] { return &Cache[K, V]{ lock: &sync.Mutex{}, - store: skiplist.New[K, V](ord.Type[K]()), + store: skiplist.NewMap[K, V](), } } @@ -25,8 +25,8 @@ func (cache *Cache[K, V]) Get(_ context.Context, key K) (V, error) { cache.lock.Lock() defer cache.lock.Unlock() - val, has := skiplist.Lookup(cache.store, key) - if !has { + val, pair := cache.store.Get(key) + if pair == nil { return val, errNotFound(fmt.Sprintf("%v", key)) } @@ -39,18 +39,10 @@ func (cache *Cache[K, V]) Seq(_ context.Context, afterKey K, size int) ([]V, err seq := make([]V, 0) - _, tail := skiplist.Split(cache.store, afterKey) - if tail == nil { - return seq, nil - } - - for tail.Next() { - _, val := tail.Head() - seq = append(seq, val) - - if len(seq) == size { - return seq, nil - } + _, pair := cache.store.Get(afterKey) + e := skiplist.ForMap(cache.store, pair) + for has := e != nil; has; has = e.Next() { + seq = append(seq, e.Value()) } return seq, nil @@ -60,7 +52,7 @@ func (cache *Cache[K, V]) Set(_ context.Context, key K, val V) error { cache.lock.Lock() defer cache.lock.Unlock() - skiplist.Put(cache.store, key, val) + cache.store.Put(key, val) return nil }