feat: add scoped task source tracing and SDK examples
This commit is contained in:
@@ -32,6 +32,13 @@ func historyQuery(r *http.Request, paged bool) (service.HistoryPageInput, error)
|
||||
return in, nil
|
||||
}
|
||||
func registerHistory(mux *http.ServeMux, s *service.Service) {
|
||||
mux.HandleFunc("GET /v1/tasks/{task}/source", wrap(func(r *http.Request, t auth.Token) (any, int, error) {
|
||||
if _, err := historyQuery(r, false); err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
out, err := s.GetTaskSource(r.Context(), t, core.ID(r.PathValue("task")))
|
||||
return out, 200, err
|
||||
}))
|
||||
mux.HandleFunc("GET /v1/tasks/{task}/operations", wrap(func(r *http.Request, t auth.Token) (any, int, error) {
|
||||
in, err := historyQuery(r, true)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user