go.mercari.io/datastore@v1.8.2/dsmiddleware/noop/noop.go (about) 1 package noop 2 3 import "go.mercari.io/datastore" 4 5 var _ datastore.Middleware = &noop{} 6 7 // New no-op middleware creates and returns. 8 func New() datastore.Middleware { 9 return &noop{} 10 } 11 12 type noop struct { 13 } 14 15 func (*noop) AllocateIDs(info *datastore.MiddlewareInfo, keys []datastore.Key) ([]datastore.Key, error) { 16 return info.Next.AllocateIDs(info, keys) 17 } 18 19 func (*noop) PutMultiWithoutTx(info *datastore.MiddlewareInfo, keys []datastore.Key, psList []datastore.PropertyList) ([]datastore.Key, error) { 20 return info.Next.PutMultiWithoutTx(info, keys, psList) 21 } 22 23 func (*noop) PutMultiWithTx(info *datastore.MiddlewareInfo, keys []datastore.Key, psList []datastore.PropertyList) ([]datastore.PendingKey, error) { 24 return info.Next.PutMultiWithTx(info, keys, psList) 25 } 26 27 func (*noop) GetMultiWithoutTx(info *datastore.MiddlewareInfo, keys []datastore.Key, psList []datastore.PropertyList) error { 28 return info.Next.GetMultiWithoutTx(info, keys, psList) 29 } 30 31 func (*noop) GetMultiWithTx(info *datastore.MiddlewareInfo, keys []datastore.Key, psList []datastore.PropertyList) error { 32 return info.Next.GetMultiWithTx(info, keys, psList) 33 } 34 35 func (*noop) DeleteMultiWithoutTx(info *datastore.MiddlewareInfo, keys []datastore.Key) error { 36 return info.Next.DeleteMultiWithoutTx(info, keys) 37 } 38 39 func (*noop) DeleteMultiWithTx(info *datastore.MiddlewareInfo, keys []datastore.Key) error { 40 return info.Next.DeleteMultiWithTx(info, keys) 41 } 42 43 func (*noop) PostCommit(info *datastore.MiddlewareInfo, tx datastore.Transaction, commit datastore.Commit) error { 44 return info.Next.PostCommit(info, tx, commit) 45 } 46 47 func (*noop) PostRollback(info *datastore.MiddlewareInfo, tx datastore.Transaction) error { 48 return info.Next.PostRollback(info, tx) 49 } 50 51 func (*noop) Run(info *datastore.MiddlewareInfo, q datastore.Query, qDump *datastore.QueryDump) datastore.Iterator { 52 return info.Next.Run(info, q, qDump) 53 } 54 55 func (*noop) GetAll(info *datastore.MiddlewareInfo, q datastore.Query, qDump *datastore.QueryDump, psList *[]datastore.PropertyList) ([]datastore.Key, error) { 56 return info.Next.GetAll(info, q, qDump, psList) 57 } 58 59 func (*noop) Next(info *datastore.MiddlewareInfo, q datastore.Query, qDump *datastore.QueryDump, iter datastore.Iterator, ps *datastore.PropertyList) (datastore.Key, error) { 60 return info.Next.Next(info, q, qDump, iter, ps) 61 } 62 63 func (*noop) Count(info *datastore.MiddlewareInfo, q datastore.Query, qDump *datastore.QueryDump) (int, error) { 64 return info.Next.Count(info, q, qDump) 65 }