Skip to content

Commit

Permalink
Merge pull request #12 from goravel/bowen/upgrade-framework
Browse files Browse the repository at this point in the history
chore: Upgarde framework v1.13.1
  • Loading branch information
hwbrzzl authored Sep 11, 2023
2 parents 1470bac + 3a04f12 commit 59932e1
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 88 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
branches:
- master
pull_request:
env:
CLOUDINARY_ACCESS_KEY_ID: ${{ secrets.CLOUDINARY_ACCESS_KEY_ID }}
CLOUDINARY_ACCESS_KEY_SECRET: ${{ secrets.CLOUDINARY_ACCESS_KEY_SECRET }}
CLOUDINARY_CLOUD: ${{ secrets.CLOUDINARY_CLOUD }}
jobs:
codecov:
runs-on: ubuntu-latest
Expand Down
22 changes: 0 additions & 22 deletions .github/workflows/cr.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91 changes: 49 additions & 42 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,60 @@
# cloudinary

A cloudinary driver for `facades.Storage()` of Goravel.

## Version

| goravel/cloudinary | cloudinary | goravel/framework |
|--------------------|------------|-------------------|
| v1.0.0 | v2.3.0 | v1.12.0 |
| v1.1.* | v2.4.0 | v1.13.* |

## Install

1. Add package
```bash
go get github.com/goravel/cloudinary
```

```bash
go get github.com/goravel/cloudinary
```

2. Register service provider
```
// config/app.go
import "github.com/goravel/cloudinary"

"providers": []foundation.ServiceProvider{
...
&cloudinary.ServiceProvider{},
}
```

```
// config/app.go
import "github.com/goravel/cloudinary"
"providers": []foundation.ServiceProvider{
...
&cloudinary.ServiceProvider{},
}
```

3. Add cloudinary disk to `config/filesystems.go` file
```go
// config/filesystems.go
...
import (
cloudinaryfacades "github.com/goravel/cloudinary/facades"
"github.com/goravel/framework/filesystem"
)
"disks": map[string]filesystem.Disk{
...
"cloudinary": map[string]any{
"driver": "custom",
"cloud": config.Env("CLOUDINARY_CLOUD"),
"key": config.Env("CLOUDINARY_ACCESS_KEY_ID"),
"secret": config.Env("CLOUDINARY_ACCESS_KEY_SECRET"),
// resource_types is optional
// it is used to limit the types of files that can be uploaded to cloudinary disk
"resource_types": map[string][]string{
"image": {"png"},
"video": {},
"raw": {"txt", "pdf"},
},
"via": func()(filestystem.Disk, error) {
return cloudinaryfacades.Cloudinary("cloudinary"), nil // The `cloudinary` value is the `disks` key
},
}
}
```
```go
// config/filesystems.go
...

import (
cloudinaryfacades "github.com/goravel/cloudinary/facades"
"github.com/goravel/framework/filesystem"
)

"disks": map[string]filesystem.Disk{
...
"cloudinary": map[string]any{
"driver": "custom",
"cloud": config.Env("CLOUDINARY_CLOUD"),
"key": config.Env("CLOUDINARY_ACCESS_KEY_ID"),
"secret": config.Env("CLOUDINARY_ACCESS_KEY_SECRET"),
// resource_types is optional
// it is used to limit the types of files that can be uploaded to cloudinary disk
"resource_types": map[string][]string{
"image": {"png"},
"video": {},
"raw": {"txt", "pdf"},
},
"via": func()(filestystem.Disk, error) {
return cloudinaryfacades.Cloudinary("cloudinary"), nil // The `cloudinary` value is the `disks` key
},
}
}
```
39 changes: 32 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,51 @@ go 1.20
require (
github.com/cloudinary/cloudinary-go/v2 v2.4.0
github.com/gookit/color v1.5.4
github.com/goravel/framework v1.12.7
github.com/goravel/framework v1.13.1
github.com/stretchr/testify v1.8.4
golang.org/x/net v0.15.0
)

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/containerd/continuity v0.3.0 // indirect
github.com/creasty/defaults v1.5.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang-module/carbon/v2 v2.2.3 // 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/gogo/protobuf v1.3.2 // indirect
github.com/golang-module/carbon/v2 v2.2.6 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect
github.com/google/uuid v1.3.1 // indirect
github.com/gorilla/schema v1.2.0 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/term v0.5.0 // 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/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // 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/mod v0.10.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/grpc v1.56.1 // indirect
google.golang.org/protobuf v1.30.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.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 59932e1

Please sign in to comment.