Skip to content

Commit

Permalink
Merge branch 'main' into fix/race-condition-in-url-generation
Browse files Browse the repository at this point in the history
  • Loading branch information
const-cloudinary committed Jan 29, 2025
2 parents b1b162f + db54e9a commit dd9aec7
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 41 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Go Test 🚀

on: [push, pull_request]

jobs:
build:
name: 🐹 Test with Go ${{ matrix.go-version }}
runs-on: ubuntu-latest

strategy:
matrix:
go-version:
- 1.20.x
- 1.21.x
- 1.22.x
- 1.23.x

steps:
- name: 🔄 Checkout Repository
uses: actions/checkout@v4

- name: 🛠️ Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}

- name: 📦 Install Dependencies
run: go mod download

- name: 🌐 Set CLOUDINARY_URL
run: |
export CLOUDINARY_URL=$(bash scripts/get_test_cloud.sh)
echo "CLOUDINARY_URL=$CLOUDINARY_URL" >> $GITHUB_ENV
echo "cloud_name: $(echo $CLOUDINARY_URL | cut -d'@' -f2)"
- name: 🧰 Install gotestsum
run: go install gotest.tools/gotestsum@latest

- name: 🧪 Run Tests
run: |
gotestsum --junitfile unit-tests.xml --format pkgname ./...
- name: 📊 Test Summary
uses: test-summary/action@v2
with:
paths: "unit-tests.xml"
if: always()
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

