(_ context.Context, rc requestContext)
| 16 | ) |
| 17 | |
| 18 | func handleSourcesList(_ context.Context, rc requestContext) (any, *apiError) { |
| 19 | _, multiUser := rc.rep.(repo.DirectRepository) |
| 20 | |
| 21 | resp := &serverapi.SourcesResponse{ |
| 22 | Sources: []*serverapi.SourceStatus{}, |
| 23 | LocalHost: rc.rep.ClientOptions().Hostname, |
| 24 | LocalUsername: rc.rep.ClientOptions().Username, |
| 25 | MultiUser: multiUser, |
| 26 | } |
| 27 | |
| 28 | for src, v := range rc.srv.snapshotAllSourceManagers() { |
| 29 | if sourceMatchesURLFilter(src, rc.req.URL.Query()) { |
| 30 | resp.Sources = append(resp.Sources, v.Status()) |
| 31 | } |
| 32 | } |
| 33 | |
| 34 | sort.Slice(resp.Sources, func(i, j int) bool { |
| 35 | return resp.Sources[i].Source.String() < resp.Sources[j].Source.String() |
| 36 | }) |
| 37 | |
| 38 | return resp, nil |
| 39 | } |
| 40 | |
| 41 | func handleSourcesCreate(ctx context.Context, rc requestContext) (any, *apiError) { |
| 42 | var req serverapi.CreateSnapshotSourceRequest |
nothing calls this directly
no test coverage detected