( ctx context.Context, sourceOrModuleInput string, options ...FunctionOption, )
| 290 | } |
| 291 | |
| 292 | func (c *controller) GetWorkspace( |
| 293 | ctx context.Context, |
| 294 | sourceOrModuleInput string, |
| 295 | options ...FunctionOption, |
| 296 | ) (_ bufworkspace.Workspace, retErr error) { |
| 297 | defer c.handleFileAnnotationSetRetError(&retErr) |
| 298 | functionOptions := newFunctionOptions(c) |
| 299 | for _, option := range options { |
| 300 | option(functionOptions) |
| 301 | } |
| 302 | sourceOrModuleRef, err := c.buffetchRefParser.GetSourceOrModuleRef(ctx, sourceOrModuleInput) |
| 303 | if err != nil { |
| 304 | return nil, err |
| 305 | } |
| 306 | switch t := sourceOrModuleRef.(type) { |
| 307 | case buffetch.ProtoFileRef: |
| 308 | return c.getWorkspaceForProtoFileRef(ctx, t, functionOptions) |
| 309 | case buffetch.SourceRef: |
| 310 | return c.getWorkspaceForSourceRef(ctx, t, functionOptions) |
| 311 | case buffetch.ModuleRef: |
| 312 | return c.getWorkspaceForModuleRef(ctx, t, functionOptions) |
| 313 | default: |
| 314 | // This is a system error. |
| 315 | return nil, syserror.Newf("invalid SourceOrModuleRef: %T", sourceOrModuleRef) |
| 316 | } |
| 317 | } |
| 318 | |
| 319 | func (c *controller) GetWorkspaceDepManager( |
| 320 | ctx context.Context, |
nothing calls this directly
no test coverage detected