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

Method GetSourceRef

private/buf/buffetch/ref_parser.go:372–386  ·  view source on GitHub ↗
(
	ctx context.Context,
	value string,
)

Source from the content-addressed store, hash-verified

370}
371
372func (a *refParser) GetSourceRef(
373 ctx context.Context,
374 value string,
375) (SourceRef, error) {
376 parsedRef, err := a.getParsedRef(ctx, value, sourceFormats)
377 if err != nil {
378 return nil, err
379 }
380 parsedBucketRef, ok := parsedRef.(internal.ParsedBucketRef)
381 if !ok {
382 // this should never happen
383 return nil, fmt.Errorf("invalid ParsedRef type for source: %T", parsedRef)
384 }
385 return newSourceRef(parsedBucketRef), nil
386}
387
388func (a *refParser) GetSourceRefForInputConfig(
389 ctx context.Context,

Callers

nothing calls this directly

Calls 2

getParsedRefMethod · 0.95
newSourceRefFunction · 0.85

Tested by

no test coverage detected