From 8cca1683a03aace2013e48679302100b3580d2ca Mon Sep 17 00:00:00 2001 From: Cole Brown Date: Wed, 8 Aug 2018 11:37:15 -0400 Subject: [PATCH] Copy Datastore -> Txn for clarity of origin --- datastore.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/datastore.go b/datastore.go index d258cca..c994a07 100644 --- a/datastore.go +++ b/datastore.go @@ -142,12 +142,16 @@ type TTLDatastore interface { // Txn is an interface for transactions that can be committed or discarded. type Txn interface { - // Txn extends the Datastore type. Txns allow users to batch queries and - // mutations to the Datastore into atomic groups, or transactions. Actions - // performed on a transaction will not take hold until a successful call to - // Commit has been made. Likewise, transactions can be aborted by calling - // Discard before a successful Commit has been made. - Datastore + // Txn has the same capabilities as Datastore. Txns allow users to batch + // queries and mutations to the Datastore into atomic groups, or transactions. + // Actions performed on a transaction will not take hold until a successful + // call to Commit has been made. Likewise, transactions can be aborted by + // calling Discard before a successful Commit has been made. + Put(key Key, value interface{}) error + Get(key Key) (value interface{}, err error) + Has(key Key) (exists bool, err error) + Delete(key Key) error + Query(q query.Query) (query.Results, error) // Commit finalizes a transaction, attempting to commit it to the Datastore. // May return an error if the transaction has gone stale. The presence of an @@ -160,7 +164,7 @@ type Txn interface { Discard() } -// TxDatastore is an interface that should be implemented by datastores that +// TxnDatastore is an interface that should be implemented by datastores that // support transactions. type TxnDatastore interface { Datastore