Resolver is an interface to a type that send q to a resolver using a specific transport.
| 14 | // Resolver is an interface to a type that send q to a resolver using a specific |
| 15 | // transport. |
| 16 | type Resolver interface { |
| 17 | // Resolve send q and write the response into buf. If buf too small, |
| 18 | // response is truncated. It is fine to reuse the same []byte for q.Payload |
| 19 | // and buf. |
| 20 | // |
| 21 | // When caching is enabled, a cached response is returned if a valid entry |
| 22 | // is found in the cache for q. In case of err with cache enabled, an |
| 23 | // expired fallback entry may be stored in buf. In such case, n is > 0. |
| 24 | Resolve(ctx context.Context, q query.Query, buf []byte) (n int, i ResolveInfo, err error) |
| 25 | } |
| 26 | |
| 27 | type Cacher interface { |
| 28 | // Get returns the cached value for key. Returned value must be treated as |