From b72bc006f9b9125fbab25a68bb35b6d856677902 Mon Sep 17 00:00:00 2001 From: Vivek R Date: Fri, 31 May 2024 15:30:37 +0530 Subject: [PATCH] fix: refactor examples module structure --- examples/fastglue-redis/main.go | 2 +- examples/fasthttp-inmemory/go.mod | 20 -------------------- examples/fasthttp-redis/go.mod | 23 ----------------------- examples/fasthttp-redis/go.mod.bak | 23 ----------------------- examples/{fastglue-redis => }/go.mod | 17 +++++++++++------ examples/nethttp-inmemory/go.mod | 13 ------------- examples/nethttp-redis/go.mod | 19 ------------------- examples/nethttp-secure-cookie/go.mod | 15 --------------- go.work | 1 + 9 files changed, 13 insertions(+), 120 deletions(-) delete mode 100644 examples/fasthttp-inmemory/go.mod delete mode 100644 examples/fasthttp-redis/go.mod delete mode 100644 examples/fasthttp-redis/go.mod.bak rename examples/{fastglue-redis => }/go.mod (50%) delete mode 100644 examples/nethttp-inmemory/go.mod delete mode 100644 examples/nethttp-redis/go.mod delete mode 100644 examples/nethttp-secure-cookie/go.mod diff --git a/examples/fastglue-redis/main.go b/examples/fastglue-redis/main.go index 2466528..4066d6e 100644 --- a/examples/fastglue-redis/main.go +++ b/examples/fastglue-redis/main.go @@ -137,7 +137,7 @@ func main() { // 5s read/write timeout server := initServer("go-redis", 5) - if err := g.ListenAndServe(":3000", "", server); err != nil { + if err := g.ListenAndServe(":1111", "", server); err != nil { log.Fatal(err) } } diff --git a/examples/fasthttp-inmemory/go.mod b/examples/fasthttp-inmemory/go.mod deleted file mode 100644 index fb02acf..0000000 --- a/examples/fasthttp-inmemory/go.mod +++ /dev/null @@ -1,20 +0,0 @@ -module github.com/vividvilla/simplesessions/examples/fasthttp-inmemory - -go 1.18 - -require ( - github.com/valyala/fasthttp v0.0.0-20180901052036-d7688109a57b - github.com/vividvilla/simplesessions/stores/memory/v3 v3.0.0 - github.com/vividvilla/simplesessions/v3 v3.0.0 -) - -require ( - github.com/klauspost/compress v1.4.0 // indirect - github.com/klauspost/cpuid v0.0.0-20180405133222-e7e905edc00e // indirect - github.com/valyala/bytebufferpool v0.0.0-20160817181652-e746df99fe4a // indirect -) - -replace ( - github.com/vividvilla/simplesessions/stores/memory/v3 => ../../stores/memory - github.com/vividvilla/simplesessions/v3 => ../.. -) diff --git a/examples/fasthttp-redis/go.mod b/examples/fasthttp-redis/go.mod deleted file mode 100644 index d3e9678..0000000 --- a/examples/fasthttp-redis/go.mod +++ /dev/null @@ -1,23 +0,0 @@ -module github.com/vividvilla/simplesessions/examples/fasthttp-redis - -go 1.18 - -require ( - github.com/redis/go-redis/v9 v9.5.1 - github.com/valyala/fasthttp v1.54.0 - github.com/vividvilla/simplesessions/stores/redis/v3 v3.0.0 - github.com/vividvilla/simplesessions/v3 v3.0.0 -) - -require ( - github.com/andybalholm/brotli v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/klauspost/compress v1.17.7 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect -) - -replace ( - github.com/vividvilla/simplesessions/stores/redis/v3 => ../../stores/redis - github.com/vividvilla/simplesessions/v3 => ../.. -) diff --git a/examples/fasthttp-redis/go.mod.bak b/examples/fasthttp-redis/go.mod.bak deleted file mode 100644 index d3e9678..0000000 --- a/examples/fasthttp-redis/go.mod.bak +++ /dev/null @@ -1,23 +0,0 @@ -module github.com/vividvilla/simplesessions/examples/fasthttp-redis - -go 1.18 - -require ( - github.com/redis/go-redis/v9 v9.5.1 - github.com/valyala/fasthttp v1.54.0 - github.com/vividvilla/simplesessions/stores/redis/v3 v3.0.0 - github.com/vividvilla/simplesessions/v3 v3.0.0 -) - -require ( - github.com/andybalholm/brotli v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/klauspost/compress v1.17.7 // indirect - github.com/valyala/bytebufferpool v1.0.0 // indirect -) - -replace ( - github.com/vividvilla/simplesessions/stores/redis/v3 => ../../stores/redis - github.com/vividvilla/simplesessions/v3 => ../.. -) diff --git a/examples/fastglue-redis/go.mod b/examples/go.mod similarity index 50% rename from examples/fastglue-redis/go.mod rename to examples/go.mod index e2d2eb7..88179e5 100644 --- a/examples/fastglue-redis/go.mod +++ b/examples/go.mod @@ -1,11 +1,13 @@ -module github.com/vividvilla/simplesessions/examples/fastglue-redis +module github.com/vividvilla/simplesessions/examples go 1.18 require ( github.com/redis/go-redis/v9 v9.5.1 github.com/valyala/fasthttp v1.54.0 + github.com/vividvilla/simplesessions/stores/memory/v3 v3.0.0 github.com/vividvilla/simplesessions/stores/redis/v3 v3.0.0 + github.com/vividvilla/simplesessions/stores/securecookie/v3 v3.0.0 github.com/vividvilla/simplesessions/v3 v3.0.0 github.com/zerodha/fastglue v1.8.0 ) @@ -15,16 +17,19 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect - github.com/fasthttp/router v1.5.0 // indirect - github.com/klauspost/compress v1.17.8 // indirect + github.com/fasthttp/router v1.4.5 // indirect + github.com/gorilla/securecookie v1.1.2 // indirect + github.com/klauspost/compress v1.17.7 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/savsgio/gotils v0.0.0-20240303185622-093b76447511 // indirect + github.com/savsgio/gotils v0.0.0-20211223103454-d0aaa54c5899 // indirect github.com/stretchr/testify v1.9.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) replace ( - github.com/vividvilla/simplesessions/stores/redis/v3 => ../../stores/redis - github.com/vividvilla/simplesessions/v3 => ../.. + github.com/vividvilla/simplesessions/stores/memory/v3 => ../stores/memory + github.com/vividvilla/simplesessions/stores/redis/v3 => ../stores/redis + github.com/vividvilla/simplesessions/stores/securecookie/v3 => ../stores/securecookie + github.com/vividvilla/simplesessions/v3 => ../ ) diff --git a/examples/nethttp-inmemory/go.mod b/examples/nethttp-inmemory/go.mod deleted file mode 100644 index 4f185bb..0000000 --- a/examples/nethttp-inmemory/go.mod +++ /dev/null @@ -1,13 +0,0 @@ -module github.com/vividvilla/simplesessions/examples/nethttp-inmemory - -go 1.18 - -require ( - github.com/vividvilla/simplesessions/stores/memory/v3 v3.0.0 - github.com/vividvilla/simplesessions/v3 v3.0.0 -) - -replace ( - github.com/vividvilla/simplesessions/stores/memory/v3 => ../../stores/memory - github.com/vividvilla/simplesessions/v3 => ../.. -) diff --git a/examples/nethttp-redis/go.mod b/examples/nethttp-redis/go.mod deleted file mode 100644 index 3d7718e..0000000 --- a/examples/nethttp-redis/go.mod +++ /dev/null @@ -1,19 +0,0 @@ -module github.com/vividvilla/simplesessions/examples/nethttp-redis - -go 1.18 - -require ( - github.com/redis/go-redis/v9 v9.5.1 - github.com/vividvilla/simplesessions/stores/redis/v3 v3.0.0 - github.com/vividvilla/simplesessions/v3 v3.0.0 -) - -require ( - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect -) - -replace ( - github.com/vividvilla/simplesessions/stores/redis/v3 => ../../stores/redis - github.com/vividvilla/simplesessions/v3 => ../.. -) diff --git a/examples/nethttp-secure-cookie/go.mod b/examples/nethttp-secure-cookie/go.mod deleted file mode 100644 index b620acd..0000000 --- a/examples/nethttp-secure-cookie/go.mod +++ /dev/null @@ -1,15 +0,0 @@ -module github.com/vividvilla/simplesessions/examples/nethttp-secure-cookie - -go 1.18 - -require ( - github.com/vividvilla/simplesessions/stores/securecookie/v3 v3.0.0 - github.com/vividvilla/simplesessions/v3 v3.0.0 -) - -require github.com/gorilla/securecookie v1.1.2 // indirect - -replace ( - github.com/vividvilla/simplesessions/stores/securecookie/v3 => ../../stores/securecookie - github.com/vividvilla/simplesessions/v3 => ../.. -) diff --git a/go.work b/go.work index 91460e8..2b82182 100644 --- a/go.work +++ b/go.work @@ -6,4 +6,5 @@ use ( ./stores/postgres ./stores/redis ./stores/securecookie + ./examples )