data

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	ConfigDataVersion = "1.0.0"
)

ConfigDataVersion represents the version of the configuration data format

Variables

This section is empty.

Functions

func ConfigDataExists

func ConfigDataExists(rootFS billy.Filesystem) bool

ConfigDataExists checks if a data config file exists

func SaveDataConfig

func SaveDataConfig(rootFS billy.Filesystem, config *ConfigData) error

SaveDataConfig saves the data config to .dirio/config.json

Types

type CompressionConfig

type CompressionConfig struct {
	// Enabled controls whether server-side compression is active
	Enabled bool `json:"enabled"`

	// AllowEncryption allows compression of encrypted objects
	AllowEncryption bool `json:"allowEncryption"`

	// Extensions lists file extensions that should be compressed (e.g., [".txt", ".log", ".json"])
	Extensions []string `json:"extensions,omitempty"`

	// MIMETypes lists MIME types that should be compressed (e.g., ["text/*", "application/json"])
	MIMETypes []string `json:"mimeTypes,omitempty"`
}

CompressionConfig defines compression behavior

type ConfigData

type ConfigData struct {
	// Version of this config format for future migrations
	Version string `json:"version"`

	InstanceID uuid.UUID `json:"instance_id"`

	// Root credentials for this data directory
	Credentials CredentialsConfig `json:"credentials"`

	// Region is the geographic/logical region for this data
	Region string `json:"region,omitempty"`

	// Compression settings control how data is stored
	Compression CompressionConfig `json:"compression"`

	// StorageClass defines storage tier configuration
	StorageClass StorageClassConfig `json:"storageClass"`

	// Metadata timestamps
	CreatedAt time.Time `json:"createdAt"`
	UpdatedAt time.Time `json:"updatedAt"`
}

ConfigData represents configuration stored in the data directory (.dirio/config.json) These settings control how DirIO must behave when working with this specific data directory. Unlike application config (CLI flags), these settings travel with the data and take precedence.

func DefaultDataConfig

func DefaultDataConfig() *ConfigData

DefaultDataConfig returns a ConfigData with sensible defaults. Credentials are intentionally left empty — set them explicitly via "dirio init" or "dirio credentials set" rather than baking in defaults.

func LoadDataConfig

func LoadDataConfig(rootFS billy.Filesystem) (*ConfigData, error)

LoadDataConfig loads the data config from .dirio/config.json

func (*ConfigData) Validate

func (dc *ConfigData) Validate() error

Validate checks if the ConfigData is valid. Credentials are optional — either both fields must be set, or neither.

type CredentialsConfig

type CredentialsConfig struct {
	AccessKey string `json:"accessKey,omitempty"`
	SecretKey string `json:"secretKey,omitempty"`
}

CredentialsConfig contains root access credentials for this data directory. Both fields are optional — an unconfigured CredentialsConfig means the server falls back to CLI/env credentials. Use "dirio init" or "dirio credentials set" to configure them explicitly.

func (CredentialsConfig) IsConfigured

func (c CredentialsConfig) IsConfigured() bool

IsConfigured reports whether both access key and secret key are set.

type StorageClassConfig

type StorageClassConfig struct {
	// Standard storage class configuration
	Standard string `json:"standard,omitempty"`

	// RRS (Reduced Redundancy Storage) configuration
	RRS string `json:"rrs,omitempty"`
}

StorageClassConfig defines storage tier settings

Jump to

Keyboard shortcuts

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