cloudinary

package module
v0.0.0-...-13be333 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2017 License: MIT Imports: 12 Imported by: 0

README

cloudinary-go

this package provides support for managing static assets on the Cloudinary service

Documentation

Overview

Package cloudinary cloudinary provides support for managing static assets on the Cloudinary service.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	Message string `json:"message"`
}

APIError ...

func (*APIError) Error

func (e *APIError) Error() string

type Cloudinary

type Cloudinary struct {
	// contains filtered or unexported fields
}

Cloudinary the service

func New

func New(uri string) (*Cloudinary, error)

New instances new Cloudinary the uri param must be a valid URI with the cloudinary:// scheme. e.g. cloudinary://api_key:api_secret@cloud_name

func (*Cloudinary) Delete

func (c *Cloudinary) Delete(name string) error

Delete deletes image from cloudinary

func (*Cloudinary) DeleteVideo

func (c *Cloudinary) DeleteVideo(name string) error

DeleteVideo deletes video from cloudinary

func (*Cloudinary) Upload

func (c *Cloudinary) Upload(r io.Reader, name string) (*UploadResponse, error)

Upload uploads image. if name keep "" the file name will be random

func (*Cloudinary) UploadVideo

func (c *Cloudinary) UploadVideo(r io.Reader, name string) (*UploadResponse, error)

UploadVideo uploads video. if name keep "" the file name will be random

type UploadResponse

type UploadResponse struct {
	PublicID     string `json:"public_id"`
	Version      uint   `json:"version"`
	Signature    string `json:"signature"`
	Width        int    `json:"width"`
	Height       int    `json:"width"`
	Format       string `json:"format"`
	ResourceType string `json:"resource_type"`
	CreatedAt    string `json:"created_at"`
	Bytes        int    `json:"bytes"`
	URL          string `json:"url"`
	SecureURL    string `json:"secure_url"`
}

UploadResponse ...

type UploadType

type UploadType string

UploadType image, video, raw

const (
	ImageType UploadType = "image"
	VideoType            = "video"
)

Upload types

Jump to

Keyboard shortcuts

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