cloudinary

package module
v0.0.0-...-16ecf81 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: MIT Imports: 15 Imported by: 0

README

go-cloudinary

GoDoc

A simplified Cloudinary Go client library. Modified from the works in https://github.com/gotsunami/go-cloudinary and https://github.com/tumelohq/go-cloudinary.

Documentation

Overview

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

The Cloudinary service allows image and raw files management in the cloud.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	PublicID     string `json:"public_id,omitempty"`
	SecureURL    string `json:"secure_url,omitempty"`
	Version      uint   `json:"version,omitempty"`
	Format       string `json:"format,omitempty"`
	ResourceType string `json:"resource_type,omitempty"`
	Size         int    `json:"bytes,omitempty"` // In bytes
	Result       string `json:"result,omitempty"`
}

Response from calling API.

type Service

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

Service is the cloudinary service it allows uploading of images to cloudinary

func Dial

func Dial(uri string) (*Service, error)

Dial will use the url to connect to the Cloudinary service. The uri parameter must be a valid URI with the cloudinary:// scheme, e.g. cloudinary://api_key:api_secret@cloud_name

func (*Service) UploadByFile

func (s *Service) UploadByFile(path, resourceType string) (*Response, error)

UploadFile will upload a file to cloudinary

func (*Service) UploadByIOReader

func (s *Service) UploadByIOReader(reader io.Reader, resourceType string) (*Response, error)

UploadByIOReader upload a file to cloudinary from a reader

func (*Service) UploadByURL

func (s *Service) UploadByURL(addr, resourceType string) (*Response, error)

UploadImageURL will add an image to cloudinary when given a URL to the image

func (*Service) UploadDestroy

func (s *Service) UploadDestroy(publicID, resourceType string) error

Delete a resource in Cloudinary via public ID

Jump to

Keyboard shortcuts

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