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

Method serverAction

cli/app.go:394–410  ·  view source on GitHub ↗
(sf *serverClientFlags, act func(ctx context.Context, cli *apiclient.KopiaAPIClient) error)

Source from the content-addressed store, hash-verified

392}
393
394func (c *App) serverAction(sf *serverClientFlags, act func(ctx context.Context, cli *apiclient.KopiaAPIClient) error) func(ctx *kingpin.ParseContext) error {
395 return func(kpc *kingpin.ParseContext) error {
396 opts, err := sf.serverAPIClientOptions()
397 if err != nil {
398 return errors.Wrap(err, "unable to create API client options")
399 }
400
401 apiClient, err := apiclient.NewKopiaAPIClient(opts)
402 if err != nil {
403 return errors.Wrap(err, "unable to create API client")
404 }
405
406 return c.runAppWithContext(kpc.SelectedCommand, func(ctx context.Context) error {
407 return act(ctx, apiClient)
408 })
409 }
410}
411
412func assertDirectRepository(act func(ctx context.Context, rep repo.DirectRepository) error) func(ctx context.Context, rep repo.Repository) error {
413 return func(ctx context.Context, rep repo.Repository) error {

Callers

nothing calls this directly

Calls 3

runAppWithContextMethod · 0.95
NewKopiaAPIClientFunction · 0.92

Tested by

no test coverage detected