commit | 9ca316ea3a14dd96c116f54ce863b284458d4337 | [log] [tgz] |
---|---|---|
author | Lisandro <lishuo5263@163.com> | Mon Apr 25 10:34:41 2022 +0800 |
committer | GitHub <noreply@github.com> | Mon Apr 25 10:34:41 2022 +0800 |
tree | 4d08b925adfca9149fc907d202565b6f94b108d6 | |
parent | 96ea504e23f4fd67e40803e2ecd4502f0aba0655 [diff] |
[feature: add register metadata & go package management.] (#6) * [feature: add default handle logic & refactor shenyu_admin_client.go.] * [feature: fix default password.] * [feature: add register metadata & go package management.] Co-authored-by: lishuo <lishuo@mesomia-tech.com>
Shenyu-client-golang for Go client allows you to access ShenYu Gateway,it supports registory go service to ShenYu Gateway.
Supported Go version over 1.12
Supported ShenYu version over 2.4.3
Use go get
to install SDK:
$ go get -u github.com/apache/incubator-shenyu-client-golang
1.Fist make sure The ShenYuAdmin is Started, and ShenYuAdmin service active port is 9095.
2.Get shenyu_admin_client. (Register service need this)
//init ShenYuAdminClient adminClient := &model.ShenYuAdminClient{ UserName: "admin", //require user provide Password: "123456", //require user provide } adminTokenData, err := clients.NewShenYuAdminClient(adminClient) The adminTokenData like this : { "code":200, "message":"login dashboard user success", "data":{ "id":"1", "userName":"admin", "role":1, "enabled":true, "dateCreated":"2018-06-23 15:12:22", "dateUpdated":"2022-03-09 15:08:14", "token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6ImFkbWluIiwiZXhwIjoxNjUwNjc5OTQ2fQ.K92Il2kmJ0X3FgjY4igW35-pw9nsf5VKdUyqBoyIaF4" } } When you success get toekn, you will see this : this is ShenYu Admin client token -> eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyTmFtZSI6ImFkbWluIiwiZXhwIjoxNjUwNjc5OTQ2fQ.K92Il2kmJ0X3FgjY4igW35-pw9nsf5VKdUyqBoyIaF4