PHP 클래스 LinkORB\Component\Etcd\Client

파일 보기 프로젝트 열기: linkorb/etcd-php 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( $server = '', $version = 'v2' )
doRequest ( string $uri ) : mixed Do a server request
get ( string $key, array $flags = null ) : string Retrieve the value of a key
getKeysValue ( $root = '/', boolean $recursive = true, string $key = null ) : array Get all key-value pair that the key is not directory.
getNode ( string $key, array $flags = null ) : array Retrieve the value of a key
listDir ( string $key = '/', boolean $recursive = false ) : mixed Retrieve a directory
ls ( string $key = '/', boolean $recursive = false ) : array Retrieve a directories key
mk ( string $key, string $value, integer $ttl ) : array make a new key with a given value
mkdir ( string $key, integer $ttl ) : array make a new directory
mkdirWithInOrderKey ( string $dir, integer $ttl ) : array create a new directory with auto generated id
rm ( string $key ) : array | stdClas\stdClass remove a key
rmdir ( string $key, boolean $recursive = false ) : mixed Removes the key if it is directory
set ( string $key, string $value, integer $ttl = null, array $condition = [] ) : stdClass Set the value of a key
setRoot ( string $root ) : Client Set the default root directory. the default is / If the root is others e.g. /linkorb when you set new key, or set dir, all of the key is under the root e.g.
setWithInOrderKey ( string $dir, string $value, integer $ttl, array $condition = [] ) : array create a new key in a directory with auto generated id
update ( strint $key, string $value, integer $ttl, array $condition = [] ) : array Update an existing key with a given value.
updateDir ( string $key, integer $ttl ) : array Update directory

비공개 메소드들

메소드 설명
buildKeyUri ( string $key ) : string Build key space operations
traversalDir ( RecursiveArrayIterator $iterator ) : array Traversal the directory to get the keys.

메소드 상세

__construct() 공개 메소드

public __construct ( $server = '', $version = 'v2' )

doRequest() 공개 메소드

Do a server request
public doRequest ( string $uri ) : mixed
$uri string
리턴 mixed

get() 공개 메소드

Retrieve the value of a key
public get ( string $key, array $flags = null ) : string
$key string
$flags array the extra query params
리턴 string the value of the key.

getKeysValue() 공개 메소드

Get all key-value pair that the key is not directory.
public getKeysValue ( $root = '/', boolean $recursive = true, string $key = null ) : array
$recursive boolean
$key string
리턴 array

getNode() 공개 메소드

Retrieve the value of a key
public getNode ( string $key, array $flags = null ) : array
$key string
$flags array the extra query params
리턴 array

listDir() 공개 메소드

Retrieve a directory
public listDir ( string $key = '/', boolean $recursive = false ) : mixed
$key string
$recursive boolean
리턴 mixed

ls() 공개 메소드

Retrieve a directories key
public ls ( string $key = '/', boolean $recursive = false ) : array
$key string
$recursive boolean
리턴 array

mk() 공개 메소드

make a new key with a given value
public mk ( string $key, string $value, integer $ttl ) : array
$key string
$value string
$ttl integer
리턴 array $body

mkdir() 공개 메소드

make a new directory
public mkdir ( string $key, integer $ttl ) : array
$key string
$ttl integer
리턴 array $body

mkdirWithInOrderKey() 공개 메소드

create a new directory with auto generated id
public mkdirWithInOrderKey ( string $dir, integer $ttl ) : array
$dir string
$ttl integer
리턴 array $body

rm() 공개 메소드

remove a key
public rm ( string $key ) : array | stdClas\stdClass
$key string
리턴 array | stdClas\stdClass

rmdir() 공개 메소드

Removes the key if it is directory
public rmdir ( string $key, boolean $recursive = false ) : mixed
$key string
$recursive boolean
리턴 mixed

set() 공개 메소드

Set the value of a key
public set ( string $key, string $value, integer $ttl = null, array $condition = [] ) : stdClass
$key string
$value string
$ttl integer
$condition array
리턴 stdClass

setRoot() 공개 메소드

$client->setRoot('/linkorb'); $client->set('key1, 'value1'); the new key is /linkorb/key1
public setRoot ( string $root ) : Client
$root string
리턴 Client

setWithInOrderKey() 공개 메소드

create a new key in a directory with auto generated id
public setWithInOrderKey ( string $dir, string $value, integer $ttl, array $condition = [] ) : array
$dir string
$value string
$ttl integer
$condition array
리턴 array $body

update() 공개 메소드

Update an existing key with a given value.
public update ( strint $key, string $value, integer $ttl, array $condition = [] ) : array
$key strint
$value string
$ttl integer
$condition array The extra condition for updating
리턴 array $body

updateDir() 공개 메소드

Update directory
public updateDir ( string $key, integer $ttl ) : array
$key string
$ttl integer
리턴 array $body