@@ -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
656656reply:
@@ -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
0 commit comments