Documentation
¶
Index ¶
- Constants
- Variables
- func AcceptedStages() []string
- func ListBundleBatch(ctx context.Context, config Config, limit int) ([]string, int, int64, error)
- func ListBundles(config Config) ([]string, error)
- func RemoveBundle(config Config, bundle Bundle) error
- func StageAccepted(stage string) bool
- type Bundle
- type Config
- type ExportError
- type ExportRecord
- type Exporter
- type ObjectStore
- type Progress
- type RemoteObject
- type S3Store
- type State
- type StateStore
- type Status
- type Summary
Constants ¶
const StageCanary = "canary"
StageCanary is the only stage this exporter may run in while RustFS is a release candidate.
Variables ¶
var ErrRemoteObjectExists = errors.New("remote object already exists")
Functions ¶
func AcceptedStages ¶
func AcceptedStages() []string
AcceptedStages is the closed set of deployment stages the fleet accepts for the diagnostic exporter, and it is deliberately one declaration rather than two equal literals.
The exporter refuses to start outside this set, and the observer refuses to grade a status reported from outside it. Those are the same policy read by two processes, and they were two independent string comparisons: promoting the exporter would have relaxed its own validator while leaving the observer refusing the very status the promotion produced, turning a successful promotion into a fail-closed observer on every serving host.
Promotion is therefore one edit here, and TestAcceptedStagesAreTheOnlyStageGate fails if a second literal reappears anywhere.
func ListBundleBatch ¶
ListBundleBatch returns the oldest bounded slice of the durable spool using the source inode modification time. Ordering by filename is not a global FIFO because the instance name precedes the capture timestamp. Invalid bundles remain visible and sort first so corruption cannot hide behind healthy traffic.
func ListBundles ¶
func RemoveBundle ¶
RemoveBundle removes exactly the source inode verified by ReadBundle. A replacement or symlink race fails closed and remains in the WAL.
func StageAccepted ¶
StageAccepted reports whether a stage may run and be graded.
Types ¶
type Bundle ¶
type Config ¶
type Config struct {
SchemaVersion int `yaml:"schema_version" json:"schema_version"`
DeploymentStage string `yaml:"deployment_stage" json:"deployment_stage"`
SourceDirectory string `yaml:"source_directory" json:"source_directory"`
SourceOwner string `yaml:"source_owner" json:"source_owner"`
StateDirectory string `yaml:"state_directory" json:"state_directory"`
Endpoint string `yaml:"endpoint" json:"endpoint"`
Region string `yaml:"region" json:"region"`
Bucket string `yaml:"bucket" json:"bucket"`
Prefix string `yaml:"prefix" json:"prefix"`
Repositories []string `yaml:"repositories" json:"repositories"`
AccountScopes []string `yaml:"account_scopes" json:"account_scopes"`
Pools []string `yaml:"pools" json:"pools"`
Trusts []string `yaml:"trusts" json:"trusts"`
Platform string `yaml:"platform" json:"platform"`
Architecture string `yaml:"architecture" json:"architecture"`
PathStyle bool `yaml:"path_style" json:"path_style"`
CAFile string `yaml:"ca_file" json:"ca_file"`
AccessKeyFile string `yaml:"access_key_file" json:"access_key_file"`
SecretKeyFile string `yaml:"secret_key_file" json:"secret_key_file"`
RequestTimeoutSeconds int `yaml:"request_timeout_seconds" json:"request_timeout_seconds"`
SourceRetentionHours int `yaml:"source_retention_hours" json:"source_retention_hours"`
MaxBundleBytes int64 `yaml:"max_bundle_bytes" json:"max_bundle_bytes"`
MaxDecompressedBytes int64 `yaml:"max_decompressed_bytes" json:"max_decompressed_bytes"`
}
Config is deliberately narrow while RustFS remains a canary backend. It contains no secret values; systemd credential paths point at the per-unit credential mount.
func LoadConfig ¶
func ParseConfig ¶
ParseConfig validates committed deployment configuration without applying the runtime ownership checks enforced by LoadConfig.
func (Config) AllowsPool ¶
AllowsPool reports whether a manifest pool is in the reviewed, strictly sorted allowlist. Invalid or unvalidated lists fail closed.
func (Config) AllowsRepository ¶
func (Config) AllowsRepositoryAccount ¶
func (Config) AllowsTrust ¶
AllowsTrust reports whether a diagnostic manifest belongs to a reviewed trust domain. Invalid or unvalidated lists fail closed.
type ExportError ¶
func (ExportError) Error ¶
func (e ExportError) Error() string
type ExportRecord ¶
type Exporter ¶
type Exporter struct {
Config Config
Store ObjectStore
State StateStore
Now func() time.Time
}
type ObjectStore ¶
type Progress ¶
type Progress struct {
SchemaVersion int `json:"schema_version"`
ObservedAt string `json:"observed_at"`
LastProgressAt string `json:"last_progress_at,omitempty"`
LastFullSyncAt string `json:"last_full_sync_at,omitempty"`
ScannedBundles int `json:"scanned_bundles"`
ExportedBundles int `json:"exported_bundles"`
DeletedBundles int `json:"deleted_bundles"`
FailedBundles int `json:"failed_bundles"`
BacklogBundles int `json:"backlog_bundles"`
BacklogBytes int64 `json:"backlog_bytes"`
}
type RemoteObject ¶
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
func NewS3Store ¶
type State ¶
type State struct {
SchemaVersion int `json:"schema_version"`
Status Status `json:"status"`
Exports map[string]ExportRecord `json:"exports"`
}
type StateStore ¶
type StateStore struct {
Directory string
}
func (StateStore) Load ¶
func (s StateStore) Load() (State, error)
func (StateStore) LoadProgress ¶
func (s StateStore) LoadProgress() (Progress, error)
func (StateStore) Save ¶
func (s StateStore) Save(state State) error
func (StateStore) SaveProgress ¶
func (s StateStore) SaveProgress(progress Progress) error
type Status ¶
type Status struct {
SchemaVersion int `json:"schema_version"`
DeploymentStage string `json:"deployment_stage"`
ObservedAt string `json:"observed_at"`
LastSuccessAt string `json:"last_success_at,omitempty"`
LastErrorCode string `json:"last_error_code,omitempty"`
ConsecutiveFailures int `json:"consecutive_failures"`
SourceBundles int `json:"source_bundles"`
ExportedBundles int `json:"exported_bundles"`
PendingBundles int `json:"pending_bundles"`
SourceBytes int64 `json:"source_bytes"`
ExportedBytes int64 `json:"exported_bytes"`
LastProgressAt string `json:"-"`
LastFullSyncAt string `json:"-"`
ScannedBundles int `json:"-"`
DeletedBundles int `json:"-"`
}
func ReadStatus ¶
type Summary ¶
type Summary struct {
SourceBundles int `json:"source_bundles"`
ExportedBundles int `json:"exported_bundles"`
PendingBundles int `json:"pending_bundles"`
SourceBytes int64 `json:"source_bytes"`
ExportedBytes int64 `json:"exported_bytes"`
ScannedBundles int `json:"scanned_bundles"`
DeletedBundles int `json:"deleted_bundles"`
}