CHECKPOINTS Received a "getCheckpoint" request
(rq *blip.Message)
| 212 | |
| 213 | // Received a "getCheckpoint" request |
| 214 | func (bh *blipHandler) handleGetCheckpoint(rq *blip.Message) error { |
| 215 | |
| 216 | client := rq.Properties[BlipClient] |
| 217 | bh.logEndpointEntry(rq.Profile(), fmt.Sprintf("Client:%s", client)) |
| 218 | |
| 219 | response := rq.Response() |
| 220 | if response == nil { |
| 221 | return nil |
| 222 | } |
| 223 | |
| 224 | value, err := bh.collection.GetSpecial(DocTypeLocal, CheckpointDocIDPrefix+client) |
| 225 | if err != nil { |
| 226 | return err |
| 227 | } |
| 228 | if value == nil { |
| 229 | return base.NewHTTPError(http.StatusNotFound, http.StatusText(http.StatusNotFound)) |
| 230 | } |
| 231 | response.Properties[GetCheckpointResponseRev] = value[BodyRev].(string) |
| 232 | delete(value, BodyRev) |
| 233 | delete(value, BodyId) |
| 234 | // TODO: Marshaling here when we could use raw bytes all the way from the bucket |
| 235 | _ = response.SetJSONBody(value) |
| 236 | return nil |
| 237 | } |
| 238 | |
| 239 | // Received a "setCheckpoint" request |
| 240 | func (bh *blipHandler) handleSetCheckpoint(rq *blip.Message) error { |
nothing calls this directly
no test coverage detected