示例#1
0
文件: user.go 项目: nishanths/gae
// FilterUser installs a counter user filter in the context.
func FilterUser(c context.Context, defaultError error) (context.Context, FeatureBreaker) {
	state := newState(defaultError)
	return user.AddFilters(c, func(ic context.Context, i user.Interface) user.Interface {
		return &userState{state, i}
	}), state
}
示例#2
0
文件: user.go 项目: nishanths/gae
// FilterUser installs a counter User filter in the context.
func FilterUser(c context.Context) (context.Context, *UserCounter) {
	state := &UserCounter{}
	return user.AddFilters(c, func(ic context.Context, u user.Interface) user.Interface {
		return &userCounter{state, u}
	}), state
}