Example #1
0
func (h *Handler) GetMissingBlobIds(ids [][]byte) (r [][]byte, err error) {
	var req proto.IDSlice
	if err = (&req).UnmarshalThrift(ids); err != nil {
		return
	}

	res1, err := h.Storage.GetMissingBlobIDs(req)
	if err != nil {
		return
	}
	r, err = proto.IDSlice(res1).MarshalThrift()
	return
}
Example #2
0
func (h *Handler) CreateUpload(id []byte, manifests []*wire.Manifest, ttl int64) (r [][]byte, err error) {
	reqUploadID, err := uuid.Parse(id)
	if err != nil {
		return
	}
	var mans proto.ManifestSlice
	if err = (&mans).UnmarshalThrift(manifests); err != nil {
		return
	}
	r1, err := h.Storage.CreateUploadSession(*reqUploadID, mans, time.Duration(ttl))
	if err != nil {
		return
	}

	r, err = proto.IDSlice(r1).MarshalThrift()
	return
}