Example #1
0
// useGI adds a gae.GlobalInfo implementation to context, accessible
// by gae.GetGI(c)
func useGI(usrCtx context.Context) context.Context {
	probeCache := getProbeCache(usrCtx)
	if probeCache == nil {
		usrCtx = withProbeCache(usrCtx, probe(AEContext(usrCtx)))
	}

	return info.SetFactory(usrCtx, func(ci context.Context) info.Interface {
		return giImpl{ci, AEContext(ci)}
	})
}
Example #2
0
// useGI adds a gae.GlobalInfo context, accessible
// by gae.GetGI(c)
func useGI(c context.Context, appID string) context.Context {
	return info.SetFactory(c, func(ic context.Context) info.Interface {
		return &giImpl{dummy.Info(), curGID(ic), ic}
	})
}