Skip to content

Commit dd90904

Browse files
authored
Replace store.WithContext with normal ctx param (#90)
Previously the entity store had a WithContext(ctx) method to pass in the context. This PR replaces that with the standard pattern passing context in as the first argument to the methods.
1 parent e65cc58 commit dd90904

File tree

10 files changed

+128
-144
lines changed

10 files changed

+128
-144
lines changed

api/api_gomux.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ func (api *API) getEntitiesHandler(w http.ResponseWriter, r *http.Request) {
576576

577577
// Query data store (instrumented)
578578
rc.inst.Start("db")
579-
entities, err := api.es.WithContext(ctx).ReadEntities(rc.entityType, q, f)
579+
entities, err := api.es.ReadEntities(ctx, rc.entityType, q, f)
580580
rc.inst.Stop("db")
581581
if err != nil {
582582
api.readError(rc, w, err)
@@ -650,7 +650,7 @@ func (api *API) postEntitiesHandler(w http.ResponseWriter, r *http.Request) {
650650
}
651651

652652
// Write new entities to data store
653-
ids, err = api.es.WithContext(ctx).CreateEntities(rc.wo, entities)
653+
ids, err = api.es.CreateEntities(ctx, rc.wo, entities)
654654
rc.gm.Inc(metrics.Created, int64(len(ids)))
655655

656656
reply:
@@ -717,7 +717,7 @@ func (api *API) putEntitiesHandler(w http.ResponseWriter, r *http.Request) {
717717
}
718718

719719
// Patch all entities matching query
720-
entities, err = api.es.WithContext(ctx).UpdateEntities(rc.wo, q, patch)
720+
entities, err = api.es.UpdateEntities(ctx, rc.wo, q, patch)
721721
rc.gm.Val(metrics.UpdateBulk, int64(len(entities)))
722722
rc.gm.Inc(metrics.Updated, int64(len(entities)))
723723

@@ -764,7 +764,7 @@ func (api *API) deleteEntitiesHandler(w http.ResponseWriter, r *http.Request) {
764764
}
765765

766766
// Delete entities, returns the deleted entities
767-
entities, err = api.es.WithContext(ctx).DeleteEntities(rc.wo, q)
767+
entities, err = api.es.DeleteEntities(ctx, rc.wo, q)
768768
rc.gm.Val(metrics.DeleteBulk, int64(len(entities)))
769769
rc.gm.Inc(metrics.Deleted, int64(len(entities)))
770770

@@ -805,7 +805,7 @@ func (api *API) getEntityHandler(w http.ResponseWriter, r *http.Request) {
805805

806806
// Read the entity by ID
807807
q, _ := query.Translate("_id=" + rc.entityId)
808-
entities, err := api.es.WithContext(ctx).ReadEntities(rc.entityType, q, f)
808+
entities, err := api.es.ReadEntities(ctx, rc.entityType, q, f)
809809
if err != nil {
810810
api.readError(rc, w, err)
811811
return
@@ -838,7 +838,7 @@ func (api *API) getLabelsHandler(w http.ResponseWriter, r *http.Request) {
838838
rc.gm.Inc(metrics.ReadLabels, 1) // specific read type
839839

840840
q, _ := query.Translate("_id=" + rc.entityId)
841-
entities, err := api.es.WithContext(ctx).ReadEntities(rc.entityType, q, etre.QueryFilter{})
841+
entities, err := api.es.ReadEntities(ctx, rc.entityType, q, etre.QueryFilter{})
842842
if err != nil {
843843
api.readError(rc, w, err)
844844
return
@@ -893,7 +893,7 @@ func (api *API) postEntityHandler(w http.ResponseWriter, r *http.Request) {
893893
}
894894

895895
// Create new entity
896-
ids, err = api.es.WithContext(ctx).CreateEntities(rc.wo, []etre.Entity{newEntity})
896+
ids, err = api.es.CreateEntities(ctx, rc.wo, []etre.Entity{newEntity})
897897
if err == nil {
898898
rc.gm.Inc(metrics.Created, 1)
899899
}
@@ -947,7 +947,7 @@ func (api *API) putEntityHandler(w http.ResponseWriter, r *http.Request) {
947947
}
948948

949949
// Patch one entity by ID
950-
entities, err = api.es.WithContext(ctx).UpdateEntities(rc.wo, q, patch)
950+
entities, err = api.es.UpdateEntities(ctx, rc.wo, q, patch)
951951
if err != nil {
952952
goto reply
953953
} else if len(entities) == 0 {
@@ -991,7 +991,7 @@ func (api *API) deleteEntityHandler(w http.ResponseWriter, r *http.Request) {
991991
q, _ := query.Translate("_id=" + rc.entityId)
992992

993993
// Delete one entity by ID
994-
entities, err = api.es.WithContext(ctx).DeleteEntities(rc.wo, q)
994+
entities, err = api.es.DeleteEntities(ctx, rc.wo, q)
995995
if err != nil {
996996
goto reply
997997
} else if len(entities) == 0 {
@@ -1041,7 +1041,7 @@ func (api *API) deleteLabelHandler(w http.ResponseWriter, r *http.Request) {
10411041
}
10421042

10431043
// Delete label from entity
1044-
diff, err = api.es.WithContext(ctx).DeleteLabel(rc.wo, label)
1044+
diff, err = api.es.DeleteLabel(ctx, rc.wo, label)
10451045
if err != nil {
10461046
if err == etre.ErrEntityNotFound {
10471047
err = nil // delete is idempotent

api/api_test.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,8 @@ func TestClientQueryTimeout(t *testing.T) {
198198
// and plumbed all the way down to the entity.Store context
199199
var gotCtx context.Context
200200
store := mock.EntityStore{}
201-
store.WithContextFunc = func(ctx context.Context) entity.Store {
201+
store.ReadEntitiesFunc = func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
202202
gotCtx = ctx
203-
return store
204-
}
205-
store.ReadEntitiesFunc = func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
206203
return testEntitiesWithObjectIDs[0:1], nil
207204
}
208205
server := setup(t, defaultConfig, store)
@@ -244,24 +241,25 @@ func TestContextPropagation(t *testing.T) {
244241
// Make sure context values from the request are propagated all the way down to the entity.Store context
245242
var gotCtx context.Context
246243
store := mock.EntityStore{}
247-
store.WithContextFunc = func(ctx context.Context) entity.Store {
248-
gotCtx = ctx
249-
return store
250-
}
251244
// We're going to test all operations, so we need to set all of these funcs
252-
store.ReadEntitiesFunc = func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
245+
store.ReadEntitiesFunc = func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
246+
gotCtx = ctx
253247
return testEntitiesWithObjectIDs[0:1], nil
254248
}
255-
store.CreateEntitiesFunc = func(op entity.WriteOp, entities []etre.Entity) ([]string, error) {
249+
store.CreateEntitiesFunc = func(ctx context.Context, op entity.WriteOp, entities []etre.Entity) ([]string, error) {
250+
gotCtx = ctx
256251
return []string{testEntityIds[0]}, nil
257252
}
258-
store.UpdateEntitiesFunc = func(op entity.WriteOp, q query.Query, e etre.Entity) ([]etre.Entity, error) {
253+
store.UpdateEntitiesFunc = func(ctx context.Context, op entity.WriteOp, q query.Query, e etre.Entity) ([]etre.Entity, error) {
254+
gotCtx = ctx
259255
return testEntitiesWithObjectIDs[0:1], nil
260256
}
261-
store.DeleteEntitiesFunc = func(op entity.WriteOp, q query.Query) ([]etre.Entity, error) {
257+
store.DeleteEntitiesFunc = func(ctx context.Context, op entity.WriteOp, q query.Query) ([]etre.Entity, error) {
258+
gotCtx = ctx
262259
return testEntitiesWithObjectIDs[0:1], nil
263260
}
264-
store.DeleteLabelFunc = func(op entity.WriteOp, label string) (etre.Entity, error) {
261+
store.DeleteLabelFunc = func(ctx context.Context, op entity.WriteOp, label string) (etre.Entity, error) {
262+
gotCtx = ctx
265263
return testEntitiesWithObjectIDs[0], nil
266264
}
267265

api/bulk_write_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package api_test
44

55
import (
6+
"context"
67
"encoding/json"
78
"net/http"
89
"net/url"
@@ -32,7 +33,7 @@ func TestPostEntitiesOK(t *testing.T) {
3233
var gotWO entity.WriteOp
3334
var gotEntities []etre.Entity
3435
store := mock.EntityStore{
35-
CreateEntitiesFunc: func(wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
36+
CreateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
3637
gotWO = wo
3738
gotEntities = entities
3839
return []string{"id1", "id2"}, nil
@@ -95,7 +96,7 @@ func TestPostEntitiesErrors(t *testing.T) {
9596
// Most importantly: CreateEntities() should _not_ be called.
9697
created := false
9798
store := mock.EntityStore{
98-
CreateEntitiesFunc: func(wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
99+
CreateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
99100
created = true
100101
return []string{"id1", "id2"}, nil
101102
},
@@ -246,7 +247,7 @@ func TestPutEntitiesOK(t *testing.T) {
246247
var gotQuery query.Query
247248
var gotPatch etre.Entity
248249
store := mock.EntityStore{
249-
UpdateEntitiesFunc: func(wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
250+
UpdateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
250251
gotWO = wo
251252
gotQuery = q
252253
gotPatch = patch
@@ -330,7 +331,7 @@ func TestPutEntitiesErrors(t *testing.T) {
330331
// metrics when any input is invalid. The UpdateEntities() should not be called.
331332
updated := false
332333
store := mock.EntityStore{
333-
UpdateEntitiesFunc: func(wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
334+
UpdateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
334335
updated = true
335336
return []etre.Entity{}, nil
336337
},
@@ -496,7 +497,7 @@ func TestDeleteEntitiesOK(t *testing.T) {
496497
var gotWO entity.WriteOp
497498
var gotQuery query.Query
498499
store := mock.EntityStore{
499-
DeleteEntitiesFunc: func(wo entity.WriteOp, q query.Query) ([]etre.Entity, error) {
500+
DeleteEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query) ([]etre.Entity, error) {
500501
gotWO = wo
501502
gotQuery = q
502503
return []etre.Entity{
@@ -575,7 +576,7 @@ func TestDeleteEntitiesErrors(t *testing.T) {
575576
// metrics when any input is invalid. The DeleteEntities() should not be called.
576577
deleted := false
577578
store := mock.EntityStore{
578-
DeleteEntitiesFunc: func(wo entity.WriteOp, q query.Query) ([]etre.Entity, error) {
579+
DeleteEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query) ([]etre.Entity, error) {
579580
deleted = true
580581
return []etre.Entity{}, nil
581582
},

api/query_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestQueryBasic(t *testing.T) {
2828
var gotQuery query.Query
2929
var gotFilter etre.QueryFilter
3030
store := mock.EntityStore{
31-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
31+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
3232
gotQuery = q
3333
gotFilter = f
3434
return testEntitiesWithObjectIDs, nil
@@ -171,7 +171,7 @@ func TestQueryNoMatches(t *testing.T) {
171171
// is still 200 OK in this case because there's no error.
172172
var gotQuery query.Query
173173
store := mock.EntityStore{
174-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
174+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
175175
gotQuery = q
176176
return []etre.Entity{}, nil // no matching queries
177177
},
@@ -220,7 +220,7 @@ func TestQueryErrorsDatabaseError(t *testing.T) {
220220
// Test that GET /entities/:type?query=Q handles a database error correctly.
221221
// Db errors (and only db errors return HTTP 503 "Service Unavailable".
222222
store := mock.EntityStore{
223-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
223+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
224224
return nil, entity.DbError{Err: fmt.Errorf("fake error"), Type: "db-read"}
225225
},
226226
}
@@ -269,7 +269,7 @@ func TestQueryErrorsNoEntityType(t *testing.T) {
269269
// You can run "../test/coverage -test.run TestQueryErrorsNoEntityType" and
270270
// see that the handler is never called.
271271
store := mock.EntityStore{
272-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
272+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
273273
return nil, entity.DbError{Err: fmt.Errorf("fake error"), Type: "db-read"}
274274
},
275275
}
@@ -310,7 +310,7 @@ func TestQueryErrorsTimeout(t *testing.T) {
310310
// Test that GET /entities/:type?query=Q handles a database timeout correctly.
311311
// Db errors (and only db errors return HTTP 503 "Service Unavailable".
312312
store := mock.EntityStore{
313-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
313+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
314314
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
315315
defer cancel()
316316
<-ctx.Done()
@@ -357,7 +357,7 @@ func TestQueryErrorsTimeout(t *testing.T) {
357357
func TestResponseCompression(t *testing.T) {
358358
// Stand up the server
359359
store := mock.EntityStore{
360-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
360+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
361361
return testEntitiesWithObjectIDs, nil
362362
},
363363
}

api/single_entity_read_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package api_test
44

55
import (
6+
"context"
67
"fmt"
78
"net/http"
89
"net/url"
@@ -31,7 +32,7 @@ func TestGetEntityBasic(t *testing.T) {
3132
var gotQuery query.Query
3233
var gotFilter etre.QueryFilter
3334
store := mock.EntityStore{
34-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
35+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
3536
gotQuery = q
3637
gotFilter = f
3738
return testEntitiesWithObjectIDs[0:1], nil
@@ -83,7 +84,7 @@ func TestGetEntityReturnLabels(t *testing.T) {
8384
// that the URL param "labels=" is processed and passed along to the entity.Store.
8485
var gotFilter etre.QueryFilter
8586
store := mock.EntityStore{
86-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
87+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
8788
gotFilter = f
8889
return testEntitiesWithObjectIDs[0:1], nil
8990
},
@@ -129,7 +130,7 @@ func TestGetEntityNotFound(t *testing.T) {
129130
// We simulate this by making ReadEntities() below return an empty list which
130131
// the real entity.Store() does when no entity exists with the given _id.
131132
store := mock.EntityStore{
132-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
133+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
133134
return []etre.Entity{}, nil
134135
},
135136
}
@@ -163,7 +164,7 @@ func TestGetEntityErrors(t *testing.T) {
163164
read := false
164165
var dbError error
165166
store := mock.EntityStore{
166-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
167+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
167168
read = true
168169
return nil, dbError
169170
},
@@ -257,7 +258,7 @@ func TestGetEntityLabels(t *testing.T) {
257258
var gotQuery query.Query
258259
var gotFilter etre.QueryFilter
259260
store := mock.EntityStore{
260-
ReadEntitiesFunc: func(entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
261+
ReadEntitiesFunc: func(ctx context.Context, entityType string, q query.Query, f etre.QueryFilter) ([]etre.Entity, error) {
261262
gotQuery = q
262263
gotFilter = f
263264
return testEntitiesWithObjectIDs[0:1], nil

api/single_entity_write_test.go

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
package api_test
44

55
import (
6+
"context"
67
"encoding/json"
78
"fmt"
89
"net/http"
@@ -33,7 +34,7 @@ func TestPostEntityOK(t *testing.T) {
3334
var gotWO entity.WriteOp
3435
var gotEntities []etre.Entity
3536
store := mock.EntityStore{
36-
CreateEntitiesFunc: func(wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
37+
CreateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
3738
gotWO = wo
3839
gotEntities = entities
3940
return []string{"id1"}, nil
@@ -96,7 +97,7 @@ func TestPostEntityDuplicate(t *testing.T) {
9697
// Test that POST /entities/:type returns HTTP 403 Conflict on duplicate
9798
// which we simulate by returning what entity.Store would:
9899
store := mock.EntityStore{
99-
CreateEntitiesFunc: func(wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
100+
CreateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
100101
// Real CreateEntities() always returns []string, not nil, because
101102
// it supports partial writes
102103
return []string{}, entity.DbError{Err: fmt.Errorf("dupe"), Type: "duplicate-entity"}
@@ -144,7 +145,7 @@ func TestPostEntityErrors(t *testing.T) {
144145
// Test that POST /entities/:type returns an error for any issue
145146
created := false
146147
store := mock.EntityStore{
147-
CreateEntitiesFunc: func(wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
148+
CreateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, entities []etre.Entity) ([]string, error) {
148149
created = true
149150
return []string{"id1"}, nil
150151
},
@@ -254,7 +255,7 @@ func TestPutEntityOK(t *testing.T) {
254255
var gotWO entity.WriteOp
255256
var gotQuery query.Query
256257
store := mock.EntityStore{
257-
UpdateEntitiesFunc: func(wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
258+
UpdateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
258259
gotWO = wo
259260
gotQuery = q
260261
diff := []etre.Entity{
@@ -329,7 +330,7 @@ func TestPutEntityDuplicate(t *testing.T) {
329330
// Test that PUT /entities/:type/:id returns HTTP 403 Conflict on duplicate
330331
// which we simulate by returning what entity.Store would:
331332
store := mock.EntityStore{
332-
UpdateEntitiesFunc: func(wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
333+
UpdateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
333334
return nil, entity.DbError{
334335
Type: "duplicate-entity", // the key to making this happen
335336
EntityId: testEntityIds[0],
@@ -380,7 +381,7 @@ func TestPutEntityNotFound(t *testing.T) {
380381
// Test that PUT /entities/:type/:id returns HTTP 404 when there's no entity
381382
// with the given id. In this case, the entity.Store returns an empty diff:
382383
store := mock.EntityStore{
383-
UpdateEntitiesFunc: func(wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
384+
UpdateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
384385
return []etre.Entity{}, nil // no entities matched
385386
},
386387
}
@@ -419,7 +420,7 @@ func TestPutEntityErrors(t *testing.T) {
419420
// Test that PUT /entities/:type/:id returns errors unless all inputs are correct
420421
updated := false
421422
store := mock.EntityStore{
422-
UpdateEntitiesFunc: func(wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
423+
UpdateEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query, patch etre.Entity) ([]etre.Entity, error) {
423424
updated = true
424425
return []etre.Entity{{"_id": testEntityId0, "_type": entityType, "_rev": int64(0)}}, nil
425426
},
@@ -592,7 +593,7 @@ func TestDeleteEntityOK(t *testing.T) {
592593
var gotWO entity.WriteOp
593594
var gotQuery query.Query
594595
store := mock.EntityStore{
595-
DeleteEntitiesFunc: func(wo entity.WriteOp, q query.Query) ([]etre.Entity, error) {
596+
DeleteEntitiesFunc: func(ctx context.Context, wo entity.WriteOp, q query.Query) ([]etre.Entity, error) {
596597
gotWO = wo
597598
gotQuery = q
598599
diff := []etre.Entity{
@@ -671,7 +672,7 @@ func TestDeleteLabel(t *testing.T) {
671672
var gotWO entity.WriteOp
672673
var gotLabel string
673674
store := mock.EntityStore{
674-
DeleteLabelFunc: func(wo entity.WriteOp, label string) (etre.Entity, error) {
675+
DeleteLabelFunc: func(ctx context.Context, wo entity.WriteOp, label string) (etre.Entity, error) {
675676
gotWO = wo
676677
gotLabel = label
677678
return etre.Entity{"_id": testEntityId0, "_type": entityType, "_rev": int64(0), "foo": "oldVal"}, nil

0 commit comments

Comments
 (0)