in datahub/implement.go [1229:1255]
func (datahub *DataHub) GetSubscriptionOffset(projectName, topicName, subId string, shardIds []string) (*GetSubscriptionOffsetResult, error) {
if !util.CheckProjectName(projectName) {
return nil, NewInvalidParameterErrorWithMessage(projectNameInvalid)
}
if !util.CheckTopicName(topicName) {
return nil, NewInvalidParameterErrorWithMessage(topicNameInvalid)
}
for _, id := range shardIds {
if !util.CheckShardId(id) {
return nil, NewInvalidParameterErrorWithMessage(shardIdInvalid)
}
}
path := fmt.Sprintf(offsetsPath, projectName, topicName, subId)
reqPara := &RequestParameter{
Header: map[string]string{httpHeaderContentType: httpJsonContent},
}
gsor := &GetSubscriptionOffsetRequest{
Action: "get",
ShardIds: shardIds,
}
respBody, commonResp, err := datahub.Client.Post(path, gsor, reqPara)
if err != nil {
return nil, err
}
return NewGetSubscriptionOffsetResult(respBody, commonResp)
}