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

Function NewLazyResolver

private/pkg/protoencoding/protoencoding.go:51–55  ·  view source on GitHub ↗

NewLazyResolver creates a new Resolver that is constructed from the given descriptors only as needed, if invoked. If there is an error when constructing the resolver, it will be returned by all method calls of the returned resolver.

(fileDescriptors ...F)

Source from the content-addressed store, hash-verified

49// If there is an error when constructing the resolver, it will be returned by all
50// method calls of the returned resolver.
51func NewLazyResolver[F protodescriptor.FileDescriptor](fileDescriptors ...F) Resolver {
52 return &lazyResolver{fn: func() (Resolver, error) {
53 return newResolver(fileDescriptors...)
54 }}
55}
56
57// CombineResolvers returns a resolver that uses all of the given resolvers. It
58// will use the first resolver, and if it returns an error, the second will be

Callers 3

newImageFunction · 0.92
NewImageForProtoFunction · 0.92
resolverForFDSFunction · 0.92

Calls 1

newResolverFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…