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

Function NewModuleData

private/bufpkg/bufmodule/module_data.go:75–91  ·  view source on GitHub ↗

NewModuleData returns a new ModuleData. getBucket and getDepModuleKeys are meant to be lazily-loaded functions where possible. It is OK for getBucket to return a bucket that has extra files that are not part of the Module, this bucket will be filtered as part of this function.

(
	ctx context.Context,
	moduleKey ModuleKey,
	getBucket func() (storage.ReadBucket, error),
	getDepModuleKeys func() ([]ModuleKey, error),
	getV1BufYAMLObjectData func() (ObjectData, error),
	getV1BufLockObjectData func() (ObjectData, error),
)

Source from the content-addressed store, hash-verified

73// It is OK for getBucket to return a bucket that has extra files that are not part of the Module, this
74// bucket will be filtered as part of this function.
75func NewModuleData(
76 ctx context.Context,
77 moduleKey ModuleKey,
78 getBucket func() (storage.ReadBucket, error),
79 getDepModuleKeys func() ([]ModuleKey, error),
80 getV1BufYAMLObjectData func() (ObjectData, error),
81 getV1BufLockObjectData func() (ObjectData, error),
82) ModuleData {
83 return newModuleData(
84 ctx,
85 moduleKey,
86 getBucket,
87 getDepModuleKeys,
88 getV1BufYAMLObjectData,
89 getV1BufLockObjectData,
90 )
91}
92
93// *** PRIVATE ***
94

Calls 1

newModuleDataFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…