s3-orchestrator

ui

import "github.com/afreidah/s3-orchestrator/internal/transport/ui"

Package ui provides the built-in web dashboard for operational visibility, serving HTML pages, JSON API endpoints, and static assets.

Index

type BackendOps

BackendOps is the narrow surface of *proxy.BackendManager that the UI dashboard depends on for operations not exposed via a named sub-manager. *proxy.BackendManager satisfies it.

type BackendOps interface {
    GetDashboardData(ctx context.Context) (*dashboard.Data, error)
    GetDirectoryChildren(ctx context.Context, prefix, startAfter string, maxKeys int) (*core.DirectoryListResult, error)
    SyncBackend(ctx context.Context, backendName, virtualBucket string, virtualBuckets []string) (int, int, error)
}

type Deps

Deps holds the dependencies New requires.

type Deps struct {
    BackendOps    BackendOps
    Objects       *object.Manager
    Rebalancer    *worker.Rebalancer
    OverRep       *worker.OverReplicationCleaner
    AdminHandler  *admin.Handler
    DBHealthy     func() bool
    Cfg           *config.Config
    LogBuffer     *telemetry.LogBuffer
    LoginThrottle *httputil.LoginThrottle
}

type Handler

Handler serves the web UI dashboard.

type Handler struct {
    // contains filtered or unexported fields
}

func New

func New(d *Deps) *Handler

New is the explicit-deps constructor. The DI layer constructs Deps and passes it here; tests build Deps directly. Each field is the smallest contract the handler uses, so wiring stays visible at the call site.

func (*Handler) Register

func (h *Handler) Register(mux *http.ServeMux, prefix string)

Register mounts the UI routes on the given mux under the configured prefix.

func (*Handler) UpdateConfig

func (h *Handler) UpdateConfig(cfg *config.Config)

UpdateConfig atomically replaces the config used by the dashboard. Called on SIGHUP to keep the dashboard in sync with the running config.

Generated by gomarkdoc