s3-orchestrator

adminapi

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

Package adminapi holds the wire types shared between the admin API handlers and their out-of-process clients.

Index

type BackendStatus

BackendStatus is the configured-and-live state of one backend: its quota and usage counters plus circuit-breaker health and drain state.

type BackendStatus struct {
    Name         string `json:"name"`
    Healthy      bool   `json:"healthy"`
    Draining     bool   `json:"draining"`
    BytesUsed    int64  `json:"bytes_used"`
    BytesLimit   int64  `json:"bytes_limit"`
    ObjectCount  int64  `json:"object_count"`
    APIRequests  int64  `json:"api_requests"`
    EgressBytes  int64  `json:"egress_bytes"`
    IngressBytes int64  `json:"ingress_bytes"`
}

type CleanupDLQItem

CleanupDLQItem is one dead-lettered cleanup: an object whose backend delete never succeeded within the retry budget and now needs operator attention.

type CleanupDLQItem struct {
    Backend       string    `json:"backend"`
    ObjectKey     string    `json:"object_key"`
    Reason        string    `json:"reason"`
    SizeBytes     int64     `json:"size_bytes"`
    Attempts      int32     `json:"attempts"`
    FirstEnqueued time.Time `json:"first_enqueued_at"`
    MovedAt       time.Time `json:"moved_at"`
    LastError     string    `json:"last_error,omitempty"`
}

type CleanupDLQRequeueResponse

CleanupDLQRequeueResponse reports how many rows a requeue moved back into the cleanup queue, and the backend it was scoped to (empty means all backends).

type CleanupDLQRequeueResponse struct {
    Backend  string `json:"backend,omitempty"`
    Requeued int64  `json:"requeued"`
}

type CleanupDLQResponse

CleanupDLQResponse is the dead-letter listing: the total depth plus a page of rows, newest graduation first.

type CleanupDLQResponse struct {
    Depth int64            `json:"depth"`
    Items []CleanupDLQItem `json:"items"`
}

type LogEntry

LogEntry is one structured log record: the timestamp, severity, message, the emitting component (lifted from the attributes for its own column), and the remaining structured attributes so the client can render a full, human-readable line rather than a bare message.

type LogEntry struct {
    Time      time.Time      `json:"time"`
    Level     string         `json:"level"`
    Message   string         `json:"message"`
    Component string         `json:"component,omitempty"`
    Attrs     map[string]any `json:"attrs,omitempty"`
}

type LogsResponse

LogsResponse is a page of recent structured log entries, oldest first.

type LogsResponse struct {
    Entries []LogEntry `json:"entries"`
}

type ObjectEntry

ObjectEntry is one leaf object in a listing page.

type ObjectEntry struct {
    Key  string `json:"key"`
    Size int64  `json:"size"`
}

type ObjectListResponse

ObjectListResponse is one delimiter-grouped page of the object namespace: child directories collapsed into CommonPrefixes and leaf objects in Objects, with a continuation token when the page truncates.

type ObjectListResponse struct {
    CommonPrefixes []string      `json:"common_prefixes"`
    Objects        []ObjectEntry `json:"objects"`
    Truncated      bool          `json:"truncated"`
    Next           string        `json:"next,omitempty"`
}

type ObjectLocation

ObjectLocation is one backend copy of an object. The raw envelope encryption key is deliberately omitted from the wire; only the encrypted flag and the key id are exposed so a secret never leaves the process.

type ObjectLocation struct {
    Backend       string    `json:"backend"`
    SizeBytes     int64     `json:"size_bytes"`
    CreatedAt     time.Time `json:"created_at"`
    Encrypted     bool      `json:"encrypted"`
    KeyID         string    `json:"key_id,omitempty"`
    PlaintextSize int64     `json:"plaintext_size"`
    ContentHash   string    `json:"content_hash,omitempty"`
}

type ObjectLocationsResponse

ObjectLocationsResponse lists every backend copy of a single object key.

type ObjectLocationsResponse struct {
    Key       string           `json:"key"`
    Locations []ObjectLocation `json:"locations"`
}

type RemoveBackendPreview

RemoveBackendPreview is the confirmation payload returned by the purge-preview phase of DELETE /admin/api/backends/{name}: what a --purge would destroy and the token required to execute it.

type RemoveBackendPreview struct {
    Status       string `json:"status"`
    Backend      string `json:"backend"`
    ObjectCount  int64  `json:"object_count"`
    TotalBytes   int64  `json:"total_bytes"`
    ConfirmToken string `json:"confirm_token"`
    ExpiresIn    int    `json:"expires_in"`
}

type ReplicationStatusResponse

ReplicationStatusResponse is a snapshot of the replication backlog: the configured factor, the count of under-replicated objects (waiting to be copied up to factor) and over-replicated objects (waiting for cleanup), and when the snapshot was computed. Factor <= 1 means replication is disabled.

type ReplicationStatusResponse struct {
    Factor          int       `json:"factor"`
    UnderReplicated int64     `json:"under_replicated"`
    OverReplicated  int64     `json:"over_replicated"`
    ComputedAt      time.Time `json:"computed_at"`
}

type StatusResponse

StatusResponse is a snapshot of instance and per-backend operational state.

type StatusResponse struct {
    DBHealthy   bool            `json:"db_healthy"`
    UsagePeriod string          `json:"usage_period"`
    Backends    []BackendStatus `json:"backends"`
}

Generated by gomarkdoc