Documentation
¶
Overview ¶
Package tablelookup adapts the table registrar to the discovery layer: it answers, for a page of search hits or one fetched record, which of them are readable as query-engine tables. It was moved out of tableregister when that package reached its size budget (#2136).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Lookup ¶
type Lookup struct {
// contains filtered or unexported fields
}
Lookup adapts a Registrar to the discovery layer's TableLookup: it answers, for a page of search hits or one fetched record, which of them are readable as query-engine tables.
It lives here rather than in pkg/knowledge because staleness needs both halves -- the registration's recorded location and the record's current head key -- and only this side knows what a registration is.
func New ¶
NewLookup adapts a Registrar for discovery. A nil or unwired Registrar yields a lookup that finds nothing, which is a deployment with no registration mechanism rather than an error every search has to carry.
func (*Lookup) TablesFor ¶
func (l *Lookup) TablesFor( ctx context.Context, subjects []knowledge.TableSubject, ) (map[string][]knowledge.HitTable, error)
TablesFor returns every table reference of every subject that has one.
A subject with several registrations yields all of them in the store's order, newest first, which is the order manage_table action=list shows. Which of them a surface reports is the discovery layer's business, not this adapter's: fetch renders them all, a search hit picks one (#1627).