Git Product home page Git Product logo

go-cloudinary's Introduction

go-cloudinary

A Go client library and CLI tool to upload static assets to the Cloudinary service.

Installation

Install the CLI tool and the library with:

go get github.com/gotsunami/go-cloudinary/cloudinary

Usage

Usage:

cloudinary [options] action settings.conf

where action is one of ls, rm, up or url.

Create a config file settings.conf with a [cloudinary] section:

[cloudinary]
uri=cloudinary://api_key:api_secret@cloud_name

Type cloudinary in the terminal to get some help.

Uploading files

Use the up action to upload an image (or a directory of images) to Cloudinary with -i option:

$ cloudinary -i /path/to/img.png up settings.conf
$ cloudinary -i /path/to/images/ up settings.conf

In order to upload raw files, use the -r option. For example, a CSS file can be upload with:

$ cloudinary -r /path/to/default.css up settings.conf

Raw files can be of any type (css, js, pdf etc.), even images if you don't care about not using Cloudinary's image processing features.

List Remote Resources

Using the ls action will list all uploaded images and raw files:

$ cloudinary ls settings.conf

Delete Remote Resources

Use the rm action to delete resources and give the -i or -r public_id for the resource:

$ cloudinary -i img/home rm settings.conf
$ cloudinary -r media/js/jquery-min.js rm settings.conf

Delete all remote resources(!) with:

$ cloudinary -a rm settings.conf

In any case, you can always use the -s flag to simulate an action and see what result to expect. i

go-cloudinary's People

Contributors

aboutofpluto avatar asasmoyo avatar kyokomi avatar matm avatar octopusrage avatar tfutada avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.