( ctx context.Context, value string, )
| 280 | } |
| 281 | |
| 282 | func (a *refParser) GetSourceOrModuleRef( |
| 283 | ctx context.Context, |
| 284 | value string, |
| 285 | ) (SourceOrModuleRef, error) { |
| 286 | parsedRef, err := a.getParsedRef(ctx, value, sourceOrModuleFormats) |
| 287 | if err != nil { |
| 288 | return nil, err |
| 289 | } |
| 290 | switch t := parsedRef.(type) { |
| 291 | case internal.ParsedSingleRef: |
| 292 | return nil, fmt.Errorf("invalid ParsedRef type for source or module: %T", parsedRef) |
| 293 | case internal.ParsedArchiveRef: |
| 294 | return newSourceRef(t), nil |
| 295 | case internal.ParsedDirRef: |
| 296 | return newDirRef(t), nil |
| 297 | case internal.ParsedGitRef: |
| 298 | return newSourceRef(t), nil |
| 299 | case internal.ParsedModuleRef: |
| 300 | return newModuleRef(t), nil |
| 301 | case internal.ProtoFileRef: |
| 302 | return newProtoFileRef(t), nil |
| 303 | default: |
| 304 | return nil, fmt.Errorf("unknown ParsedRef type: %T", parsedRef) |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | func (a *refParser) GetSourceOrModuleRefForInputConfig( |
| 309 | ctx context.Context, |
nothing calls this directly
no test coverage detected