Download this file
| 1 | package equipo |
| 2 | |
| 3 | import ( |
| 4 | "amadan.net/oficina/equipo/internal/runnerproto" |
| 5 | "github.com/go-chi/chi/v5" |
| 6 | "net/http" |
| 7 | ) |
| 8 | |
| 9 | func (s *Store) runnerProtocol() *runnerproto.Handler { |
| 10 | return &runnerproto.Handler{AccountSetups: s, Execution: func() runnerproto.ExecutionAPI { |
| 11 | if s.execution == nil { |
| 12 | return nil |
| 13 | } |
| 14 | return s.execution |
| 15 | }, AuthenticateRunner: s.AuthenticateRunner, ReportConnections: s.ReportConnections, ReportRepositories: s.ReportRepositories, PutBlob: s.PutBlob, Blob: s.Blob, Failure: runnerFailure, JSON: runnerJSON, Invalid: ErrInvalid, Forbidden: ErrForbidden, Unavailable: ErrUnavailable, MaxBlobBytes: MaxBlobBytes} |
| 16 | } |
| 17 | func (s *Store) RunnerHandler() http.Handler { return s.runnerRouter() } |
| 18 | func (s *Store) runnerRouter() chi.Router { return s.runnerProtocol().Router() } |
| 19 | |