tablesapi

package
v1.148.0 Latest Latest
Warning

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

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

Documentation

Overview

Package tablesapi is the admin REST surface over table registrations (#2136): every registration on the platform, and a connection's scratch schema reconciled against them -- tables no registration holds, registrations whose table is gone, tables reading somewhere their registration does not say -- with the repairs the platform can prove are its own to make.

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 {
	// Registrations lists. Nil mounts nothing.
	Registrations Registrations
	// Reconciler reconciles. Nil mounts the listing alone.
	Reconciler Reconciler
	// Caller is the acting administrator, as a repair's audit event records
	// them.
	Caller func(*http.Request) tableregister.Caller
}

Config carries what the routes act through.

type Reconciler

type Reconciler interface {
	Reconcile(ctx context.Context, connection string) (*tablereconcile.Reconciliation, error)
	Repair(ctx context.Context, caller tableregister.Caller, connection string, items []tablereconcile.RepairItem) ([]tablereconcile.RepairOutcome, error)
}

Reconciler reconciles and repairs a connection. tablereconcile.Reconciler satisfies it.

type RegistrationList

type RegistrationList struct {
	Registrations []tableregister.Registration `json:"registrations"`
	Total         int                          `json:"total"`
}

RegistrationList is a page of registrations and the total the filter matched.

type Registrations

type Registrations interface {
	List(ctx context.Context, f tableregister.Filter) ([]tableregister.Registration, int, error)
}

Registrations lists registrations. tableregister.Registrar satisfies it.

type RepairRequest

type RepairRequest struct {
	Connection string                      `json:"connection"`
	Repair     []tablereconcile.RepairItem `json:"repair"`
}

RepairRequest is the body of a repair.

type RepairResponse

type RepairResponse struct {
	Outcomes []tablereconcile.RepairOutcome `json:"outcomes"`
}

RepairResponse is what each repair did.

Jump to

Keyboard shortcuts

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