MCPcopy
hub / github.com/rclone/rclone / AddConfig

Function AddConfig

fs/filter/filter.go:707–713  ·  view source on GitHub ↗

AddConfig returns a mutable config structure based on a shallow copy of that found in ctx and returns a new context with that added to it.

(ctx context.Context)

Source from the content-addressed store, hash-verified

705// copy of that found in ctx and returns a new context with that added
706// to it.
707func AddConfig(ctx context.Context) (context.Context, *Filter) {
708 c := GetConfig(ctx)
709 cCopy := new(Filter)
710 *cCopy = *c
711 newCtx := context.WithValue(ctx, configContextKey, cCopy)
712 return newCtx, cCopy
713}
714
715// ReplaceConfig replaces the filter config in the ctx with the one
716// passed in and returns a new context with that added to it.

Callers 15

TestFilterFunction · 0.92
testFilterSymlinkFunction · 0.92
testArchiveFunction · 0.92
deleteDSStoreFunction · 0.92
modifyListingMethod · 0.92
fastCopyMethod · 0.92
applyDeltasMethod · 0.92
copyFileMethod · 0.92
deleteFilesFunction · 0.92
touchFilesFunction · 0.92
ctxNoDsStoreFunction · 0.92
resyncMethod · 0.92

Calls 1

GetConfigFunction · 0.70

Tested by 11

TestFilterFunction · 0.74
testFilterSymlinkFunction · 0.74
testArchiveFunction · 0.74
deleteDSStoreFunction · 0.74
copyFileMethod · 0.74
deleteFilesFunction · 0.74
touchFilesFunction · 0.74
ctxNoDsStoreFunction · 0.74
deleteDSStoreFunction · 0.74
TestRmdirsWithFilterFunction · 0.74
TestGetConfigFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…