rkljw da65e32526 第一次提交 пре 10 месеци
..
publish da65e32526 第一次提交 пре 10 месеци
src da65e32526 第一次提交 пре 10 месеци
.gitattributes da65e32526 第一次提交 пре 10 месеци
LICENSE da65e32526 第一次提交 пре 10 месеци
README.md da65e32526 第一次提交 пре 10 месеци
composer.json da65e32526 第一次提交 пре 10 месеци

README.md

Nacos SDK

安装

composer require hyperf/nacos

使用

<?php

use Hyperf\Nacos\Application;
use Hyperf\Nacos\Config;
use Hyperf\Codec\Json;

$application = new Application(new Config([
    'username' => 'nacos',
    'password' => 'nacos',
    'guzzle_config' => [
        'headers' => [
            'charset' => 'UTF-8',
        ],
    ],
]));

$response = $application->auth->login('nacos', 'nacos');
$result = Json::decode((string) $response->getBody());

$response = $application->config->get('hyperf-service-config', 'DEFAULT_GROUP');
$result = Json::decode((string) $response->getBody());