Skip to content

Commit

Permalink
feature: upgrade go version 1.18 (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezaindrag authored Nov 25, 2022
1 parent 43b451d commit 5ab1771
Show file tree
Hide file tree
Showing 4 changed files with 607 additions and 215 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM 475170104714.dkr.ecr.ap-southeast-1.amazonaws.com/imaginary-service:builder-vips8.8.4 as builder
FROM 475170104714.dkr.ecr.ap-southeast-1.amazonaws.com/imaginary-service:builder-vips8.8.4-go-118 as builder

ARG IMAGINARY_VERSION="dev"

Expand Down
9 changes: 2 additions & 7 deletions controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strconv"
"strings"

"github.com/go-redsync/redsync"
"github.com/kumparan/redsync/v4"

"github.com/kumparan/cacher"
"github.com/kumparan/imaginary/config"
Expand Down Expand Up @@ -65,11 +65,7 @@ func imageController(o ServerOptions, operation Operation) func(http.ResponseWri
uniqueKey := fmt.Sprintf("%s%s", req.RequestURI, requestID)
var image = Image{}
byteFromCache, mu := findFromCacheByID(o, imaginaryResponseCacheKey(uniqueKey))
defer func() {
if mu != nil {
mu.Unlock()
}
}()
defer cacher.SafeUnlock(mu)

if len(byteFromCache) > 0 {
image.Body = byteFromCache
Expand Down Expand Up @@ -265,7 +261,6 @@ func findFromCacheByID(o ServerOptions, key string) (res []byte, mu *redsync.Mut

res = reply.([]byte)
return

}

func imaginaryResponseCacheKey(req string) string {
Expand Down
60 changes: 43 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,29 +1,55 @@
module github.com/kumparan/imaginary

go 1.13
go 1.18

require (
github.com/alicebob/miniredis v2.5.0+incompatible
github.com/aws/aws-sdk-go v1.25.40
github.com/banzaicloud/logrus-runtime-formatter v0.0.0-20180617171254-12df4a18567f
github.com/certifi/gocertifi v0.0.0-20200211180108-c7c1fbc02894 // indirect
github.com/aws/aws-sdk-go v1.44.145
github.com/banzaicloud/logrus-runtime-formatter v0.0.0-20190729070250-5ae5475bae5e
github.com/disintegration/imaging v1.6.2
github.com/evalphobia/logrus_sentry v0.8.2
github.com/getsentry/raven-go v0.2.0 // indirect
github.com/go-redsync/redsync v1.1.1
github.com/gomodule/redigo v2.0.0+incompatible
github.com/kumparan/bimg v1.0.19-0.20211025073642-47a38529c8af
github.com/kumparan/cacher v1.7.0
github.com/rs/cors v0.0.0-20170727213201-7af7a1e09ba3
github.com/sirupsen/logrus v1.4.0
github.com/spf13/afero v1.2.0 // indirect
github.com/spf13/viper v1.5.0
github.com/stretchr/testify v1.4.0 // indirect
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/net v0.0.0-20190607181551-461777fb6f67 // indirect
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
github.com/kumparan/cacher v1.12.1
github.com/kumparan/redsync/v4 v4.0.0-20220629071359-52de590a1465
github.com/rs/cors v1.8.2
github.com/sirupsen/logrus v1.9.0
github.com/spf13/viper v1.14.0
gopkg.in/h2non/filetype.v0 v0.1.0
gopkg.in/h2non/filetype.v1 v1.0.3 // indirect
gopkg.in/throttled/throttled.v2 v2.0.3
gopkg.in/throttled/throttled.v2 v2.2.5
willnorris.com/go/gifresize v1.0.0
)

require (
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a // indirect
github.com/certifi/gocertifi v0.0.0-20210507211836-431795d63e8d // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/raven-go v0.2.0 // indirect
github.com/go-redsync/redsync/v4 v4.6.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.6 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/spf13/afero v1.9.3 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
github.com/throttled/throttled v2.2.5+incompatible // indirect
github.com/yuin/gopher-lua v0.0.0-20210529063254-f4c35e4016d9 // indirect
golang.org/x/image v0.1.0 // indirect
golang.org/x/net v0.2.0 // indirect
golang.org/x/sys v0.2.0 // indirect
golang.org/x/text v0.4.0 // indirect
gopkg.in/h2non/filetype.v1 v1.0.5 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 5ab1771

Please sign in to comment.