Upserting edges

The edge upsert logic in UpsertEdge has a lot of things in common with the UpsertLink implementation we examined in the previous section. The first thing we need to do is acquire the write lock and verify that the source and destination links for the edge actually exist:

Next, we scan the set of edges that originate from the specified source link and check whether we can find an existing edge to the same destination. If that happens to be the case, we simply update the entry's UpdatedAt field and copy its contents back to the ...

Get Hands-On Software Engineering with Golang now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.