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

Method GetMessageRefForInputConfig

private/buf/buffetch/ref_parser.go:353–370  ·  view source on GitHub ↗
(
	ctx context.Context,
	inputConfig bufconfig.InputConfig,
)

Source from the content-addressed store, hash-verified

351}
352
353func (a *refParser) GetMessageRefForInputConfig(
354 ctx context.Context,
355 inputConfig bufconfig.InputConfig,
356) (MessageRef, error) {
357 parsedRef, err := a.getParsedRefForInputConfig(ctx, inputConfig, messageFormats)
358 if err != nil {
359 return nil, err
360 }
361 parsedSingleRef, ok := parsedRef.(internal.ParsedSingleRef)
362 if !ok {
363 return nil, fmt.Errorf("invalid ParsedRef type for message: %T", parsedRef)
364 }
365 messageEncoding, err := parseMessageEncoding(parsedSingleRef.Format())
366 if err != nil {
367 return nil, err
368 }
369 return newMessageRef(parsedSingleRef, messageEncoding)
370}
371
372func (a *refParser) GetSourceRef(
373 ctx context.Context,

Callers

nothing calls this directly

Calls 4

parseMessageEncodingFunction · 0.85
newMessageRefFunction · 0.85
FormatMethod · 0.65

Tested by

no test coverage detected