(ctx context.Context, engine storage.Engine, path *storage.URI, id ksuid.KSUID)
| 73 | } |
| 74 | |
| 75 | func NewVectorWriter(ctx context.Context, engine storage.Engine, path *storage.URI, id ksuid.KSUID) (*VectorWriter, error) { |
| 76 | put, err := engine.Put(ctx, VectorURI(path, id)) |
| 77 | if err != nil { |
| 78 | return nil, err |
| 79 | } |
| 80 | delete := func() { |
| 81 | DeleteVector(context.Background(), engine, path, id) |
| 82 | } |
| 83 | return &VectorWriter{ |
| 84 | Serializer: csupio.NewSerializer(bufwriter.New(put)), |
| 85 | delete: delete, |
| 86 | }, nil |
| 87 | } |
| 88 | |
| 89 | func (w *VectorWriter) Abort() { |
| 90 | w.Close() |
no test coverage detected