lib/aerospike_store.js
function AerospikeStore (options) {
    if (!(this instanceof AerospikeStore)) {
      throw new TypeError('Cannot call AerospikeStore constructor as a function')
    }

    options = options || {}
    Store.call(this, options)

    this.as_namespace = options.namespace || 'test'
    this.as_set = options.set || 'express-session'
    this.ttl = options.ttl
    this.mapper = options.mapper || new DataMapper()

    if (options.serializer) {
      throw new Error('The `serializer` option is no longer supported - supply a custom data mapper instead.')
    }

    if (options.client) {
      this.client = options.client
    } else {
      this.client = Aerospike.client(options)
      this.client.connect(error => {
        if (error) {
          debug('ERROR - %s', error.message)
          process.nextTick(() => this._onDisconnected())
        } else {
          process.nextTick(() => this._onConnected())
        }
      })
    }

    this.connected = false
    this.client.on('nodeAdded', () => this._onConnected())
    this.client.on('disconnected', () => this._onDisconnected())
  }
function AerospikeStore (options) {
    if (!(this instanceof AerospikeStore)) {
      throw new TypeError('Cannot call AerospikeStore constructor as a function')
    }

    options = options || {}
    Store.call(this, options)

    this.as_namespace = options.namespace || 'test'
    this.as_set = options.set || 'express-session'
    this.ttl = options.ttl
    this.mapper = options.mapper || new DataMapper()

    if (options.serializer) {
      throw new Error('The `serializer` option is no longer supported - supply a custom data mapper instead.')
    }

    if (options.client) {
      this.client = options.client
    } else {
      this.client = Aerospike.client(options)
      this.client.connect(error => {
        if (error) {
          debug('ERROR - %s', error.message)
          process.nextTick(() => this._onDisconnected())
        } else {
          process.nextTick(() => this._onConnected())
        }
      })
    }

    this.connected = false
    this.client.on('nodeAdded', () => this._onConnected())
    this.client.on('disconnected', () => this._onDisconnected())
  }
function AerospikeStore ( options ) { if ( ! ( this instanceof AerospikeStore ) ) { throw new TypeError ( 'Cannot call AerospikeStore constructor as a function' ) } options = options || { } Store . call ( this , options ) this . as_namespace = options . namespace || 'test' this . as_set = options . set || 'express-session' this . ttl = options . ttl this . mapper = options . mapper || new DataMapper ( ) if ( options . serializer ) { throw new Error ( 'The `serializer` option is no longer supported - supply a custom data mapper instead.' ) } if ( options . client ) { this . client = options . client } else { this . client = Aerospike . client ( options ) this . client . connect ( error => { if ( error ) { debug ( 'ERROR - %s' , error . message ) process . nextTick ( ( ) => this . _onDisconnected ( ) ) } else { process . nextTick ( ( ) => this . _onConnected ( ) ) } } ) } this . connected = false this . client . on ( 'nodeAdded' , ( ) => this . _onConnected ( ) ) this . client . on ( 'disconnected' , ( ) => this . _onDisconnected ( ) ) }
Return the `AerospikeStore` extending `express`'s session Store.

@param {Object} express session
@return {Function}
@public
Return the AerospikeStore extending express s session Store .