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

Method repositoryWriterAction

cli/app.go:452–463  ·  view source on GitHub ↗
(act func(ctx context.Context, rep repo.RepositoryWriter) error)

Source from the content-addressed store, hash-verified

450}
451
452func (c *App) repositoryWriterAction(act func(ctx context.Context, rep repo.RepositoryWriter) error) func(ctx *kingpin.ParseContext) error {
453 return c.repositoryAction(func(ctx context.Context, rep repo.Repository) error {
454 return repo.WriteSession(ctx, rep, repo.WriteSessionOptions{
455 Purpose: "cli:" + c.currentActionName(),
456 OnUpload: c.progress.UploadedBytes,
457 }, func(ctx context.Context, w repo.RepositoryWriter) error {
458 return act(ctx, w)
459 })
460 }, repositoryAccessMode{
461 allowMaintenance: true,
462 })
463}
464
465func (c *App) runAppWithContext(command *kingpin.CmdClause, cb func(ctx context.Context) error) error {
466 ctx := c.rootctx

Callers

nothing calls this directly

Calls 3

repositoryActionMethod · 0.95
currentActionNameMethod · 0.95
WriteSessionFunction · 0.92

Tested by

no test coverage detected