ETCD 协程客户端

优质
小牛编辑
143浏览
2023-12-01

安装

composer require hyperf/etcd

添加配置文件 etcd.php

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

使用

<?php

use Hyperf\Utils\ApplicationContext;
use Hyperf\Etcd\KVInterface;

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