Skip to content

Commit

Permalink
release: v1.2.0 (#21)
Browse files Browse the repository at this point in the history
* release: v1.2.0

* update mod

* update lint
  • Loading branch information
hwbrzzl authored Jun 8, 2024
1 parent 97c37a3 commit 06e8de8
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 201 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
matrix:
go:
- '1.21'
- '1.20'
- '1.22'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -26,7 +26,7 @@ jobs:
matrix:
go:
- '1.21'
- '1.20'
- '1.22'
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
Expand Down
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ A COS disk driver for `facades.Storage()` of Goravel.

## Version

| goravel/cos | goravel/framework |
| ---------- | -------------- |
| v1.1.* | v1.13.* |
| v1.0.* | v1.12.* |
| goravel/cos | goravel/framework |
|-------------|-------------------|
| v1.2.* | v1.14.* |
| v1.1.* | v1.13.* |
| v1.0.* | v1.12.* |

## Install

Expand Down
2 changes: 1 addition & 1 deletion cos.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (r *Cos) Size(file string) (int64, error) {

func (r *Cos) TemporaryUrl(file string, time time.Time) (string, error) {
// 获取预签名URL
presignedURL, err := r.instance.Object.GetPresignedURL(r.ctx, http.MethodGet, file, r.accessKeyId, r.accessKeySecret, time.Sub(carbon.Now().ToStdTime()), nil)
presignedURL, err := r.instance.Object.GetPresignedURL(r.ctx, http.MethodGet, file, r.accessKeyId, r.accessKeySecret, time.Sub(carbon.Now().StdTime()), nil)
if err != nil {
return "", err
}
Expand Down
10 changes: 5 additions & 5 deletions cos_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/gookit/color"
"github.com/stretchr/testify/assert"

configmocks "github.com/goravel/framework/contracts/config/mocks"
contractsfilesystem "github.com/goravel/framework/contracts/filesystem"
filesystemcontract "github.com/goravel/framework/contracts/filesystem"
configmock "github.com/goravel/framework/mocks/config"
)

func TestStorage(t *testing.T) {
Expand All @@ -24,14 +24,14 @@ func TestStorage(t *testing.T) {

assert.Nil(t, os.WriteFile("test.txt", []byte("Goravel"), 0644))

mockConfig := &configmocks.Config{}
mockConfig := &configmock.Config{}
mockConfig.On("GetString", "app.timezone").Return("UTC")
mockConfig.On("GetString", "filesystems.disks.cos.key").Return(os.Getenv("TENCENT_ACCESS_KEY_ID"))
mockConfig.On("GetString", "filesystems.disks.cos.secret").Return(os.Getenv("TENCENT_ACCESS_KEY_SECRET"))
mockConfig.On("GetString", "filesystems.disks.cos.bucket").Return(os.Getenv("TENCENT_BUCKET"))
mockConfig.On("GetString", "filesystems.disks.cos.url").Return(os.Getenv("TENCENT_URL"))

var driver contractsfilesystem.Driver
var driver filesystemcontract.Driver
url := os.Getenv("TENCENT_URL")

tests := []struct {
Expand Down Expand Up @@ -401,7 +401,7 @@ type File struct {
path string
}

func (f *File) Disk(disk string) contractsfilesystem.File {
func (f *File) Disk(disk string) filesystemcontract.File {
return &File{}
}

Expand Down
51 changes: 13 additions & 38 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,59 +1,34 @@
module github.com/goravel/cos

go 1.20
go 1.21

require (
github.com/gookit/color v1.5.4
github.com/goravel/framework v1.13.2
github.com/goravel/framework v1.14.0
github.com/stretchr/testify v1.9.0
github.com/tencentyun/cos-go-sdk-v5 v0.7.49
)

require (
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect
github.com/cenkalti/backoff/v4 v4.2.0 // indirect
github.com/clbanning/mxj v1.8.4 // indirect
github.com/containerd/continuity v0.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/cli v20.10.22+incompatible // indirect
github.com/docker/docker v20.10.24+incompatible // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-module/carbon/v2 v2.2.8 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/gabriel-vasile/mimetype v1.4.4 // indirect
github.com/golang-module/carbon/v2 v2.3.12 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/mozillazg/go-httpheader v0.3.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.2 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/ory/dockertest/v3 v3.10.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/objx v0.5.2 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
golang.org/x/exp v0.0.0-20230315142452-642cacee5cc0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.9.1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sys v0.21.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect
google.golang.org/grpc v1.64.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 06e8de8

Please sign in to comment.