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

Function GetDocFile

private/bufpkg/bufmodule/module_read_bucket.go:214–219  ·  view source on GitHub ↗

GetDocFile gets the singular documentation File for the Module, if it exists. When creating a Module from a Bucket, we check the file paths buf.md, README.md, and README.markdown to exist, in that order. The first one to exist is chosen as the documentation File that is considered part of the Modul

(ctx context.Context, moduleReadBucket ModuleReadBucket)

Source from the content-addressed store, hash-verified

212//
213// Returns an error with fs.ErrNotExist if no documentation file exists.
214func GetDocFile(ctx context.Context, moduleReadBucket ModuleReadBucket) (File, error) {
215 if docFilePath := getDocFilePathForModuleReadBucket(ctx, moduleReadBucket); docFilePath != "" {
216 return moduleReadBucket.GetFile(ctx, docFilePath)
217 }
218 return nil, fs.ErrNotExist
219}
220
221// GetLicenseFile gets the license File for the Module, if it exists.
222//

Callers 1

runFunction · 0.92

Calls 2

GetFileMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…