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

Method getParsedRef

private/buf/buffetch/ref_parser.go:505–520  ·  view source on GitHub ↗

TODO FUTURE: rename to getParsedRefForString

(
	ctx context.Context,
	value string,
	allowedFormats []string,
)

Source from the content-addressed store, hash-verified

503
504// TODO FUTURE: rename to getParsedRefForString
505func (a *refParser) getParsedRef(
506 ctx context.Context,
507 value string,
508 allowedFormats []string,
509) (internal.ParsedRef, error) {
510 parsedRef, err := a.fetchRefParser.GetParsedRef(
511 ctx,
512 value,
513 internal.WithAllowedFormats(allowedFormats...),
514 )
515 if err != nil {
516 return nil, err
517 }
518 a.checkDeprecated(parsedRef)
519 return parsedRef, nil
520}
521
522func (a *refParser) getParsedRefForInputConfig(
523 ctx context.Context,

Callers 10

GetRefMethod · 0.95
GetSourceOrModuleRefMethod · 0.95
GetMessageRefMethod · 0.95
GetSourceRefMethod · 0.95
GetDirRefMethod · 0.95
GetDirOrProtoFileRefMethod · 0.95
GetModuleRefMethod · 0.95
testRoundTripLocalFileFunction · 0.45
testGetParsedRefFunction · 0.45

Calls 3

checkDeprecatedMethod · 0.95
WithAllowedFormatsFunction · 0.92
GetParsedRefMethod · 0.65

Tested by 3

testRoundTripLocalFileFunction · 0.36
testGetParsedRefFunction · 0.36