in datahub/implement.go [1364:1401]
func (datahub *DataHub) SyncGroup(projectName, topicName, consumerGroup, consumerId string, versionId int64, releaseShardList, readEndShardList []string) (*SyncGroupResult, error) {
if !util.CheckProjectName(projectName) {
return nil, NewInvalidParameterErrorWithMessage(projectNameInvalid)
}
if !util.CheckTopicName(topicName) {
return nil, NewInvalidParameterErrorWithMessage(topicNameInvalid)
}
if len(releaseShardList) == 0 || len(readEndShardList) == 0 {
return nil, NewInvalidParameterErrorWithMessage(shardListInvalid)
}
for _, id := range releaseShardList {
if !util.CheckShardId(id) {
return nil, NewInvalidParameterErrorWithMessage(shardIdInvalid)
}
}
for _, id := range readEndShardList {
if !util.CheckShardId(id) {
return nil, NewInvalidParameterErrorWithMessage(shardIdInvalid)
}
}
path := fmt.Sprintf(consumerGroupPath, projectName, topicName, consumerGroup)
reqPara := &RequestParameter{
Header: map[string]string{httpHeaderContentType: httpJsonContent},
}
sgr := &SyncGroupRequest{
Action: "syncGroup",
ConsumerId: consumerId,
VersionId: versionId,
ReleaseShardList: releaseShardList,
ReadEndShardList: readEndShardList,
}
_, commonResp, err := datahub.Client.Post(path, sgr, reqPara)
if err != nil {
return nil, err
}
return NewSyncGroupResult(commonResp)
}