Giter Site home page Giter Site logo

gunnarlieb / cbox-cachebox-couchbase-provider Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coldbox-modules/cbox-cachebox-couchbase-provider

0.0 2.0 0.0 10.84 MB

A ColdBox module that adds support for Couchbase Server as a CacheBox Provider

ColdFusion 100.00%

cbox-cachebox-couchbase-provider's Introduction

Hex.pm TestBox ColdBox Build Status

CacheBox Couchbase Provider Module

The Couchbase Provider for Cachebox is a ColdBox 4.x module that allows you to connect CacheBox to a Couchbase cluster and leverage that cluster in your ColdBox applications.

LICENSE

Apache License, Version 2.0.

IMPORTANT LINKS

SYSTEM REQUIREMENTS

  • Lucee 4.5+
  • ColdFusion 11+
  • ColdBox 4.x

INSTRUCTIONS

Just drop into your modules folder or use CommandBox to install

box install couchbase-cachebox-provider

This will install our module and its dependenices into your modules folder.

Settings

You can add a couchbaseCacheBoxProvider structure to your moduleSettings structure to your ColdBox.cfc to configure custom caches. Each cache region you define follows the same approach as registering custom caches in CacheBox (https://cachebox.ortusbooks.com/content/cachebox_configuration/caches.html). The only difference, is that the properties for the cache are basically the properties for the cfcouchbase SDK to use for connecting to a bucket.

Each cache region has a different CouchbaseClient instance configured for operation (https://cfcouchbase.ortusbooks.com/configuration/config_settings.html). Below are the basic configuration properties. Please refer to the documentation or API docs for further information about the cfcouchbase SDK (http://apidocs.ortussolutions.com.s3.amazonaws.com/cfcouchbase/2.0.0/cfcouchbase/config/CouchbaseConfig.html)

This provider also comes with two cache implementations you can use when defining caches:

  • CouchbaseProvider - Implements the CacheBox provider interface and can interact with Couchbase
  • CouchbaseColdboxProvider - Implements the ColdBox CacheBox provider which allows it to be used for event and view caching as a template cache.
moduleSettings = {

	// Provider Configuration Settings
	couchbaseCacheBoxProvider = {
		// Register all the custom named caches you like here using CacheBox Syntax
		// https://cachebox.ortusbooks.com/content/cachebox_configuration/caches.html
		caches : { 
			"template" : {
				provider 	: "couchbaseCacheboxProvider.models.CouchbaseColdBoxProvider",
				properties 	: {
					// The default timeout for cache entries
					objectDefaultTimeout    : 120,
					// Ignores timeouts on Couchbase operations due to async natures
					ignoreCouchbaseTimeouts : true,
					// The bucketname in Couchbase to store cache entries under, the default value is 'default'
					bucket                  : "default",
					// The list of servers in the Couchbase cluster
					servers					: "127.0.0.1:8091",
					// The username for the Couchbase bucket, if any
					username				: "",
					// The password for the Couchbase bucket, if any
					password				: ""
				}
			},
			"couchBase" : {
				provider 	: "couchbaseCacheboxProvider.models.CouchbaseProvider",
				properties 	: {
					// The default timeout for cache entries
					objectDefaultTimeout    : 120,
					// Ignores timeouts on Couchbase operations due to async natures
					ignoreCouchbaseTimeouts : true,
					// The bucketname in Couchbase to store cache entries under, the default value is 'default'
					bucket                  : "default",
					// The list of servers in the Couchbase cluster
					servers					: "127.0.0.1:8091",
					// The username for the Couchbase bucket, if any
					username				: "",
					// The password for the Couchbase bucket, if any
					password				: ""
				}
			}
		}
	}
}

Please remember that you can pass any name-value pair in the properties struct to configure the couchbase SDK according to the CouchbaseClient object: http://apidocs.ortussolutions.com.s3.amazonaws.com/cfcouchbase/2.0.0/cfcouchbase/config/CouchbaseConfig.html


Copyright Since 2005 ColdBox Framework by Luis Majano and Ortus Solutions, Corp www.coldbox.org | www.luismajano.com | www.ortussolutions.com


HONOR GOES TO GOD ABOVE ALL

Because of His grace, this project exists. If you don't like this, then don't read it, its not for you.

"Therefore being justified by faith, we have peace with God through our Lord Jesus Christ: By whom also we have access by faith into this grace wherein we stand, and rejoice in hope of the glory of God. And not only so, but we glory in tribulations also: knowing that tribulation worketh patience; And patience, experience; and experience, hope: And hope maketh not ashamed; because the love of God is shed abroad in our hearts by the Holy Ghost which is given unto us. ." Romans 5:5

THE DAILY BREAD

"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)" Jn 14:1-12

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.