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

Method getWorkspaceForModuleRef

private/buf/bufctl/controller.go:1091–1111  ·  view source on GitHub ↗
(
	ctx context.Context,
	moduleRef buffetch.ModuleRef,
	functionOptions *functionOptions,
)

Source from the content-addressed store, hash-verified

1089}
1090
1091func (c *controller) getWorkspaceForModuleRef(
1092 ctx context.Context,
1093 moduleRef buffetch.ModuleRef,
1094 functionOptions *functionOptions,
1095) (bufworkspace.Workspace, error) {
1096 moduleKey, err := c.buffetchReader.GetModuleKey(ctx, c.container, moduleRef)
1097 if err != nil {
1098 return nil, err
1099 }
1100 return c.workspaceProvider.GetWorkspaceForModuleKey(
1101 ctx,
1102 moduleKey,
1103 bufworkspace.WithTargetPaths(
1104 functionOptions.targetPaths,
1105 functionOptions.targetExcludePaths,
1106 ),
1107 bufworkspace.WithConfigOverride(
1108 functionOptions.configOverride,
1109 ),
1110 )
1111}
1112
1113func (c *controller) getImageForMessageRef(
1114 ctx context.Context,

Callers 4

GetWorkspaceMethod · 0.95
getImageForRefMethod · 0.95

Calls 4

WithTargetPathsFunction · 0.92
WithConfigOverrideFunction · 0.92
GetModuleKeyMethod · 0.65

Tested by

no test coverage detected