62 changes: 39 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
[![Build Status](https://app.travis-ci.com/cloudinary/cloudinary-go.svg)](https://app.travis-ci.com/cloudinary/cloudinary-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/cloudinary/cloudinary-go/v2)](https://goreportcard.com/report/github.com/cloudinary/cloudinary-go/v2)
[![Build Status](https://app.travis-ci.com/cloudinary/cloudinary-go.svg)](https://app.travis-ci.com/cloudinary/cloudinary-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/cloudinary/cloudinary-go/v2)](https://goreportcard.com/report/github.com/cloudinary/cloudinary-go/v2)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/cloudinary/cloudinary-go/v2)](https://pkg.go.dev/github.com/cloudinary/cloudinary-go/v2)

Cloudinary Go SDK
==================

## About

The Cloudinary Go SDK allows you to quickly and easily integrate your application with Cloudinary.
Effortlessly optimize, transform, upload and manage your cloud's assets.


#### Note

This Readme provides basic installation and usage information.
For the complete documentation, see the [Go SDK Guide](https://cloudinary.com/documentation/go_integration).

## Table of Contents

- [Key Features](#key-features)
- [Version Support](#Version-Support)
- [Installation](#installation)
- [Usage](#usage)
- [Setup](#Setup)
- [Transform and Optimize Assets](#Transform-and-Optimize-Assets)


## Key Features

- [Transform](https://cloudinary.com/documentation/go_media_transformations) assets.
- [Asset Management](https://cloudinary.com/documentation/go_asset_administration).
- [Secure URLs](https://cloudinary.com/documentation/video_manipulation_and_delivery#generating_secure_https_urls_using_sdks).



## Version Support

| SDK Version | Go 1.13 to 1.19 | Go 1.20 | Go 1.21 |
|-------------|-----------------|---------|---------|
| 2.8 & up ||||
| 2.7 ||||
| 1.x ||||

| **SDK Version** | **Go 1.13 - 1.19** | **Go 1.20** | **Go 1.21** | **Go 1.22** | **Go 1.23** |
|-----------------|--------------------|-------------|-------------|-------------|-------------|
| **2.8 & Up** || ✔️ | ✔️ | ✔️ | ✔️ |
| **2.7** | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |
| **1.x** | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ |

## Installation

```bash
go get github.com/cloudinary/cloudinary-go/v2
```

# Usage

### Setup

```go
import (
"github.com/cloudinary/cloudinary-go/v2"
)

cld, _ := cloudinary.New()
```

- [See full documentation](https://cloudinary.com/documentation/go_integration#configuration).

### Transform and Optimize Assets

- [See full documentation](https://cloudinary.com/documentation/go_media_transformations).

```go
Expand All @@ -68,13 +72,16 @@ imageURL, err := image.String()
```

### Upload

- [See full documentation](https://cloudinary.com/documentation/go_image_and_video_upload).
- [Learn more about configuring your uploads with upload presets](https://cloudinary.com/documentation/upload_presets).

```go
resp, err := cld.Upload.Upload(ctx, "my_picture.jpg", uploader.UploadParams{})
```

### Security options

- [See full documentation](https://cloudinary.com/documentation/solution_overview#security).

### Logging
Expand All @@ -88,34 +95,43 @@ For details on redefining the logger or adjusting the logging level, see [Loggin
See [Complete SDK Example](example/example.go).

## Contributions

- Ensure tests run locally
- Open a PR and ensure Travis tests pass
- For more information on how to contribute, take a look at the [contributing](CONTRIBUTING.md) page.


## Get Help

If you run into an issue or have a question, you can either:

- Issues related to the SDK: [Open a GitHub issue](https://github.com/cloudinary/cloudinary-go/issues).
- Issues related to your account: [Open a support ticket](https://cloudinary.com/contact)


## About Cloudinary

Cloudinary is a powerful media API for websites and mobile apps alike, Cloudinary enables developers to efficiently
manage, transform, optimize, and deliver images and videos through multiple CDNs. Ultimately, viewers enjoy responsive
and personalized visual-media experiences—irrespective of the viewing device.


## Additional Resources
- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references): Comprehensive references, including syntax and examples for all SDKs.

- [Cloudinary Transformation and REST API References](https://cloudinary.com/documentation/cloudinary_references):
Comprehensive references, including syntax and examples for all SDKs.
- [MediaJams.dev](https://mediajams.dev/): Bite-size use-case tutorials written by and for Cloudinary Developers
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on YouTube.
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and on-site courses.
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop for all code explorers, Postman collections, and feature demos found in the docs.
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should develop next.
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to other Cloudinary developers.
- [DevJams](https://www.youtube.com/playlist?list=PL8dVGjLA2oMr09amgERARsZyrOz_sPvqw): Cloudinary developer podcasts on
YouTube.
- [Cloudinary Academy](https://training.cloudinary.com/): Free self-paced courses, instructor-led virtual courses, and
on-site courses.
- [Code Explorers and Feature Demos](https://cloudinary.com/documentation/code_explorers_demos_index): A one-stop shop
for all code explorers, Postman collections, and feature demos found in the docs.
- [Cloudinary Roadmap](https://cloudinary.com/roadmap): Your chance to follow, vote, or suggest what Cloudinary should
develop next.
- [Cloudinary Facebook Community](https://www.facebook.com/groups/CloudinaryCommunity): Learn from and offer help to
other Cloudinary developers.
- [Cloudinary Account Registration](https://cloudinary.com/users/register/free): Free Cloudinary account registration.
- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and more.

- [Cloudinary Website](https://cloudinary.com): Learn about Cloudinary's products, partners, customers, pricing, and
more.

## Licence

Released under the MIT license.
2 changes: 1 addition & 1 deletion api/admin/metadata_fields_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func TestAdmin_AddMetadataFields(t *testing.T) {
ExternalID: mdIDs["date"],
Label: cldtest.UniqueID("GoDate"),
DefaultValue: time.Now().Format("2006-01-02"),
Validation: metadata.GreaterThanValidation(time.Now().AddDate(0, 0, -1), false),
Validation: metadata.GreaterThanValidation(time.Now().AddDate(0, 0, -1).Format("2006-01-02"), false),
}

var enumMetadataField = metadata.Field{
Expand Down

0 comments on commit dd9aec7

Please sign in to comment.