catalogwire

package
v1.146.2 Latest Latest
Warning

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

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

Documentation

Overview

Package catalogwire assembles the platform catalog's scan (#1918) from the running platform: the catalog store, the scan's settings, a source for each kind of connection read through its live toolkits, and the loop that runs the scan on its interval. The composition root starts it once the toolkits are wired and stops it when the server drains.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connections

func Connections(reg *registry.Registry) []catalogapi.Connection

Connections lists the live connections the catalog holds datasets for, by kind and instance, the names a catalog reference carries.

func PortalRegistrar

func PortalRegistrar(p *platform.Platform, store catalog.Store, resolver portal.PersonaResolver, adminRoles []string) func(*http.ServeMux)

PortalRegistrar returns the route registrar for the portal catalog (#1921).

func RegistrationStore

func RegistrationStore(p Platform, inner tableregister.Store) tableregister.Store

RegistrationStore wraps a registration store so each table it records is cataloged when it is recorded. With no database it returns inner.

Types

type Catalog

type Catalog struct {
	Settings *catalogscan.Store
	Loop     *catalogscan.Loop
	// Documents holds the schema documents the scan keeps (#1918).
	Documents *catalogstore.Store
	// Import carries a DataHub into the catalog (#1923): once on upgrade,
	// after a scan, from the DataHub the configuration names (#2124), and
	// whenever an administrator starts it.
	Import *catalogimport.Runner
	// contains filtered or unexported fields
}

Catalog is the assembled scan, and the DataHub import beside it.

func Build

func Build(p *platform.Platform) *Catalog

Build assembles the scan, or returns nil with no platform or no database.

func (*Catalog) MountAdmin

func (c *Catalog) MountAdmin(
	mux *http.ServeMux, auth func(*platform.Platform) func(http.Handler) http.Handler, author func(*http.Request) string,
)

MountAdmin mounts the scan's settings and scan routes behind the admin API's authentication, when the admin API is enabled.

func (*Catalog) Start

func (c *Catalog) Start(ctx context.Context)

Start begins scanning.

func (*Catalog) Stop

func (c *Catalog) Stop()

Stop ends scanning and any import under way.

type Labeler

type Labeler struct {
	Store catalog.Store
}

Labeler names the catalog definitions a knowledge page cites.

func (Labeler) Labels

func (l Labeler) Labels(ctx context.Context, refs []string) map[string]string

Labels reads the name of each definition reference; a reference that names no definition, or is not one, is left out.

type Platform

type Platform interface {
	DB() *sql.DB
	ToolkitRegistry() *registry.Registry
}

Platform is what the scan is assembled from.

Jump to

Keyboard shortcuts

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