Documentation
¶
Overview ¶
Package file provides filesystem persistence implementations.
Index ¶
- func LicenseDir(cfg *config.Config) string
- func NewDAGRepository(cfg *config.Config, opts ...DAGRepositoryOption) (*persis.DAGRepository, error)
- func NewDAGRunRepository(cfg *config.Config, opts ...DAGRunRepositoryOption) *persis.DAGRunRepository
- func NewDAGSettingsStore(cfg *config.Config, col persis.Collection) (dagsettings.Store, error)
- func NewIncidentStore(col persis.Collection, enc *crypto.Encryptor) (incident.Store, error)
- func NewLicenseStore(ctx context.Context, col persis.Collection) license.ActivationStore
- func NewNotificationStore(col persis.Collection, enc *crypto.Encryptor) (notification.Store, error)
- func NewProcRepository(cfg *config.Config, opts ...procstore.StoreOption) *persis.ProcRepository
- func NewProfileStore(ctx context.Context, cfg *config.Config, col persis.Collection) profile.Store
- func NewSecretStore(ctx context.Context, cfg *config.Config, col persis.Collection) secret.Store
- func NewServiceRegistry(cfg *config.Config) serviceregistry.ServiceRegistry
- func NewUpgradeCheckStore(cfg *config.Config, col persis.Collection) (upgrade.CacheStore, error)
- type Backend
- type Collection
- func (c *Collection) CompareAndDelete(ctx context.Context, expected *persis.Record) error
- func (c *Collection) CompareAndSwap(ctx context.Context, id string, expected, next []byte) error
- func (c *Collection) Create(ctx context.Context, rec *persis.Record) error
- func (c *Collection) Delete(ctx context.Context, id string) error
- func (c *Collection) Get(_ context.Context, id string) (*persis.Record, error)
- func (c *Collection) List(_ context.Context, q persis.ListQuery) (*persis.Page, error)
- func (c *Collection) Put(ctx context.Context, rec *persis.Record) error
- func (c *Collection) RecordIDs(_ context.Context, prefix string) ([]string, error)
- func (c *Collection) RecordVersion(_ context.Context, id string) (string, error)
- func (c *Collection) RemoveCorrupt(ctx context.Context, id string, staleBefore time.Time) (bool, error)
- type CollectionOption
- type DAGRepositoryOption
- func WithDAGFileCache(cache *fileutil.Cache[*ir.DAG]) DAGRepositoryOption
- func WithDAGSearchPaths(paths []string) DAGRepositoryOption
- func WithDAGSkipDirectoryCreation(skip bool) DAGRepositoryOption
- func WithDAGSkipExamples(skip bool) DAGRepositoryOption
- func WithDAGSymlinks(enabled bool) DAGRepositoryOption
- type DAGRepositoryOptions
- type DAGRunRepositoryOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LicenseDir ¶
func NewDAGRepository ¶ added in v2.14.0
func NewDAGRepository(cfg *config.Config, opts ...DAGRepositoryOption) (*persis.DAGRepository, error)
NewDAGRepository connects the file-backed definition store to the shared repository.
func NewDAGRunRepository ¶ added in v2.14.0
func NewDAGRunRepository(cfg *config.Config, opts ...DAGRunRepositoryOption) *persis.DAGRunRepository
NewDAGRunRepository connects file storage to the shared DAG-run repository.
func NewDAGSettingsStore ¶
func NewDAGSettingsStore(cfg *config.Config, col persis.Collection) (dagsettings.Store, error)
func NewIncidentStore ¶
NewIncidentStore creates an incident store backed by col.
func NewLicenseStore ¶
func NewLicenseStore(ctx context.Context, col persis.Collection) license.ActivationStore
func NewNotificationStore ¶
func NewNotificationStore(col persis.Collection, enc *crypto.Encryptor) (notification.Store, error)
NewNotificationStore creates a notification store backed by col.
func NewProcRepository ¶ added in v2.14.0
func NewProcRepository(cfg *config.Config, opts ...procstore.StoreOption) *persis.ProcRepository
NewProcRepository connects the released .proc file layout to the shared repository.
func NewProfileStore ¶
NewProfileStore wires the file-backed runtime profile store from config paths.
func NewSecretStore ¶
NewSecretStore wires the encrypted file-backed secret store from config paths.
func NewServiceRegistry ¶
func NewServiceRegistry(cfg *config.Config) serviceregistry.ServiceRegistry
NewServiceRegistry wires the file-backed service registry from application config.
func NewUpgradeCheckStore ¶
func NewUpgradeCheckStore(cfg *config.Config, col persis.Collection) (upgrade.CacheStore, error)
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend maps logical control-plane collections to the released file layout.
func NewBackend ¶ added in v2.14.0
func NewBackend(paths config.PathsConfig) *Backend
NewBackend creates a file backend from the configured persistence paths. It does not access the filesystem; collections create directories lazily.
func (*Backend) Collection ¶
func (b *Backend) Collection(name string) persis.Collection
Collection returns the collection identified by name.
type Collection ¶
type Collection struct {
// contains filtered or unexported fields
}
Collection implements persis.Collection as a directory of JSON files. "/" in record IDs maps to the OS path separator, so hierarchical IDs become nested subdirectories on disk.
func NewCollection ¶
func NewCollection(dir string, opts ...CollectionOption) *Collection
NewCollection creates a collection backed by dir. The directory is created lazily on the first write.
func (*Collection) CompareAndDelete ¶
CompareAndDelete removes expected.ID only when the current record still matches expected.
func (*Collection) CompareAndSwap ¶
CompareAndSwap atomically replaces the record's Data only when the current Data equals expected. Returns persis.ErrConflict on mismatch.
func (*Collection) Create ¶
Create atomically inserts rec. Returns persis.ErrConflict when a record with rec.ID already exists.
func (*Collection) RecordIDs ¶
RecordIDs returns record IDs matching prefix without decoding record payloads.
func (*Collection) RecordVersion ¶
RecordVersion returns a cheap version token for cache validation.
func (*Collection) RemoveCorrupt ¶
func (c *Collection) RemoveCorrupt(ctx context.Context, id string, staleBefore time.Time) (bool, error)
RemoveCorrupt removes id only when its file is invalid JSON. A non-zero staleBefore restricts removal to files last modified at or before that time.
type CollectionOption ¶
type CollectionOption func(*Collection)
CollectionOption configures a file-backed Collection.
func WithIndentedJSON ¶
func WithIndentedJSON() CollectionOption
WithIndentedJSON stores records as two-space indented JSON on disk.
type DAGRepositoryOption ¶ added in v2.14.0
type DAGRepositoryOption func(*DAGRepositoryOptions)
DAGRepositoryOption configures the file-backed DAG repository.
func WithDAGFileCache ¶
func WithDAGFileCache(cache *fileutil.Cache[*ir.DAG]) DAGRepositoryOption
WithDAGFileCache sets the cache used for loading DAG definitions.
func WithDAGSearchPaths ¶
func WithDAGSearchPaths(paths []string) DAGRepositoryOption
WithDAGSearchPaths sets additional directories used to resolve DAG definitions.
func WithDAGSkipDirectoryCreation ¶
func WithDAGSkipDirectoryCreation(skip bool) DAGRepositoryOption
WithDAGSkipDirectoryCreation controls whether the DAG directory is created on startup.
func WithDAGSkipExamples ¶
func WithDAGSkipExamples(skip bool) DAGRepositoryOption
WithDAGSkipExamples controls whether example DAG files are created.
func WithDAGSymlinks ¶ added in v2.13.0
func WithDAGSymlinks(enabled bool) DAGRepositoryOption
WithDAGSymlinks includes file symlinks in recursive discovery and permits external targets.
type DAGRepositoryOptions ¶ added in v2.14.0
type DAGRepositoryOptions struct {
Cache *fileutil.Cache[*ir.DAG]
SearchPaths []string
SkipExamples *bool
Symlinks bool
SkipDirectoryCreation bool
}
DAGRepositoryOptions contains file-backed DAG repository settings.
type DAGRunRepositoryOption ¶ added in v2.14.0
type DAGRunRepositoryOption func(*dagRunRepositoryOptions)
DAGRunRepositoryOption configures the file-backed DAG-run repository.
func WithDAGRunHistoryFileCache ¶
func WithDAGRunHistoryFileCache(cache *fileutil.Cache[*ir.DAGRunStatus]) DAGRunRepositoryOption
WithDAGRunHistoryFileCache sets the cache used for reading DAG-run history files.
func WithDAGRunLatestStatusToday ¶
func WithDAGRunLatestStatusToday(latestStatusToday bool) DAGRunRepositoryOption
WithDAGRunLatestStatusToday controls whether latest status lookups are limited to today.
func WithDAGRunRemovalEnqueuer ¶ added in v2.14.0
func WithDAGRunRemovalEnqueuer(enqueuer persis.DAGRunRemovalEnqueuer) DAGRunRepositoryOption
WithDAGRunRemovalEnqueuer records provider resources before DAG-run removal.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package audit provides a file-based implementation of the audit Store interface.
|
Package audit provides a file-based implementation of the audit Store interface. |
|
Package eventstore provides a file-based implementation of the event store.
|
Package eventstore provides a file-based implementation of the event store. |