Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

Commit

Permalink
upgrade echo framework version to v4.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
hb-chen committed May 29, 2019
1 parent 0f5e7b1 commit b5fa30d
Show file tree
Hide file tree
Showing 38 changed files with 748 additions and 567 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Echo Web
[![Slack](https://img.shields.io/badge/slack-join-D60051.svg)](https://hbchen.slack.com/messages/CE6S4HJN6)

Go web framework Echo example.
Go web framework Echo example. <br/>`master``v4`版本,`v3`切换到`v3`分支。
> Requires
[![Slack](https://img.shields.io/badge/Echo-v3+-41DAFF.svg)](https://github.com/labstack/echo)
[![Slack](https://img.shields.io/badge/Echo-v4+-41DAFF.svg)](https://github.com/labstack/echo)
[![Slack](https://img.shields.io/badge/go-1.11+-2A489A.svg)](https://golang.org)
[![Slack](https://img.shields.io/badge/GO111MODULE-on-brightgreen.svg)](https://golang.org)

Expand Down
669 changes: 383 additions & 286 deletions assets/assets.go

Large diffs are not rendered by default.

8 changes: 2 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ require (
github.com/juju/errors v0.0.0-20181118221551-089d3ea4e4d5 // indirect
github.com/juju/loggo v0.0.0-20180524022052-584905176618 // indirect
github.com/juju/testing v0.0.0-20180920084828-472a3e8b2073 // indirect
github.com/kr/pty v1.1.4 // indirect
github.com/labstack/echo v3.3.10+incompatible
github.com/labstack/echo/v4 v4.1.5
github.com/labstack/gommon v0.2.8
github.com/mattn/go-colorable v0.1.2 // indirect
github.com/mattn/go-sqlite3 v1.10.0 // indirect
Expand All @@ -42,15 +41,12 @@ require (
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371 // indirect
github.com/shurcooL/vfsgen v0.0.0-20181020040650-a97a25d856ca // indirect
github.com/stretchr/objx v0.2.0 // indirect
github.com/uber-go/atomic v1.3.2 // indirect
github.com/uber/jaeger-client-go v2.15.0+incompatible
github.com/uber/jaeger-lib v1.5.0
github.com/valyala/fasttemplate v1.0.1 // indirect
github.com/vrischmann/go-metrics-influxdb v0.0.0-20160917065939-43af8332c303
go.elastic.co/apm v1.3.0
go.elastic.co/apm/module/apmecho v1.3.0
go.elastic.co/apm/module/apmhttp v1.3.0
go.elastic.co/apm/module/apmechov4 v1.3.0
go.elastic.co/apm/module/apmot v1.3.0
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f // indirect
golang.org/x/net v0.0.0-20190522155817-f3200d17e092
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -151,22 +151,25 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
github.com/labstack/echo/v4 v4.0.0/go.mod h1:tZv7nai5buKSg5h/8E6zz4LsD/Dqh9/91Mvs7Z5Zyno=
github.com/labstack/echo/v4 v4.1.5 h1:RztCXCvfMljychg0G/IzW5T7hL6ADqqwREwcX279Q1g=
github.com/labstack/echo/v4 v4.1.5/go.mod h1:3LbYC6VkwmUnmLPZ8WFdHdQHG77e9GQbjyhWdb1QvC4=
github.com/labstack/gommon v0.2.8 h1:JvRqmeZcfrHC5u6uVleB4NxxNbzx6gpbJiQknDbKQu0=
github.com/labstack/gommon v0.2.8/go.mod h1:/tj9csK2iPSBvn+3NLM9e52usepMtrd5ilFYA+wQNJ4=
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ=
github.com/mattn/go-colorable v0.1.2 h1:/bC9yWikZXAL9uJdulbSfyVNIR3n3trXl+v8+1sx8mU=
github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4=
github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.7/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE=
github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s=
github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU=
Expand Down Expand Up @@ -245,7 +248,6 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/viper v1.2.1/go.mod h1:P4AexN0a+C9tGAnUFNwDMYYZv3pjFuvmeiMyKRaNVlI=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE=
github.com/stretchr/testify v1.2.1 h1:52QO5WkIUcHGIR7EnGagH88x1bUzqGXTC5/1bDTUQ7U=
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
Expand All @@ -272,8 +274,8 @@ github.com/willf/bitset v1.1.9/go.mod h1:RjeCKbqT1RxIR/KWY6phxZiaY1IyutSBfGjNPyS
github.com/xlab/treeprint v0.0.0-20180616005107-d6fb6747feb6/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg=
go.elastic.co/apm v1.3.0 h1:CREusW/WI6b0TRyAZkL3Vhct+KMBA32xxIffH/tew58=
go.elastic.co/apm v1.3.0/go.mod h1:Yr6TY/W+k8/YkTXvHcDPde3B7Y983r95gbY54HuLTdU=
go.elastic.co/apm/module/apmecho v1.3.0 h1:yZyDxAr8jM3/pjlJowpKIaL9k0D0Wu9iaFed4xnQntc=
go.elastic.co/apm/module/apmecho v1.3.0/go.mod h1:pAGWhex6bkAdp7QInGaywrVCeBtho8DWIZ00cey0Yd4=
go.elastic.co/apm/module/apmechov4 v1.3.0 h1:8P9mfvrw3mB8Nos9R+/58+em7qyYSiMYgIVtFByZ1eg=
go.elastic.co/apm/module/apmechov4 v1.3.0/go.mod h1:/EGxvwx3ww3+Xp91QWWNC+VK5D/9wIio+I2PeSMEaPE=
go.elastic.co/apm/module/apmhttp v1.3.0 h1:mkDceeDGYzmg8ym2DE6COxhFaxeYZdKA9BgLcIwN2tU=
go.elastic.co/apm/module/apmhttp v1.3.0/go.mod h1:CYc6HqEuyHtY4w5j/K7GL96A8TJ+I2ZC0XWD36qtMDM=
go.elastic.co/apm/module/apmot v1.3.0 h1:IEkzPiGFf5oSbQhIHpRGX2Fsh0w/Ye0AcxDr9pKm6qE=
Expand All @@ -287,9 +289,9 @@ go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e h1:IzypfodbhbnViNUO/MEh0FzCUooG97cIGfdggUrUSyU=
golang.org/x/crypto v0.0.0-20181015023909-0c41d7ab0a0e/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9 h1:mKdxBk7AujPs8kU4m80U72y/zjbZ3UcXC7dClwKbUI0=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190130090550-b01c7a725664/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f h1:R423Cnkcp5JABoeemiGEPlt9tHXFfw5kvc0yqlxRPWo=
golang.org/x/crypto v0.0.0-20190513172903-22d7a77e9e5f/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
Expand Down Expand Up @@ -318,12 +320,11 @@ golang.org/x/sys v0.0.0-20180906133057-8cf3aee42992/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20181011152604-fa43e7bc11ba/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181023152157-44b849a8bc13/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190102155601-82a175fd1598/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190222072716-a9d3bda3a223/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-20190425145619-16072639606e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190524152521-dbbf3f1254d4 h1:VSJ45BzqrVgR4clSx415y1rHH7QAGhGt71J0ZmhLYrc=
golang.org/x/sys v0.0.0-20190524152521-dbbf3f1254d4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190528012530-adf421d2caf4 h1:gd52YanAQJ4UkvuNi/7z63JEyc6ejHh9QwdzbTiEtAY=
golang.org/x/sys v0.0.0-20190528012530-adf421d2caf4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand All @@ -335,8 +336,7 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm
golang.org/x/tools v0.0.0-20181012181339-19e2aca3fdf9/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181023010539-40a48ad93fbe h1:i8YNi6USHuTcWHQPvNjvHY7JmkAmn1MnN/ISnPD/ZHc=
golang.org/x/tools v0.0.0-20181023010539-40a48ad93fbe/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190524210228-3d17549cdc6b h1:iEAPfYPbYbxG/2lNN4cMOHkmgKNsCuUwkxlDCK46UlU=
golang.org/x/tools v0.0.0-20190524210228-3d17549cdc6b/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190525145741-7be61e1b0e51 h1:RhYYBLDB5MoVkvoNGMNk+DSj7WoGhySvIvtEjTyiP74=
golang.org/x/tools v0.0.0-20190525145741-7be61e1b0e51/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
google.golang.org/api v0.0.0-20181021000519-a2651947f503/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
Expand Down
2 changes: 1 addition & 1 deletion middleware/binder/binder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strconv"
"strings"

"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)

func New() *binder {
Expand Down
5 changes: 3 additions & 2 deletions middleware/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import (
"crypto/sha1"
"errors"
"fmt"
"github.com/labstack/echo"
"io"
"net/http"
"net/url"
"time"

"github.com/labstack/echo/v4"
)

const (
Expand Down Expand Up @@ -89,7 +90,7 @@ func (w *cachedWriter) Written() bool {
func (w *cachedWriter) Write(data []byte) (int, error) {
ret, err := w.Writer.Write(data)
if err == nil {
//cache response
// cache response
store := w.store
header := w.Response.Header()
// newHeader := http.Header{}
Expand Down
16 changes: 10 additions & 6 deletions middleware/cache/example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,28 @@ package main

import (
"fmt"
"github.com/hb-go/echo-web/middleware/cache"
"github.com/labstack/echo"
"time"

"github.com/labstack/echo/v4"

"github.com/hb-go/echo-web/middleware/cache"
)

func main() {
r := echo.Default()
r := echo.New()

store := cache.NewInMemoryStore(time.Second)
// Cached Page
r.GET("/ping", func(c *echo.Context) {
r.GET("/ping", func(c echo.Context) error {
c.String(200, "pong "+fmt.Sprint(time.Now().Unix()))
return nil
})

r.GET("/cache_ping", cache.CachePage(store, time.Minute, func(c *echo.Context) {
r.GET("/cache_ping", cache.CachePage(store, time.Minute, func(c echo.Context) error {
c.String(200, "pong "+fmt.Sprint(time.Now().Unix()))
return nil
}))

// Listen and Server in 0.0.0.0:8080
r.Run(":8080")
r.Start(":8080")
}
3 changes: 2 additions & 1 deletion middleware/cache/inmemory.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package cache

import (
"github.com/robfig/go-cache"
"reflect"
"time"

"github.com/robfig/go-cache"
)

type InMemoryStore struct {
Expand Down
3 changes: 2 additions & 1 deletion middleware/cache/memcached.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cache

import (
"github.com/bradfitz/gomemcache/memcache"
"time"

"github.com/bradfitz/gomemcache/memcache"
)

type MemcachedStore struct {
Expand Down
3 changes: 2 additions & 1 deletion middleware/cache/redis.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package cache

import (
"github.com/gomodule/redigo/redis"
"time"

"github.com/gomodule/redigo/redis"
)

// Wraps the Redis client to meet the Cache interface.
Expand Down
2 changes: 1 addition & 1 deletion middleware/captcha/captcha.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"

"github.com/dchest/captcha"
"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)

type Config struct {
Expand Down
2 changes: 1 addition & 1 deletion middleware/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"time"

"github.com/labstack/echo"
"github.com/labstack/echo/v4"
"github.com/rcrowley/go-metrics"
influxdb "github.com/vrischmann/go-metrics-influxdb"
)
Expand Down
2 changes: 1 addition & 1 deletion middleware/metrics/prometheus/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strconv"
"time"

"github.com/labstack/echo"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
Expand Down
2 changes: 1 addition & 1 deletion middleware/multitemplate/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"html/template"
"io"

"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)

/**
Expand Down
6 changes: 3 additions & 3 deletions middleware/opentracing/opentracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ package opentracing

import (
"fmt"
"go.elastic.co/apm"
"go.elastic.co/apm/module/apmot"
"io"
"net"
"net/http"
"net/url"

"github.com/labstack/echo"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
"github.com/opentracing/opentracing-go"
"github.com/uber/jaeger-client-go"
jaegercfg "github.com/uber/jaeger-client-go/config"
"github.com/uber/jaeger-lib/metrics"
"go.elastic.co/apm"
"go.elastic.co/apm/module/apmot"
"sourcegraph.com/sourcegraph/appdash"
appdashot "sourcegraph.com/sourcegraph/appdash/opentracing"
"sourcegraph.com/sourcegraph/appdash/traceapp"
Expand Down
2 changes: 1 addition & 1 deletion middleware/pongo2echo/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"path"

"github.com/flosch/pongo2"
"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)

// RenderOptions is used to configure the renderer.
Expand Down
2 changes: 1 addition & 1 deletion middleware/pprof/pprof.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
_ "net/http/pprof"
"strings"

"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)

// 由于需要"/debug/pprof/"匹配URL.path前缀,如果有RemoveTrailingSlash(),需在此之前加pprof
Expand Down
2 changes: 1 addition & 1 deletion middleware/session/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/gorilla/context"
"github.com/gorilla/sessions"
"github.com/labstack/echo"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
)

Expand Down
2 changes: 1 addition & 1 deletion middleware/staticbin/static.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
"time"

"github.com/labstack/echo"
"github.com/labstack/echo/v4"
)

type Options struct {
Expand Down
2 changes: 1 addition & 1 deletion model/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import (
"time"

_ "github.com/go-sql-driver/mysql"
"github.com/hb-go/echo-web/middleware/cache"
"github.com/hb-go/gorm"

. "github.com/hb-go/echo-web/conf"
"github.com/hb-go/echo-web/middleware/cache"
"github.com/hb-go/echo-web/model/orm"
"github.com/hb-go/echo-web/module/log"
)
Expand Down
4 changes: 2 additions & 2 deletions model/orm/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"reflect"
"time"

"github.com/hb-go/echo-web/middleware/cache"
"github.com/hb-go/gorm"

"github.com/hb-go/echo-web/middleware/cache"
"github.com/hb-go/echo-web/module/log"
"github.com/hb-go/echo-web/util/conv"
"github.com/hb-go/echo-web/util/crypt"
Expand Down Expand Up @@ -136,7 +136,7 @@ func (c *CacheDB) Count(out interface{}) *CacheDB {
}

func cacheKey(gSql gorm.SQL) string {
//sqlStr := fmt.Sprintf(CacheKeyFormat, sql.SQL, sql.SQLVars)
// sqlStr := fmt.Sprintf(CacheKeyFormat, sql.SQL, sql.SQLVars)
sqlStr := sql.SqlParse(gSql.SQL, gSql.SQLVars)
return crypt.MD5([]byte(sqlStr))
}
3 changes: 2 additions & 1 deletion module/auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"fmt"
"net/http"

"github.com/labstack/echo/v4"

"github.com/hb-go/echo-web/middleware/session"
"github.com/labstack/echo"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions module/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package cache
import (
"time"

ec "github.com/hb-go/echo-web/middleware/cache"
"github.com/labstack/echo"
"github.com/labstack/echo/v4"

. "github.com/hb-go/echo-web/conf"
ec "github.com/hb-go/echo-web/middleware/cache"
)

const (
Expand Down
Loading

0 comments on commit b5fa30d

Please sign in to comment.