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