Google App Engine context.Context vs gorilla context

时间:2016-01-24 13:45:31

标签: google-app-engine go

在GAE Go中,为了记录,我们需要使用返回1 how does PEG work (algorithm) 2 is there any tools about it on C/C++/Lua 的{​​{1}}创建新的上下文。

如何使用此上下文在请求范围设置/获取变量?在Gorilla中,Context在上下文中有一个干净的Set / Get函数,这是我想在我的代码中使用的。但是我不想导入2个不同的上下文包。

GAE日志记录强制您使用appengine.NewContext(r)

context.Context

1 个答案:

答案 0 :(得分:0)

import (
    "golang.org/x/net/context"
    gorillacontext "github.com/gorilla/context"    
)

我知道这不是你想要的答案,但由于' context'' context' Go标准库(由App Engine使用)中的软件包与Gorilla的{' groups discussion'相比,无法提供您想要的功能。包。如果您想使用其他框架来定义他们自己的上下文'包,你需要使用多个导入。

click here for the scikit-learn page这两个上下文有一个很好的观点,因为它们可能用于不同的目的,因为它们可能用于不同的目的,因为它们被错误命名 - " App Engine one存储凭据以发出RPC请求;大猩猩只是请求全局的容器。"