Help us shape the future of Go! Take the 2026 Go Developer Survey

tablelookup

package
v1.149.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

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

func New(reg Tables) *Lookup

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).

type Tables

type Tables interface {
	Available() bool
	TablesFor(ctx context.Context, kind string, ids []string) (map[string][]tableregister.Registration, error)
}

Tables is the half of the registrar a lookup reads. tableregister.Registrar satisfies it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL