Giter Site home page Giter Site logo

googlecloudstorage's Introduction

GoogleCloudStorage

Implements Google Cloud Storage Rest XML Api for Coldbox Coldfusion See https://cloud.google.com/storage/docs/migrating

Installation

This API can be installed as standalone or as a ColdBox Module. Either approach requires a simple CommandBox command:

box install GoogleCloudStorage

Then follow either the standalone or module instructions below.

Standalone

This API will be installed into a directory called GoogleCloudStorage and then the API can be instantiated via new GoogleCloudStoreage.models.GoogleStorage() with the following constructor arguments:

<cfargument name="accessKey" 			required="true">
<cfargument name="secretKey" 			required="true">
<cfargument name="encryption_charset" 	required="false" default="utf-8">
<cfargument name="ssl" 					required="false" default="false">

ColdBox Module

This package also is a ColdBox module as well. The module can be configured by creating an GoogleStorageSettings configuration structure in your application configuration file: config/Coldbox.cfc with the following settings:

GoogleStorageSettings = {
	// Your Google access key
	accessKey = "",
	// Your Google secret key
	secretKey = "",
	// The default encryption character set
	encryption_charset = "utf-8",
	// SSL mode or not on cfhttp calls.
	ssl = false
};

Then you can leverage the API CFC via the injection DSL: GoogleStorage@GoogleCloudStorage

Usage

component{
	property name="ggl" inject="GoogleStorage@GoogleCloudStorage";
	
	function index(event,rc,prc){
		
		// get all buckets
		var allBuckets=ggl.listBuckets();
		
		// store a file in a buckets
		var uploadedFile=ggl.putObjectFile('akitogo','C:\temp\myfile.jpg');
		writeDump(allBuckets);
		writeDump(uploadedFile);
		abort;
	}
}

Written by

www.akitogo.com

Disclaimer

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

googlecloudstorage's People

Contributors

gunnarlieb avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

spillsthrills

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.