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