Skip to content

Latest commit

 

History

History
96 lines (75 loc) · 2.29 KB

internal_proto_en.textile

File metadata and controls

96 lines (75 loc) · 2.29 KB

Terry-Mao/gopush-cluster Web http protocol document

Web internal interface document, used for push or delete messages so on

Interface Summary

Name URL Method
Push Single Private Message /1/admin/push/private POST
Push Multiple Private Message /1/admin/push/mprivate POST
Clean Message /1/admin/msg/del POST

Public ErrorCode

ErrorCode Description
0 Success
65534 Parameter Error
65535 Internal Error

Basic Response Json

{
    "ret": 0,  //ErrorCode
    "data": {….}//Data does not appear if data is null or ret != 0
}

Push Single Private Message

  • Request Parameter
Parameter Type Description
key string Subscription key
expire int64 Message Expire Time, Unit:second

Note: Messages stored in body and must be json format, service will intactly return to client. Above just as URL Parameter.

  • ErrorCode
ErrorCode Description
1001 no node
{
    "ret": 0
}

Push Multiple Private Message

  • Request Parameter
Parameter Type Description
expire int64 Message Expire Time, Unit:second
push-message json structure like following:
{
    "m": "{\"test\":1}",
    "k": "t1,t2,t3"
}
Parameter Type Description
m string push-message, must be json string
k string subcribe key, comma separated
  • ErrorCode
ErrorCode Description
1001 no node
{
    "data": {
        "fk": [ //if push part of messages failed, then return into fk. in normal case, no fk.
            "t1",
            "t2"
        ]
    },
    "ret": 0
}

Clean Message

Node: It will delete all of messages what belong to specify key and it will delete the Channel in the Comet-Service, for release memory

  • Request Parameter
Parameter Type Description
key string Subscription Key
  • ErrorCode
{
    "ret": 0
}