MCPcopy Index your code
hub / github.com/kopia/kopia / handleServerControlAPI

Method handleServerControlAPI

internal/server/server.go:330–338  ·  view source on GitHub ↗
(f apiRequestFunc)

Source from the content-addressed store, hash-verified

328type isAuthorizedFunc func(ctx context.Context, rc requestContext) bool
329
330func (s *Server) handleServerControlAPI(f apiRequestFunc) http.HandlerFunc {
331 return s.handleServerControlAPIPossiblyNotConnected(func(ctx context.Context, rc requestContext) (any, *apiError) {
332 if rc.rep == nil {
333 return nil, requestError(serverapi.ErrorNotConnected, "not connected")
334 }
335
336 return f(ctx, rc)
337 })
338}
339
340func (s *Server) handleServerControlAPIPossiblyNotConnected(f apiRequestFunc) http.HandlerFunc {
341 return s.handleRequestPossiblyNotConnected(requireServerControlUser, csrfTokenNotRequired, func(ctx context.Context, rc requestContext) (any, *apiError) {

Callers 1

Calls 2

requestErrorFunction · 0.85

Tested by

no test coverage detected