commit | 96ea504e23f4fd67e40803e2ecd4502f0aba0655 | [log] [tgz] |
---|---|---|
author | Lisandro <lishuo5263@163.com> | Fri Apr 22 16:49:41 2022 +0800 |
committer | GitHub <noreply@github.com> | Fri Apr 22 16:49:41 2022 +0800 |
tree | 9f5b1d8b98aa56d31d01501e645e048ba12142ec | |
parent | 2229b5f8bd2a517f523426f71ed6b345751a3e9d [diff] |
[Feature: add default handle logic & refactor shenyu_admin_client] (#5) * [feature: add default handle logic & refactor shenyu_admin_client.go.] * [feature: fix default password.] 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