示例#1
0
文件: mail.go 项目: tetrafolium/gae
// FilterMail installs a featureBreaker mail filter in the context.
func FilterMail(c context.Context, defaultError error) (context.Context, FeatureBreaker) {
	state := newState(defaultError)
	return mail.AddFilters(c, func(ic context.Context, i mail.Interface) mail.Interface {
		return &mailState{state, i}
	}), state
}
示例#2
0
文件: mail.go 项目: tetrafolium/gae
// FilterMail installs a counter Mail filter in the context.
func FilterMail(c context.Context) (context.Context, *MailCounter) {
	state := &MailCounter{}
	return mail.AddFilters(c, func(ic context.Context, u mail.Interface) mail.Interface {
		return &mailCounter{state, u}
	}), state
}