( ctx context.Context, inputConfig bufconfig.InputConfig, )
| 250 | } |
| 251 | |
| 252 | func (a *refParser) GetRefForInputConfig( |
| 253 | ctx context.Context, |
| 254 | inputConfig bufconfig.InputConfig, |
| 255 | ) (Ref, error) { |
| 256 | parsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, allFormats) |
| 257 | if err != nil { |
| 258 | return nil, err |
| 259 | } |
| 260 | switch t := parsedRef.(type) { |
| 261 | case internal.ParsedSingleRef: |
| 262 | messageEncoding, err := parseMessageEncoding(t.Format()) |
| 263 | if err != nil { |
| 264 | return nil, err |
| 265 | } |
| 266 | return newMessageRef(t, messageEncoding) |
| 267 | case internal.ParsedArchiveRef: |
| 268 | return newSourceRef(t), nil |
| 269 | case internal.ParsedDirRef: |
| 270 | return newDirRef(t), nil |
| 271 | case internal.ParsedGitRef: |
| 272 | return newSourceRef(t), nil |
| 273 | case internal.ParsedModuleRef: |
| 274 | return newModuleRef(t), nil |
| 275 | case internal.ProtoFileRef: |
| 276 | return newProtoFileRef(t), nil |
| 277 | default: |
| 278 | return nil, fmt.Errorf("unknown ParsedRef type: %T", parsedRef) |
| 279 | } |
| 280 | } |
| 281 | |
| 282 | func (a *refParser) GetSourceOrModuleRef( |
| 283 | ctx context.Context, |
nothing calls this directly
no test coverage detected