PHP Класс Basho\Riak\Node\Builder

simple local development / testing cluster use Basho\Riak\Node; $nodes = (new Node\Builder) ->buildLocalhost([10018, 10028, 10038, 10048, 10058]); password authentication to production cluster use Basho\Riak\Node; $nodes = (new Node\Builder) ->onPort(8098) ->usingPasswordAuthentication('riakuser', 'riakpassword') ->withCertificateAuthorityFile(getcwd() . '/path/to/cacert.pem') ->buildCluster(['riak1.company.int','riak2.company.int','riak3.company.int']); certificate authentication to production load balanced cluster use Basho\Riak\Node; $node = (new Node\Builder) ->atHost('riak.company.int') ->onPort(8098) ->usingCertificateAuthentication(getcwd() . '/path/to/client.crt') ->withCertificateAuthorityFile(getcwd() . '/path/to/cacert.pem') ->build(); pam authentication to production load balanced cluster use Basho\Riak\Node; $node = (new Node\Builder) ->atHost('riak.company.int') ->onPort(8098) ->usingPamAuthentication('riakuser') ->withCertificateAuthorityFile(getcwd() . '/path/to/cacert.pem') ->build();
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$config Config | null Internal storage

Открытые методы

Метод Описание
__construct ( )
atHost ( $host ) Build with host address
build ( ) : Node Build node
buildCluster ( array $hosts = ['localhost'] ) : Node[] Build distributed cluster
buildLocalhost ( array $ports = [8087] ) : Node[] Build local node cluster
getConfig ( ) : Config | null
onPort ( $port ) Build node objects with configuration to use a specific port number
usingCertificateAuthentication ( $certificate, string $password = '' ) usingCertificateAuthentication
usingPamAuthentication ( $user ) usingPamAuthentication
usingPasswordAuthentication ( $user, $pass = '' ) usingPasswordAuthentication
usingTrustAuthentication ( string $user = '' ) usingTrustAuthentication
withCertificateAuthorityDirectory ( $ca_directory ) withCertificateAuthorityDirectory
withCertificateAuthorityFile ( $ca_file ) withCertificateAuthorityDirectory
withConnectionTimeout ( $timeout ) Client side connection timeout for requests
withPrivateKey ( $private_key, $password = '' )
withStreamTimeout ( $timeout ) Client side socket read/write timeout for requests

Защищенные методы

Метод Описание
validate ( ) Builder configuration validation

Описание методов

__construct() публичный Метод

public __construct ( )

atHost() публичный Метод

Build node objects with configuration to use a specific host address
public atHost ( $host )
$host

build() публичный Метод

Validate configuration for a single node object, then build it
public build ( ) : Node
Результат Basho\Riak\Node

buildCluster() публичный Метод

Build node objects configured to listen on the same port but different hosts. Commonly used in staging and production environments where you have multiple Riak nodes on multiple machines / vms.
public buildCluster ( array $hosts = ['localhost'] ) : Node[]
$hosts array
Результат Basho\Riak\Node[]

buildLocalhost() публичный Метод

Build multiple node objects configured with the same host address but different ports. Commonly used in development environments where you have multiple Riak nodes on a single machine / vm.
public buildLocalhost ( array $ports = [8087] ) : Node[]
$ports array
Результат Basho\Riak\Node[]

getConfig() публичный Метод

public getConfig ( ) : Config | null
Результат Config | null

onPort() публичный Метод

Build node objects with configuration to use a specific port number
public onPort ( $port )
$port

usingCertificateAuthentication() публичный Метод

Build nodes with certificate authentication User authentication and access rules are only available in Riak versions 2 and above. To use this feature, TSL is required to communicate with your Riak nodes. CURRENTLY NOT SUPPORTED OVER THE RIAK HTTP API
public usingCertificateAuthentication ( $certificate, string $password = '' )
$certificate
$password string

usingPamAuthentication() публичный Метод

Build nodes with PAM authentication User authentication and access rules are only available in Riak versions 2 and above. To use this feature, TSL is required to communicate with your Riak nodes.
public usingPamAuthentication ( $user )
$user

usingPasswordAuthentication() публичный Метод

Build nodes with password authentication User authentication and access rules are only available in Riak versions 2 and above. To use this feature, TSL is required to communicate with your Riak nodes.
public usingPasswordAuthentication ( $user, $pass = '' )
$user
$pass

usingTrustAuthentication() публичный Метод

Build nodes with trust authentication User authentication and access rules are only available in Riak versions 2 and above. To use this feature, TSL is required to communicate with your Riak nodes.
public usingTrustAuthentication ( string $user = '' )
$user string

validate() защищенный Метод

Checks the current configuration of the Node Builder for errors. This method should be executed before each Node is built.
protected validate ( )

withCertificateAuthorityDirectory() публичный Метод

Directory where the CA file can be found. A Certificate Authority file is required for any secure connections to Riak
public withCertificateAuthorityDirectory ( $ca_directory )
$ca_directory

withCertificateAuthorityFile() публичный Метод

Path to CA file. A Certificate Authority file is required for any secure connections to Riak
public withCertificateAuthorityFile ( $ca_file )
$ca_file

withConnectionTimeout() публичный Метод

Client side connection timeout for requests
public withConnectionTimeout ( $timeout )
$timeout

withPrivateKey() публичный Метод

public withPrivateKey ( $private_key, $password = '' )

withStreamTimeout() публичный Метод

Client side socket read/write timeout for requests
public withStreamTimeout ( $timeout )
$timeout

Описание свойств

$config защищенное свойство

Internal storage
protected Config,Basho\Riak\Node|null $config
Результат Config | null