(oid *git.Oid)
| 23 | } |
| 24 | |
| 25 | func (p *Project) getDocument(oid *git.Oid) (*pb.Document, error) { |
| 26 | blob, err := p.repo.LookupBlob(oid) |
| 27 | if err != nil { |
| 28 | return nil, fmt.Errorf("failed to retrieve Document blob: %v", err) |
| 29 | } |
| 30 | |
| 31 | doc := &pb.Document{} |
| 32 | err = proto.Unmarshal(blob.Contents(), doc) |
| 33 | if err != nil { |
| 34 | return nil, fmt.Errorf("unable to unmarshal document protobuf: %v", err) |
| 35 | } |
| 36 | return doc, nil |
| 37 | } |
| 38 | |
| 39 | func (p *Project) createDocument(obj *pb.Document) (oid *git.Oid, size int, err error) { |
| 40 | data, err := proto.Marshal(obj) |
no outgoing calls
no test coverage detected