cloudinary

package module
Version: v1.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 5 Imported by: 4

README

Build Status Go Report Card PkgGoDev

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.

Table of Contents

Key Features

Version Support

SDK Version Go > 1.13
1.x v

Installation

go get github.com/cloudinary/cloudinary-go

Usage

Setup
import (
    "github.com/cloudinary/cloudinary-go"
)

cld, _ := cloudinary.New()
Transform and Optimize Assets
image, err := cld.Image("sample.jpg")
if err != nil {...}

image.Transformation = "c_fill,h_150,w_100"

imageURL, err := image.String()
Upload
resp, err := cld.Upload.Upload(ctx, "my_picture.jpg", uploader.UploadParams{})
Security options
Logging

Cloudinary SDK logs errors using standard go log functions.

For details on redefining the logger or adjusting the logging level, see Logging.

Complete SDK Example

See Complete SDK Example.

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 page.

Get Help

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

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

Licence

Released under the MIT license.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cloudinary

type Cloudinary struct {
	Config config.Configuration
	Admin  admin.API
	Upload uploader.API
	Logger *logger.Logger
}

Cloudinary main struct

func New added in v1.0.0

func New() (*Cloudinary, error)

New returns a new Cloudinary instance from environment variable.

func NewFromConfiguration added in v1.0.0

func NewFromConfiguration(configuration config.Configuration) (*Cloudinary, error)

NewFromConfiguration returns a new Cloudinary instance from the provided configuration.

func NewFromOAuthToken added in v1.6.0

func NewFromOAuthToken(cloud string, oAuthToken string) (*Cloudinary, error)

NewFromOAuthToken returns a new Cloudinary instance from the provided cloud name and OAuth token.

func NewFromParams added in v1.0.0

func NewFromParams(cloud string, key string, secret string) (*Cloudinary, error)

NewFromParams returns a new Cloudinary instance from the provided parameters.

func NewFromURL added in v1.0.0

func NewFromURL(cloudinaryURL string) (*Cloudinary, error)

NewFromURL returns a new Cloudinary instance from a cloudinary url.

func (Cloudinary) File added in v1.2.0

func (c Cloudinary) File(publicID string) (*asset.Asset, error)

File creates a new asset.File instance.

func (Cloudinary) Image added in v1.2.0

func (c Cloudinary) Image(publicID string) (*asset.Asset, error)

Image creates a new asset.Image instance.

func (Cloudinary) Media added in v1.2.0

func (c Cloudinary) Media(publicID string) (*asset.Asset, error)

Media creates a new asset.Media instance.

func (Cloudinary) Video added in v1.2.0

func (c Cloudinary) Video(publicID string) (*asset.Asset, error)

Video creates a new asset.Video instance.

Source Files

Directories

Path Synopsis
api
Package api contains packages used for accessing Cloudinary API functionality.
Package api contains packages used for accessing Cloudinary API functionality.
admin
Package admin is used for accessing Cloudinary Admin API functionality.
Package admin is used for accessing Cloudinary Admin API functionality.
admin/metadata
Package metadata defines the structured metadata.
Package metadata defines the structured metadata.
uploader
Package uploader is used for accessing Cloudinary Upload API functionality.
Package uploader is used for accessing Cloudinary Upload API functionality.
Package config defines the Cloudinary configuration.
Package config defines the Cloudinary configuration.
example module
gen
Package logger defines the Cloudinary Logger
Package logger defines the Cloudinary Logger
Package transformation defines Cloudinary Transformation.
Package transformation defines Cloudinary Transformation.
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL