diagnosticstore

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersion     = 1
	MaximumConfigSize = 64 * 1024
	DefaultConfigPath = "/etc/gha-fleet/diagnostic-storage.yaml"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	SchemaVersion     int    `yaml:"schema_version" json:"schema_version"`
	Endpoint          string `yaml:"endpoint" json:"endpoint"`
	Region            string `yaml:"region" json:"region"`
	CAFile            string `yaml:"ca_file" json:"ca_file"`
	RootAccessKeyFile string `yaml:"root_access_key_file" json:"root_access_key_file"`
	RootSecretKeyFile string `yaml:"root_secret_key_file" json:"root_secret_key_file"`
	Bucket            string `yaml:"bucket" json:"bucket"`
	Prefix            string `yaml:"prefix" json:"prefix"`
	QuotaBytes        int64  `yaml:"quota_bytes" json:"quota_bytes"`
	RetentionDays     int    `yaml:"retention_days" json:"retention_days"`
	MinimumHeadroom   int64  `yaml:"minimum_headroom_bytes" json:"minimum_headroom_bytes"`
}

Config is the root-owned durability contract for the remote diagnostic WAL. It deliberately contains no exporter secret: bucket capacity and retention are reconciled with the RustFS root credential, while the exporter keeps its independently scoped write-only identity.

func Load

func Load(path string) (Config, error)

func WithCredentialDirectory

func WithCredentialDirectory(config Config, directory string) (Config, error)

WithCredentialDirectory binds the two root credential paths to a systemd credential directory supplied by the unit's %d specifier. The public config remains secret-free and shared by observer and reconciler even though each service receives an isolated /run/credentials/<unit> mount.

func (Config) Validate

func (c Config) Validate() error

type Result

type Result struct {
	SchemaVersion        int       `json:"schema_version"`
	Applied              bool      `json:"applied"`
	StateBefore          string    `json:"state_before"`
	StateAfter           string    `json:"state_after"`
	Bucket               string    `json:"bucket"`
	QuotaBytes           int64     `json:"quota_bytes"`
	RetentionDays        int       `json:"retention_days"`
	CurrentUsageBytes    int64     `json:"current_usage_bytes"`
	RemainingQuotaBytes  int64     `json:"remaining_quota_bytes"`
	UsagePercentage      float64   `json:"usage_percentage"`
	MinimumHeadroomBytes int64     `json:"minimum_headroom_bytes"`
	HeadroomState        string    `json:"headroom_state"`
	UsageObservedAt      time.Time `json:"usage_observed_at"`
	Actions              []string  `json:"actions"`
}

type Runner

type Runner struct{ Requester rustfscache.Requester }

func (Runner) Run

func (r Runner) Run(ctx context.Context, config Config, apply bool) (Result, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL