MCPcopy Create free account
hub / github.com/bufbuild/buf / getStorageMatcher

Function getStorageMatcher

private/bufpkg/bufmodule/paths.go:70–76  ·  view source on GitHub ↗

getStorageMatcher gets the storage.Matcher that will filter the storage.ReadBucket down to specifically the files that are relevant to a module.

(ctx context.Context, bucket storage.ReadBucket)

Source from the content-addressed store, hash-verified

68// getStorageMatcher gets the storage.Matcher that will filter the storage.ReadBucket down to specifically
69// the files that are relevant to a module.
70func getStorageMatcher(ctx context.Context, bucket storage.ReadBucket) storage.Matcher {
71 return storage.MatchOr(
72 storage.MatchPathExt(".proto"),
73 storage.MatchPathEqual(licenseFilePath),
74 storage.MatchPathEqual(getDocFilePathForStorageReadBucket(ctx, bucket)),
75 )
76}
77
78// getSyncOnceValuesGetBucketWithStorageMatcherApplied wraps the getBucket function with sync.OnceValues
79// and getStorageMatcher applied.

Calls 4

MatchOrFunction · 0.92
MatchPathExtFunction · 0.92
MatchPathEqualFunction · 0.92

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…