Exemplo n.º 1
0
Arquivo: gi.go Projeto: nishanths/gae
// FilterGI installs a counter GlobalInfo filter in the context.
func FilterGI(c context.Context) (context.Context, *InfoCounter) {
	state := &InfoCounter{}
	return info.AddFilters(c, func(ic context.Context, gi info.Interface) info.Interface {
		return &infoCounter{state, gi}
	}), state
}
Exemplo n.º 2
0
Arquivo: gi.go Projeto: nishanths/gae
// FilterGI installs a counter info filter in the context.
func FilterGI(c context.Context, defaultError error) (context.Context, FeatureBreaker) {
	state := newState(defaultError)
	return info.AddFilters(c, func(ic context.Context, i info.Interface) info.Interface {
		return &infoState{state, i}
	}), state
}