MCPcopy
hub / github.com/iron-io/functions / UseSpecialHandlers

Method UseSpecialHandlers

api/server/special_handler.go:57–74  ·  view source on GitHub ↗

UseSpecialHandlers execute all special handlers

(ctx context.Context, req *http.Request, resp http.ResponseWriter)

Source from the content-addressed store, hash-verified

55
56// UseSpecialHandlers execute all special handlers
57func (s *Server) UseSpecialHandlers(ctx context.Context, req *http.Request, resp http.ResponseWriter) (context.Context, error) {
58 if len(s.specialHandlers) == 0 {
59 return ctx, ErrNoSpecialHandlerFound
60 }
61
62 c := &SpecialHandlerContext{
63 request: req,
64 response: resp,
65 ctx: ctx,
66 }
67 for _, l := range s.specialHandlers {
68 err := l.Handle(c)
69 if err != nil {
70 return c.ctx, err
71 }
72 }
73 return c.ctx, nil
74}

Callers 1

handleSpecialMethod · 0.95

Calls 1

HandleMethod · 0.65

Tested by

no test coverage detected