Back to Hyperf

ETCD

docs/en/etcd.md

3.1.68413 B
Original Source

ETCD

Install

composer require hyperf/etcd

Add configuration file etcd.php

php
<?php
return [
    'uri' => 'http://192.168.1.200:2379',
    'version' => 'v3beta',
    'options' => [
        'timeout' => 10,
    ],
];

Usage

php
<?php

use Hyperf\Context\ApplicationContext;
use Hyperf\Etcd\KVInterface;

$client = ApplicationContext::getContainer()->get(KVInterface::class);