
admin
Package admin provides the admin API handler for operational control endpoints.
Index
- type BackendOps
- type BackfillChecksumsResult
- type BulkRewriteResult
- type Deps
- type Handler
- func New(d *Deps) *Handler
- func (h *Handler) BackfillChecksums(ctx context.Context, batchSize int) BackfillChecksumsResult
- func (h *Handler) EncryptExisting(ctx context.Context) BulkRewriteResult
- func (h *Handler) Register(mux *http.ServeMux)
- func (h *Handler) Replicate(ctx context.Context) (ReplicateResult, error)
- func (h *Handler) Scrub(ctx context.Context, batchSize int) ScrubResult
- func (h *Handler) SetReloadStatusProvider(fn func() any)
- type OverReplicationOps
- type Reconciler
- type ReplicateResult
- type ReplicatorOps
- type ScrubResult
- type ScrubberOps
- type WorkerHealth
type BackendOps
BackendOps is the narrow surface of *proxy.BackendManager that the admin handler depends on for operations not encapsulated by a named sub-manager (replicator, drain, scrubber, etc.). *proxy.BackendManager satisfies it.
type BackfillChecksumsResult
BackfillChecksumsResult is the outcome of a checksum backfill pass.
type BulkRewriteResult
BulkRewriteResult is the outcome of a bulk encrypt/decrypt-existing pass. Status is “complete” when the run finished, “skipped” when the operation is unavailable (encryption not enabled).
type Deps
Deps groups the narrow role interfaces and infrastructure the admin handler touches. Each field carries the smallest contract the handler actually uses, so the constructor (and the backing DI provider) never hand the handler a god-shaped *proxy.BackendManager.
type Handler
Handler serves the admin API endpoints.
func New
New creates a new admin API handler from its narrow dependency bag.
func (*Handler) BackfillChecksums
BackfillChecksums computes and stores content hashes for objects that don’t have one, paginating internally until all objects are processed or the context is cancelled. batchSize <= 0 means use 100. Skips when integrity verification is not enabled.
func (*Handler) EncryptExisting
EncryptExisting downloads every unencrypted object, encrypts it, re-uploads the ciphertext, and updates the DB record. Returns counts. Skips when encryption is not configured.
func (*Handler) Register
Register mounts the admin API routes on the given mux.
func (*Handler) Replicate
Replicate runs one replication cycle synchronously and returns the resulting counts. Skips when replication is unconfigured or factor <= 1. Refreshes quota metrics on success. Exposed for callers (UI, tests) that need the counts back as Go values rather than JSON.
func (*Handler) Scrub
Scrub runs one integrity-verification scrub pass synchronously and returns the per-pass counts. batchSize <= 0 means use the configured ScrubberBatchSize. Skips when integrity verification is not enabled.
func (*Handler) SetReloadStatusProvider
SetReloadStatusProvider wires the callback that returns the most recent reload result. Called by the runtime after the reload coordinator is built. Routing through a setter rather than constructor injection avoids the import cycle that would result from admin importing the reload package directly.
type OverReplicationOps
OverReplicationOps is the slice of *worker.OverReplicationCleaner the admin handler uses for the over-replication status and cleanup endpoints.
type Reconciler
Reconciler is the slice of *worker.Reconciler the admin handler uses for the on-demand reconciliation endpoint.
type ReplicateResult
ReplicateResult is the outcome of a one-shot replication cycle.
type ReplicatorOps
ReplicatorOps is the slice of *worker.Replicator the admin handler uses for the synchronous replicate-now endpoint. Config returns nil when the worker is unconfigured; Replicate runs one cycle and returns the count.
type ScrubResult
ScrubResult is the outcome of one on-demand scrub cycle.
type ScrubberOps
ScrubberOps is the slice of *worker.Scrubber the admin handler uses for the integrity-scrub and hash-backfill endpoints.
type WorkerHealth
WorkerHealth is the JSON shape returned by /admin/api/workers. Mirrors lifecycle.WorkerHealth but lives here so the admin transport package owns its own response contract and does not import the lifecycle package directly. Field tags must stay in lockstep with the source type or the wire format silently diverges.
Generated by gomarkdoc