From 83b06047105c4ebca41b642a2686f81f9013b457 Mon Sep 17 00:00:00 2001 From: molon <3739161+molon@users.noreply.github.com> Date: Thu, 26 Sep 2024 10:53:23 +0800 Subject: [PATCH] upgrade relay version --- docs/docsrc/examples/examples_presets/listing.go | 12 +++++++----- go.mod | 2 +- go.sum | 4 ++++ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/docsrc/examples/examples_presets/listing.go b/docs/docsrc/examples/examples_presets/listing.go index 753be42b8..b028a45ef 100644 --- a/docs/docsrc/examples/examples_presets/listing.go +++ b/docs/docsrc/examples/examples_presets/listing.go @@ -199,14 +199,16 @@ func PresetsListingCustomizationFields(b *presets.Builder, db *gorm.DB) ( return }) - aesCursorMiddleware := cursor.AES[any]( - []byte("0123456789abcdef0123456789abcdef"), // 32bytes aes256 - ) + gcm, err := cursor.NewGCM([]byte("0123456789abcdef0123456789abcdef")) + if err != nil { + panic(err) + } + gcmMiddleware := cursor.GCM[any](gcm) cl.RelayPagination( - gorm2op.KeysetBasedPagination(true, aesCursorMiddleware), + gorm2op.KeysetBasedPagination(true, gcmMiddleware), ) comp.Listing().RelayPagination( - gorm2op.KeysetBasedPagination(true, aesCursorMiddleware), + gorm2op.KeysetBasedPagination(true, gcmMiddleware), ) return diff --git a/go.mod b/go.mod index 500aebe03..155aa7384 100644 --- a/go.mod +++ b/go.mod @@ -38,7 +38,7 @@ require ( github.com/theplant/gofixtures v1.1.3 github.com/theplant/htmlgo v1.0.3 github.com/theplant/osenv v0.0.2 - github.com/theplant/relay v0.0.0-20240925143550-df827ef2f86f + github.com/theplant/relay v0.1.1 github.com/theplant/sliceutils v0.0.0-20200406042209-89153d988eb1 github.com/theplant/testenv v0.0.1 github.com/theplant/testingutils v0.0.2 diff --git a/go.sum b/go.sum index d4083b091..19f1465b2 100644 --- a/go.sum +++ b/go.sum @@ -390,6 +390,10 @@ github.com/theplant/osenv v0.0.2 h1:SI2I/gLQQj5pQgpBQ8YKx/u4i7KE7yG2Gmr/ZORuxn8= github.com/theplant/osenv v0.0.2/go.mod h1:gUdlLzvmJb/dyBmXk+qEWiIhAN1tmVhYktzK1HHEz3c= github.com/theplant/relay v0.0.0-20240925143550-df827ef2f86f h1:W5FXgfj6ZpGfXLK5aqERJ/g67DfUz0+CZdj/MLE1WnQ= github.com/theplant/relay v0.0.0-20240925143550-df827ef2f86f/go.mod h1:pF6+UcAs0UEbZ4rnjB8/upjZD8y8xA2iQwqkffkKE2g= +github.com/theplant/relay v0.1.1-0.20240925170047-ffdb230eda6b h1:rRonWmenM0ynNZz9QiJLB+6jioj395OfKXcBOPrDB+s= +github.com/theplant/relay v0.1.1-0.20240925170047-ffdb230eda6b/go.mod h1:pF6+UcAs0UEbZ4rnjB8/upjZD8y8xA2iQwqkffkKE2g= +github.com/theplant/relay v0.1.1 h1:cAyAxcdt6B/xS+DUUz4Q/MJ3xiHt5oBR8jcxDWOIeWs= +github.com/theplant/relay v0.1.1/go.mod h1:pF6+UcAs0UEbZ4rnjB8/upjZD8y8xA2iQwqkffkKE2g= github.com/theplant/sliceutils v0.0.0-20200406042209-89153d988eb1 h1:EP+XW/tiUH8Cr1MSu7wKhpUnt4QzbVv5J5CoB6R32S4= github.com/theplant/sliceutils v0.0.0-20200406042209-89153d988eb1/go.mod h1:+y978w//UsVK85wVF9XJey9qTGDv+4kQc8v3Mf/ZjmE= github.com/theplant/testenv v0.0.1 h1:L9ygUPZDrHwRoMDfopXuq1+szEs05pYUwcFaZtSZ4X0=