Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Unified Diff: go/src/infra/gae/libs/context/context.go

Issue 1151473003: Better attempt at an appengine wrapper. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: fix coverage numbers Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | go/src/infra/gae/libs/context/context.infra_testing » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/context/context.go
diff --git a/go/src/infra/gae/libs/context/context.go b/go/src/infra/gae/libs/context/context.go
deleted file mode 100644
index a67c0e2930059a8bc0f85bef7385e0f0958b121a..0000000000000000000000000000000000000000
--- a/go/src/infra/gae/libs/context/context.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// +build appengine
-
-package context
-
-import (
- "appengine"
- "appengine/datastore"
-
- "github.com/luci/luci-go/common/logging"
- "github.com/mjibson/goon"
-)
-
-/// Kinds + Keys
-
-type Kinder interface {
- Kind(src interface{}) string
-}
-
-type KindSetter interface {
- KindNameResolver() goon.KindNameResolver
- SetKindNameResolver(goon.KindNameResolver)
-}
-
-type NewKeyer interface {
- NewKey(kind, stringID string, intID int64, parent *datastore.Key) *datastore.Key
- NewKeyObj(src interface{}) *datastore.Key
- NewKeyObjError(src interface{}) (*datastore.Key, error)
-}
-
-type KindKeyer interface {
- Kinder
- NewKeyer
-}
-
-/// Read + Write
-
-type SingleReadWriter interface {
- Put(src interface{}) (*datastore.Key, error)
- Get(dst interface{}) error
- Delete(key *datastore.Key) error
-}
-
-type MultiReadWriter interface {
- SingleReadWriter
- DeleteMulti(keys []*datastore.Key) error
- GetMulti(dst interface{}) error
- PutMulti(src interface{}) ([]*datastore.Key, error)
-}
-
-/// Queries
-
-type Queryer interface {
- Run(q *datastore.Query) Iterator
- GetAll(q *datastore.Query, dst interface{}) ([]*datastore.Key, error)
- Count(q *datastore.Query) (int, error)
-}
-
-type Iterator interface {
- Cursor() (datastore.Cursor, error)
- Next(dst interface{}) (*datastore.Key, error)
-}
-
-/// Transactions
-
-type Transactioner interface {
- RunInTransaction(f func(c Context) error, opts *datastore.TransactionOptions) error
-}
-
-/// Abstraction breaking!
-
-type DangerousContexter interface {
- Context() appengine.Context
-}
-
-type SingleContext interface {
- logging.Logger
- Kinder
- NewKeyer
- SingleReadWriter
-}
-
-type Context interface {
- logging.Logger
- Kinder
- NewKeyer
- MultiReadWriter
- Queryer
- KindSetter
-}
-
-type TransactionerContext interface {
- Context
- Transactioner
-}
-
-type DangerousContext interface {
- DangerousContexter
- Context
-}
-
-type DangerousTransactionerContext interface {
- DangerousContexter
- TransactionerContext
-}
« no previous file with comments | « no previous file | go/src/infra/gae/libs/context/context.infra_testing » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698