command
Version:
v1.5.6
Opens a new window with list of versions in this module.
Published: Apr 2, 2022
License: Apache-2.0
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
kie.go start a listener from ServiceComb-Kie server, and watch config changes.
if you want to run kie.go, you should do that:
-
start a ServiceComb-Kie server. (Quick start)
-
(optional) in main function, replace http://127.0.0.1:30110
to your ServiceComb-Kie server url.
-
run command to create a configuration to kie (if your ServiceComb-Kie server url is http://127.0.0.1:30110
):
curl -X POST -H 'Content-Type:application/json' http://127.0.0.1:30110/v1/default/kie/kv -d '{"key": "user","labels":{"appId":"foo","serviceName":"bar","version":"1.0.0","environment":"prod"},"value":"admin","value_type":"text","status":"enabled"}'
and you will receive a response like:
{
"id": "b8c27a45-d7fa-413a-8b14-bdc905c4f917",
"label_id": "25cb9189-4233-4af9-95e0-2f008ed33aa6",
"key": "user",
"value": "admin",
"value_type": "text",
"create_revision": 2,
"update_revision": 2,
"create_time": 1585818114,
"update_time": 1585818114,
"labels": {
"appId": "foo",
"environment": "prod",
"serviceName": "bar",
"version": "1.0.0"
}
}
record the id
in the response
export id=b8c27a45-d7fa-413a-8b14-bdc905c4f917
-
run command to start demo:
go run kie.go
-
you can see that the console will print out the value admin
of the key user
created in the previous step.
-
run command to update the configuration, the parameter id
is obtained in the response of creation
curl -X PUT -H 'Content-Type:application/json' http://127.0.0.1:30110/v1/default/kie/kv/${id} -d '{"value":"guest"}'
-
you can see a configuration update events and new values guest
of the key user
in the console
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.