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();
파일 보기 프로젝트 열기: basho/riak-php-client

보호된 프로퍼티들

프로퍼티 타입 설명
$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