Skip to content

Commit

Permalink
feat: get active peer count (#1315)
Browse files Browse the repository at this point in the history
* feat: get active peer count

Signed-off-by: Gaius <gaius.qi@gmail.com>

* feat: add peers handler

Signed-off-by: Gaius <gaius.qi@gmail.com>
  • Loading branch information
gaius-qi committed May 19, 2022
1 parent b580ea6 commit c26b6aa
Show file tree
Hide file tree
Showing 10 changed files with 371 additions and 262 deletions.
171 changes: 73 additions & 98 deletions api/manager/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,41 @@ const docTemplate = `{
}
}
},
"/peers": {
"get": {
"description": "Get Peers",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Peer"
],
"summary": "Get Peers",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"type": "string"
}
}
},
"400": {
"description": ""
},
"404": {
"description": ""
},
"500": {
"description": ""
}
}
}
},
"/permissions": {
"get": {
"description": "Get Permissions",
Expand Down Expand Up @@ -3507,15 +3542,9 @@ const docTemplate = `{
"bio": {
"type": "string"
},
"created_at": {
"type": "string"
},
"download_rate_limit": {
"type": "integer"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
Expand All @@ -3534,9 +3563,6 @@ const docTemplate = `{
"state": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"url": {
"type": "string"
},
Expand All @@ -3548,22 +3574,52 @@ const docTemplate = `{
}
}
},
"model.Config": {
"model.Assertion": {
"type": "object",
"properties": {
"bio": {
"key": {
"type": "string"
},
"created_at": {
"type": "string"
"policy": {
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
"id": {
"type": "integer"
"policyMap": {
"type": "object",
"additionalProperties": {
"type": "integer"
}
},
"name": {
"rm": {},
"tokens": {
"type": "array",
"items": {
"type": "string"
}
},
"value": {
"type": "string"
}
}
},
"model.AssertionMap": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/model.Assertion"
}
},
"model.Config": {
"type": "object",
"properties": {
"bio": {
"type": "string"
},
"updated_at": {
"name": {
"type": "string"
},
"user_id": {
Expand All @@ -3587,12 +3643,6 @@ const docTemplate = `{
"bio": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"result": {
"$ref": "#/definitions/model.JSONMap"
},
Expand All @@ -3617,9 +3667,6 @@ const docTemplate = `{
"type": {
"type": "string"
},
"updated_at": {
"type": "string"
},
"user_id": {
"type": "integer"
}
Expand All @@ -3637,35 +3684,20 @@ const docTemplate = `{
"client_secret": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"redirect_url": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
"model.Scheduler": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"host_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"idc": {
"type": "string"
},
Expand All @@ -3686,9 +3718,6 @@ const docTemplate = `{
},
"state": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
Expand All @@ -3707,12 +3736,6 @@ const docTemplate = `{
"config": {
"$ref": "#/definitions/model.JSONMap"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_default": {
"type": "boolean"
},
Expand All @@ -3736,9 +3759,6 @@ const docTemplate = `{
"items": {
"$ref": "#/definitions/model.SeedPeerCluster"
}
},
"updated_at": {
"type": "string"
}
}
},
Expand All @@ -3748,12 +3768,6 @@ const docTemplate = `{
"bio": {
"type": "string"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
Expand All @@ -3762,9 +3776,6 @@ const docTemplate = `{
"items": {
"$ref": "#/definitions/model.SecurityRule"
}
},
"updated_at": {
"type": "string"
}
}
},
Expand All @@ -3774,15 +3785,9 @@ const docTemplate = `{
"bio": {
"type": "string"
},
"created_at": {
"type": "string"
},
"domain": {
"type": "string"
},
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
Expand All @@ -3794,27 +3799,18 @@ const docTemplate = `{
"items": {
"$ref": "#/definitions/model.SecurityGroup"
}
},
"updated_at": {
"type": "string"
}
}
},
"model.SeedPeer": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"download_port": {
"type": "integer"
},
"host_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"idc": {
"type": "string"
},
Expand All @@ -3841,9 +3837,6 @@ const docTemplate = `{
},
"type": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
Expand All @@ -3859,12 +3852,6 @@ const docTemplate = `{
"config": {
"$ref": "#/definitions/model.JSONMap"
},
"created_at": {
"type": "string"
},
"id": {
"type": "integer"
},
"is_default": {
"type": "boolean"
},
Expand All @@ -3888,9 +3875,6 @@ const docTemplate = `{
},
"security_group_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
}
}
},
Expand All @@ -3903,15 +3887,9 @@ const docTemplate = `{
"bio": {
"type": "string"
},
"created_at": {
"type": "string"
},
"email": {
"type": "string"
},
"id": {
"type": "integer"
},
"location": {
"type": "string"
},
Expand All @@ -3923,9 +3901,6 @@ const docTemplate = `{
},
"state": {
"type": "string"
},
"updated_at": {
"type": "string"
}
}
},
Expand Down

0 comments on commit c26b6aa

Please sign in to comment.