catalogscanapi

package
v1.147.0 Latest Latest
Warning

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

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

Documentation

Overview

Package catalogscanapi is the admin REST surface for the platform catalog's scan (#1918): its settings (how often every connection is scanned, and what each connection keeps out of the catalog), each connection's last scan, a request to scan now, and the schema documents the scan keeps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(mux *http.ServeMux, wrap func(http.Handler) http.Handler, cfg Config)

Register mounts the routes, each behind wrap, the admin API's authentication.

Types

type Config

type Config struct {
	// Store holds the settings. nil mounts nothing.
	Store Store
	// Scanner runs a requested scan. nil leaves the request route unmounted.
	Scanner Scanner
	// Documents reads the kept schema documents. nil leaves their routes
	// unmounted.
	Documents Documents
	// Author resolves the acting admin.
	Author func(*http.Request) string
}

Config carries the store, the scanner and the parent-owned helpers.

type DocumentList

type DocumentList struct {
	Documents []catalog.SchemaDocument `json:"documents"`
}

DocumentList is every schema document the scan keeps, without content.

type Documents

type Documents interface {
	ListDocuments(ctx context.Context) ([]catalog.SchemaDocument, error)
	GetDocument(ctx context.Context, ref catalog.Ref) (*catalog.SchemaDocument, error)
}

Documents reads the schema documents the scan keeps. catalogstore.Store satisfies it.

type ScanList

type ScanList struct {
	Scans []catalogscan.Outcome `json:"scans"`
}

ScanList is the last scan of every connection.

type ScanRequested

type ScanRequested struct {
	Status string `json:"status"`
}

ScanRequested acknowledges a scan request.

type Scanner

type Scanner interface {
	ScanNow(ctx context.Context, by string) error
}

Scanner records a request for a scan without waiting for it. catalogscan.Loop satisfies it.

type Store

type Store interface {
	Get(ctx context.Context) (catalogscan.Settings, error)
	Set(ctx context.Context, s catalogscan.Settings, author string) error
	Outcomes(ctx context.Context) ([]catalogscan.Outcome, error)
}

Store reads and saves the settings and reads the last scans. catalogscan.Store satisfies it.

Jump to

Keyboard shortcuts

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