Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: cloudinary driver for goravel #4

Merged
merged 18 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Please submit to goravel/goravel (请提亀至 goravel/goravel)
url: https://github.com/goravel/goravel/issues/new/choose
about: Thanks in advance for your feedback (ζε‰ζ„Ÿθ°’ζ‚¨ηš„ει¦ˆ)
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://docs.github.com/zh/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: gomod
directory: /
labels:
- "πŸ€– Dependencies"
schedule:
interval: daily
open-pull-requests-limit: 100
- package-ecosystem: github-actions
directory: /
labels:
- "πŸ€– Dependencies"
schedule:
interval: daily
23 changes: 23 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Codecov
on:
push:
branches:
- master
pull_request:
jobs:
codecov:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: Install dependencies πŸ“¦
run: go mod tidy
- name: Run tests with coverage βœ…
run: go test -v -coverprofile="coverage.out" ./...
- name: Upload coverage report to Codecov πŸ“
uses: codecov/codecov-action@v3
with:
file: ./coverage.out
token: ${{ secrets.CODECOV }}
22 changes: 22 additions & 0 deletions .github/workflows/cr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Code Review

permissions:
contents: read
pull-requests: write

on:
pull_request:
types: [ opened, reopened, synchronize, labeled ]

jobs:
test:
if: ${{ contains(github.event.pull_request.labels.*.name, 'πŸš€ Review Ready') }}
runs-on: ubuntu-latest
steps:
- uses: anc95/ChatGPT-CodeReview@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
OPENAI_API_ENDPOINT: https://api.openai-sb.com/v1
MODEL: gpt-3.5-turbo
PROMPT: "Below is a code patch, please help me do a brief code review on it. Only answer important bug risks and/or important improvement suggestions, Answer must be concisely and short: "
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 'stable'
- name: Lint 🎨
uses: golangci/golangci-lint-action@v3
with:
version: latest
args: --timeout=30m ./...
11 changes: 11 additions & 0 deletions .github/workflows/pr-check-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: PR Check Title
on:
pull_request:
jobs:
pr-check-title:
runs-on: ubuntu-latest
steps:
- uses: Slashgear/[email protected]
with:
regexp: "^(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip|release|revert)(\\(.+\\))?!?: .+"
helpMessage: "Your PR title is invalid. Please follow the Conventional Commits specification: https://www.conventionalcommits.org/en/v1.0.0/"
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Test
on:
push:
branches:
- master
pull_request:
jobs:
test:
strategy:
matrix:
go: [ '1.20', '1.19', '1.18' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Install dependencies πŸ“¦
run: go mod tidy
- name: Run tests
run: go test ./...
windows:
strategy:
matrix:
go: [ '1.20', '1.19', '1.18' ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}
- name: Install dependencies πŸ“¦
run: go mod tidy
- name: Run tests βœ…
run: go test ./... -short
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 goravel

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ A cloudinary driver for facades.Storage of Goravel.

## Version
| goravel/cloudinary | cloudinary | goravel/framework |
| --- | --- |-------------------|
| 1.0.* | 1.13.* | v1.12.0 |
|--------------------|------------|-------------------|
| v1.0.0 | v1.7.0 | v1.12.0 |
kkumar-gcc marked this conversation as resolved.
Show resolved Hide resolved

## Install
1. Add package
Expand All @@ -24,20 +24,22 @@ A cloudinary driver for facades.Storage of Goravel.
3. Add cloudinary disk to `config/filesystems.go` file
```go
// config/filesystems.go
...

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

"disks": map[string]filesystem.Disk{
...
"cloudinary": map[string]any{
"driver": "custom",
"cloud": "your_cloud_name",
"key": "your_api_key",
"secret": "your_api_secret",
"cloud": config.Env("CLOUDINARY_CLOUD"),
"key": config.Env("CLOUDINARY_ACCESS_KEY_ID"),
"secret": config.Env("CLOUDINARY_ACCESS_KEY_SECRET"),
"via": func()(filestystem.Disk, error) {
return cloudinaryFacades.Cloudinary("cloudinary"), nil
return cloudinaryfacades.Cloudinary("cloudinary"), nil // The `cloudinary` value is the `disks` key
},
}
}
Expand Down
Loading