Documentation
¶
Overview ¶
Local commands share the Profile and runtime constructors in this package.
Package storage binds shared CLI storage configuration and constructs owned runtimes.
Index ¶
- func DefaultPaths() (backendPath, metadataPath, cacheRoot string, err error)
- func MetadataDiskSize(path string) (int64, error)
- func OpenCodec(opts *Profile) (codec.Codec, func() error, error)
- func PrintMetadataResult(asJSON bool, result map[string]any) error
- func RedactS3Credentials(settings map[string]any, prefix string)
- type BackendConfig
- type Budget
- type CodecConfig
- type Export
- type FUSEConfig
- type LocalSettings
- type MaintenanceConfig
- type MaintenancePolicy
- type MetadataSelection
- type MountConfig
- type NamespaceConfig
- type PredictionOptions
- type Profile
- func (opts *Profile) ApplyGateway(gateway conf.GatewayOptions, explicitServer bool)
- func (p *Profile) BackupOptions() option.MetadataBackupConfig
- func (p *Profile) Budget() (Budget, error)
- func (p *Profile) ChunkSize() (int64, error)
- func (p *Profile) CodecName() string
- func (p *Profile) ForMaintenance(policy MaintenancePolicy) *Profile
- func (p *Profile) ForNamespace(n NamespaceConfig) *Profile
- func (p *Profile) ForNewVolume() *Profile
- func (o *Profile) HistoryConfig() (option.HistoryConfig, error)
- func (p *Profile) LocalCodec(name string) (codec.Codec, func() error, error)
- func (p *Profile) MetadataClientCache() (*option.MetadataCacheConfig, error)
- func (p *Profile) MetadataOptions() (meta.Options, error)
- func (p *Profile) MetadataPath() string
- func (p *Profile) NamespaceID() string
- func (p *Profile) Remote() RemoteConfig
- func (p *Profile) RemoteConsistency() (option.ConsistencyConfig, error)
- func (p *Profile) Settings() LocalSettings
- func (opts *Profile) Validate() error
- func (p *Profile) WithoutMetadataBackup() *Profile
- func (p *Profile) Workers() int
- type RemoteConfig
- type Runtime
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPaths ¶
DefaultPaths returns local backend, metadata and cache defaults for the current user.
func MetadataDiskSize ¶
MetadataDiskSize counts native database files before and after offline compaction.
func PrintMetadataResult ¶
PrintMetadataResult renders the common offline metadata result fields.
func RedactS3Credentials ¶
Viper exposes nested settings maps. Redact both credential locations before config show prints either its text or JSON representation. RedactS3Credentials removes secrets recursively even from malformed or array configurations.
Types ¶
type BackendConfig ¶
type BackendConfig struct {
Kind string
Root string
S3 backend.S3Config
Array backend.ArrayConfig
// contains filtered or unexported fields
}
BackendConfig is shared by exports and offline maintenance. Explicit remote object backends never fall back to an unrelated local directory.
func (*BackendConfig) Description ¶
func (o *BackendConfig) Description() string
func (*BackendConfig) Flags ¶
func (o *BackendConfig) Flags(flags *lfhflag.FlagSet, storageGroup, defaultRoot string)
func (*BackendConfig) Open ¶
Open opens only the object backend. Use storage.Open for a complete core runtime with codec, metadata, cache and ownership locks. The caller owns any returned io.Closer and must close it after all backend users have stopped.
func (*BackendConfig) Validate ¶
func (o *BackendConfig) Validate() error
type Budget ¶
Budget is the parsed process resource envelope used to allocate namespace reservations. Profile retains the CLI spelling and all unrelated options.
type CodecConfig ¶
type CodecConfig struct {
Name, WorkerMode, WorkerSocket, WorkerBinary string
WorkerProcs, Concurrency int
Timeout time.Duration
MaxChunk string
GzipLevel, ZstdLevel int
FPGAUser, FPGAH2C, FPGAC2H string
FPGACores int
OpenGuard func() error
}
CodecConfig is the execution configuration used by standalone compute nodes. It does not expose mount, cache, backend or daemon command options.
type Export ¶
type Export struct {
FileSystem core.Access
Description string
// contains filtered or unexported fields
}
Export owns a local runtime or a remote file client and its optional local diagnostics service. Close drains diagnostics before releasing storage.
func OpenExport ¶
func (*Export) StartDiagnostics ¶
StartDiagnostics opens the local control endpoint after storage is ready. Remote clients do not expose local engine snapshots or start a control socket.
type FUSEConfig ¶
type FUSEConfig struct {
AllowOther, DefaultPermissions bool
AllowDev bool
// Kernel selects the FUSE kernel transport. "fuse" uses the standard
// /dev/fuse module; "cpfs" uses the optional coexisting cpfs module.
Kernel string
DirectIO bool
ReadDirPlusAuto bool
// KernelMetadataCache requests coherent caching when mount owns the local
// writer. The mount command checks the live core before enabling it.
KernelMetadataCache bool
UID, GID int64
MaxWrite int
// contains filtered or unexported fields
}
FUSEConfig is shared by mount and the new-volume config writer. It does not change core's storage options or the credentials of the daemon process.
func (*FUSEConfig) Flags ¶
func (o *FUSEConfig) Flags(f *lfhflag.FlagSet)
Flags binds export-specific FUSE mount, identity and permission options.
func (*FUSEConfig) Options ¶
func (o *FUSEConfig) Options() (fuse.Options, error)
Options validates and constructs the FUSE adapter policy.
func (*FUSEConfig) Settings ¶
func (o *FUSEConfig) Settings() map[string]any
Settings returns the FUSE configuration for new-volume configuration output.
type LocalSettings ¶
type LocalSettings struct{ CachePath, SyncMode, HistoryMode string }
LocalSettings contains the storage paths and sync policy needed by offline commands.
type MaintenanceConfig ¶
type MaintenanceConfig struct {
BackendConfig
MetadataSelection
Path string
Prefix string
VolumeID string
Snapshot string
Block bool
JSON bool
Timeout time.Duration
}
MaintenanceConfig binds the common offline metadata and backend input schema. Each maintenance command owns its own operation and lifecycle.
type MaintenancePolicy ¶
type MaintenancePolicy struct{ RequireExisting, History bool }
MaintenancePolicy selects the existing offline normalization and history behavior.
type MetadataSelection ¶
type MetadataSelection struct {
// contains filtered or unexported fields
}
MetadataSelection keeps every command on the same engine/cache configuration.
type MountConfig ¶
type MountConfig struct {
Profile *Profile
Mountpoint string
Daemon, Foreground, AutoMount bool
DaemonLog string
StartupTimeout time.Duration
}
MountConfig binds the shared export configuration used by mount, setup and boot registration.
func MountFlags ¶
MountFlags binds the complete export schema without reading files or opening storage.
func ParseMount ¶
func ParseMount(name string, args []string, gateway conf.GatewayOptions) (*MountConfig, *lfhflag.FlagSet, error)
ParseMount parses and validates configuration without opening storage or starting a process.
type NamespaceConfig ¶
type NamespaceConfig struct {
ID string
Backend backend.Backend
Metadata meta.Engine
Budget *Budget
Admission func(context.Context) (func(), error)
CoordinatedBackup bool
}
NamespaceConfig supplies borrowed resources owned by the enclosing Meta process. The namespace runtime owns neither the shared native engine nor its external writer lock; its Close still drains its own core and codec.
type PredictionOptions ¶
type PredictionOptions struct {
// contains filtered or unexported fields
}
PredictionOptions binds the compression predictor schema shared with standalone workers.
type Profile ¶
type Profile struct {
BackendConfig
MetadataSelection
FUSEConfig
// contains filtered or unexported fields
}
Profile is one parsed invocation. CLI fields remain private; namespace runtimes derive isolated borrowed views through ForNamespace.
func NewCodecProfile ¶
func NewCodecProfile(c CodecConfig) *Profile
NewCodecProfile binds standalone codec execution without mount or backend settings.
func (*Profile) ApplyGateway ¶
func (opts *Profile) ApplyGateway(gateway conf.GatewayOptions, explicitServer bool)
ApplyGateway applies explicit global discovery while preserving an explicit --server override.
func (*Profile) BackupOptions ¶
func (p *Profile) BackupOptions() option.MetadataBackupConfig
BackupOptions returns the backup policy for an already validated profile.
func (*Profile) Budget ¶
Budget parses resource settings only when namespace resource allocation needs them.
func (*Profile) ForMaintenance ¶
func (p *Profile) ForMaintenance(policy MaintenancePolicy) *Profile
ForMaintenance clones a profile for offline CPU/raw access without a backup scheduler. Callers retain their original validation order before or after this policy change.
func (*Profile) ForNamespace ¶
func (p *Profile) ForNamespace(n NamespaceConfig) *Profile
ForNamespace derives a view that borrows the enclosing process resources.
func (*Profile) ForNewVolume ¶
ForNewVolume requires creation under the writer lock without changing the input profile.
func (*Profile) HistoryConfig ¶
func (o *Profile) HistoryConfig() (option.HistoryConfig, error)
HistoryConfig validates the configured history retention and journal policy.
func (*Profile) LocalCodec ¶
func (*Profile) MetadataClientCache ¶
func (p *Profile) MetadataClientCache() (*option.MetadataCacheConfig, error)
MetadataClientCache parses the shared remote-client cache policy. Zero TTL selects strict reads and starts no cache or subscription worker.
func (*Profile) MetadataPath ¶
func (*Profile) NamespaceID ¶
func (*Profile) Remote ¶
func (p *Profile) Remote() RemoteConfig
func (*Profile) RemoteConsistency ¶
func (p *Profile) RemoteConsistency() (option.ConsistencyConfig, error)
RemoteConsistency validates the authority policy before a remote open.
func (*Profile) Settings ¶
func (p *Profile) Settings() LocalSettings
Settings returns parsed local paths and sync policy without additional validation.
func (*Profile) Validate ¶
Validate checks the parsed configuration and normalizes paths without starting a storage runtime. Remote profiles are accepted only by mount/blk.
func (*Profile) WithoutMetadataBackup ¶
WithoutMetadataBackup reserves snapshots for the enclosing coordinated capture, while preserving every other parsed setting.
type RemoteConfig ¶
type RemoteConfig struct {
Server, Credentials, DataRoute string
Consistency option.ConsistencyConfig
}
type Runtime ¶
type Runtime struct {
FileSystem *core.FileSystem
Codec codec.Codec
Backend backend.Backend
// contains filtered or unexported fields
}
Runtime owns a local core, codec and resources it opened. Close drains the core before releasing codec, native DB and writer locks in reverse order.
func Open ¶
Open creates a complete local runtime. BackendConfig.Open opens only the object backend and does not perform this ownership or core construction.
func OpenWithCodec ¶
func OpenWithCodec(opts *Profile, primary codec.Codec, closeCodec func() error) (_ *Runtime, err error)
OpenWithCodec lets a server replace its new-write codec while keeping cache, staging, metadata and backend setup identical. Ownership of primary and closeCodec transfers to the returned runtime, including on setup errors. OpenWithCodec takes ownership of closeCodec immediately, including every early validation failure. Injected namespace resources remain borrowed.