1
0
mirror of https://github.com/StackExchange/dnscontrol.git synced 2024-05-11 05:55:12 +00:00

update some dependencies (#208)

* update some dependencies

* some more

* add these

* remove things?

* regen
This commit is contained in:
Craig Peterson
2017-09-18 15:35:10 -04:00
committed by GitHub
parent ae14b0e790
commit e4ad084494
141 changed files with 3816 additions and 15671 deletions

View File

@ -22,14 +22,20 @@ import (
var contextKey = "holds an appengine.Context"
// fromContext returns the App Engine context or nil if ctx is not
// derived from an App Engine context.
func fromContext(ctx netcontext.Context) appengine.Context {
c, _ := ctx.Value(&contextKey).(appengine.Context)
return c
}
// This is only for classic App Engine adapters.
func ClassicContextFromContext(ctx netcontext.Context) appengine.Context {
return fromContext(ctx)
func ClassicContextFromContext(ctx netcontext.Context) (appengine.Context, error) {
c := fromContext(ctx)
if c == nil {
return nil, errNotAppEngineContext
}
return c, nil
}
func withContext(parent netcontext.Context, c appengine.Context) netcontext.Context {
@ -98,7 +104,7 @@ func Call(ctx netcontext.Context, service, method string, in, out proto.Message)
c := fromContext(ctx)
if c == nil {
// Give a good error message rather than a panic lower down.
return errors.New("not an App Engine context")
return errNotAppEngineContext
}
// Apply transaction modifications if we're in a transaction.