MCPcopy Create free account
hub / github.com/openclaw/gogcli / ServeHTTP

Method ServeHTTP

internal/cmd/gmail_watch_server.go:41–58  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

39}
40
41func (s *gmailWatchServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
42 handler := gmailwatch.HTTPHandler{
43 Config: gmailwatch.HTTPConfig{
44 Path: s.cfg.Path,
45 Account: s.cfg.Account,
46 BodyLimit: defaultPushBodyLimitBytes,
47 HasHook: s.cfg.HookURL != "",
48 AllowNoHook: s.cfg.AllowNoHook,
49 },
50 Authorize: s.authorize,
51 Process: func(ctx context.Context, notification gmailwatch.Notification) (*gmailwatch.ProcessedPayload, error) {
52 return s.watchProcessor().Process(ctx, notification)
53 },
54 Now: s.currentTime,
55 Warnf: s.warnf,
56 }
57 handler.ServeHTTP(w, r)
58}
59
60func (s *gmailWatchServer) authorize(r *http.Request) bool {
61 authorizer := gmailwatch.Authorizer{

Calls 3

watchProcessorMethod · 0.95
ServeHTTPMethod · 0.95
ProcessMethod · 0.80