Documentation
¶
Index ¶
- Constants
- Variables
- func GetServiceVersion() string
- func GetVersionJSON() (string, error)
- func ParseManagementServiceEndpoint(endpoint string) (string, error)
- func ParseServiceEndpoint(endpoint string) (string, string, error)
- type Config
- func NewConfigFromFile(config *Config, filePath string) (*Config, error)
- func NewConfigFromJSON(config *Config, jsonBytes []byte) (*Config, error)
- func NewConfigFromJSONFile(config *Config, jsonPath string) (*Config, error)
- func NewConfigFromYAML(config *Config, yamlBytes []byte) (*Config, error)
- func NewConfigFromYAMLFile(config *Config, yamlPath string) (*Config, error)
- func NewDefaultConfig() *Config
- func (config *Config) GetDataRootPath() string
- func (config *Config) GetLogFilePath() string
- func (config *Config) GetLogRootPath() string
- func (config *Config) GetLogWriter(foregroundProcess bool) (io.WriteCloser, error)
- func (config *Config) GetMountDatabasePath() string
- func (config *Config) GetMountLogPath(mountID string) string
- func (config *Config) GetMountRootPath() string
- func (config *Config) GetRecoveryEncryptionKey() ([]byte, error)
- func (config *Config) GetServiceEndpoint() string
- func (config *Config) MakeLogDir() error
- func (config *Config) MakeWorkDirs() error
- func (config *Config) Validate() error
- type DataFormat
- type Duration
- type MultiWriteCloser
- type RetryConfig
- type StacktraceTextFormatter
- type VersionInfo
Constants ¶
const ( IRODSFSExecutablePathDefault string = "/usr/local/bin/irodsfs" MountExecutablePathDefault string = "/usr/bin/mount" UnmountExecutablePathDefault string = "/usr/bin/umount" DataRootPathDefault string = "/var/lib/irodsfsd" PIDFilePathDefault string = "/run/irodsfsd/irodsfsd.pid" AllowedMountRootPathDefault string = "/mnt/irods" KubeletMountRootPathDefault string = "/var/lib/kubelet" MountRootPathDefault string = "mounts" MountDatabasePathDefault string = "db" RetryMaxAttemptsDefault int = 5 RetryInitialDelayDefault time.Duration = time.Second RetryMaxDelayDefault time.Duration = 30 * time.Second RetryMultiplierDefault float64 = 2 RetryJitterDefault float64 = 0.2 MountTimeoutDefault time.Duration = 30 * time.Second UnmountTimeoutDefault time.Duration = 15 * time.Second DAVFSUnmountTimeoutDefault time.Duration = 3 * time.Minute ReconcileIntervalDefault time.Duration = 10 * time.Second MaxConcurrentMountsDefault int = 40 RecoveryEncryptionKeySizeDefault int = 32 ManagementServiceEndpointDefault string = "http://0.0.0.0:13021" )
Variables ¶
var IRODSFSExecutablePathFallbacks = []string{"/usr/bin/irodsfs"}
IRODSFSExecutablePathFallbacks lists additional locations searched for the irodsfs binary when IRODSFSExecutablePath is left at IRODSFSExecutablePathDefault and that path doesn't exist. Different ways of installing irodsfs (this project's own installer vs. a distro package) place the binary in different standard locations; an explicitly configured non-default path is never second-guessed this way.
Functions ¶
func GetServiceVersion ¶
func GetServiceVersion() string
GetServiceVersion returns service version in string
func GetVersionJSON ¶
GetVersionJSON returns VersionInfo object in JSON string
func ParseManagementServiceEndpoint ¶ added in v0.1.3
ParseManagementServiceEndpoint validates an HTTP management endpoint and returns the address suitable for net/http's Server.Addr. An empty endpoint disables the management service.
Types ¶
type Config ¶
type Config struct {
ServiceEndpoint string `yaml:"service_endpoint,omitempty" json:"service_endpoint,omitempty"`
IRODSFSExecutablePath string `yaml:"irodsfs_executable_path,omitempty" json:"irodsfs_executable_path,omitempty"`
MountExecutablePath string `yaml:"mount_executable_path,omitempty" json:"mount_executable_path,omitempty"`
UnmountExecutablePath string `yaml:"unmount_executable_path,omitempty" json:"unmount_executable_path,omitempty"`
DataRootPath string `yaml:"data_root_path,omitempty" json:"data_root_path,omitempty"`
PIDFile string `yaml:"pid_file,omitempty" json:"pid_file,omitempty"`
RecoveryEncryptionKey string `yaml:"recovery_encryption_key,omitempty" json:"recovery_encryption_key,omitempty"`
AllowedMountRootPaths []string `yaml:"allowed_mount_root_paths,omitempty" json:"allowed_mount_root_paths,omitempty"`
// AllowFuseAllowOther is design.md's "daemon-wide policy" gate: a mount
// request may only ask for the FUSE allow_other option (irodsfs or
// DAVFS) when this is true. allow_other lets every local user on the
// host reach the mount, not just the irodsfsd service account that
// actually performed it, so it must be an explicit, host-level opt-in
// rather than something any mount request can request on its own.
AllowFuseAllowOther bool `yaml:"allow_fuse_allow_other,omitempty" json:"allow_fuse_allow_other,omitempty"`
// AutoRemount controls whether a mount which has already become mounted is
// retried after a later mount-process failure. Initial mount failures still
// use Retry regardless of this setting.
AutoRemount bool `yaml:"auto_remount,omitempty" json:"auto_remount,omitempty"`
// RestoreMountsOnRestart controls whether ordinary persisted mounts are
// restored while the daemon is starting. Unmount tombstones are always
// reconciled so an accepted unmount can finish safely.
RestoreMountsOnRestart bool `yaml:"restore_mounts_on_restart,omitempty" json:"restore_mounts_on_restart,omitempty"`
Retry RetryConfig `yaml:"retry,omitempty" json:"retry,omitempty"`
MountTimeout Duration `yaml:"mount_timeout,omitempty" json:"mount_timeout,omitempty"`
UnmountTimeout Duration `yaml:"unmount_timeout,omitempty" json:"unmount_timeout,omitempty"`
DAVFSUnmountTimeout Duration `yaml:"davfs_unmount_timeout,omitempty" json:"davfs_unmount_timeout,omitempty"`
ReconcileInterval Duration `yaml:"reconcile_interval,omitempty" json:"reconcile_interval,omitempty"`
MaxConcurrentMounts int `yaml:"max_concurrent_mounts,omitempty" json:"max_concurrent_mounts,omitempty"`
// ManagementServiceEndpoint is the HTTP address on which the management
// REST API listens. A missing scheme is treated as HTTP; an empty value
// disables the management REST API.
ManagementServiceEndpoint string `yaml:"management_service_endpoint,omitempty" json:"management_service_endpoint,omitempty"`
Debug bool `yaml:"debug,omitempty" json:"debug,omitempty"`
LogRootPath string `yaml:"log_root_path,omitempty" json:"log_root_path,omitempty"`
MountRootPath string `yaml:"mount_root_path,omitempty" json:"mount_root_path,omitempty"`
}
Config holds the parameters list which can be configured
func NewConfigFromFile ¶
NewConfigFromFile creates Config from file
func NewConfigFromJSON ¶
NewConfigFromJSON creates Config from JSON
func NewConfigFromJSONFile ¶
NewConfigFromJSONFile creates Config from JSON
func NewConfigFromYAML ¶
NewConfigFromYAML creates Config from YAML
func NewConfigFromYAMLFile ¶
NewConfigFromYAMLFile creates Config from YAML
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
func (*Config) GetDataRootPath ¶
func (*Config) GetLogFilePath ¶
GetLogFilePath returns the daemon stdout/stderr log file path.
func (*Config) GetLogRootPath ¶
GetLogRootPath returns the directory containing service and session logs.
func (*Config) GetLogWriter ¶
func (config *Config) GetLogWriter(foregroundProcess bool) (io.WriteCloser, error)
func (*Config) GetMountDatabasePath ¶
GetMountDatabasePath returns the directory holding the embedded mount database that persists mount intent across daemon restarts.
func (*Config) GetMountLogPath ¶
GetMountLogPath returns the log file path for one mount's child stdout/stderr, stable across daemon restarts and mount retries so its history remains queryable.
func (*Config) GetMountRootPath ¶
GetMountRootPath returns the parent directory for managed irodsfs data roots.
func (*Config) GetRecoveryEncryptionKey ¶
GetRecoveryEncryptionKey decodes the configured 256-bit Badger encryption key.
func (*Config) GetServiceEndpoint ¶
func (*Config) MakeLogDir ¶
MakeLogDir makes a log dir required
func (*Config) MakeWorkDirs ¶
MakeWorkDirs makes dirs required
type DataFormat ¶
type DataFormat string
const ( FormatJSON DataFormat = "JSON" FormatYAML DataFormat = "YAML" FormatUnknown DataFormat = "Unknown" )
type Duration ¶
Duration is a replacement of time.Duration that supports JSON
func (*Duration) UnmarshalYAML ¶
UnmarshalYAML ...
type MultiWriteCloser ¶
type MultiWriteCloser struct {
// contains filtered or unexported fields
}
MultiWriteCloser writes to multiple writers and closes the ones that implement io.Closer.
func NewMultiWriteCloser ¶
func NewMultiWriteCloser(writers ...io.Writer) *MultiWriteCloser
func (*MultiWriteCloser) Close ¶
func (mw *MultiWriteCloser) Close() error
type RetryConfig ¶
type RetryConfig struct {
MaxAttempts int `yaml:"max_attempts,omitempty" json:"max_attempts,omitempty"`
InitialDelay Duration `yaml:"initial_delay,omitempty" json:"initial_delay,omitempty"`
MaxDelay Duration `yaml:"max_delay,omitempty" json:"max_delay,omitempty"`
Multiplier float64 `yaml:"multiplier,omitempty" json:"multiplier,omitempty"`
Jitter float64 `yaml:"jitter,omitempty" json:"jitter,omitempty"`
}
type StacktraceTextFormatter ¶
type StacktraceTextFormatter struct {
TextFormatter log.TextFormatter
}
type VersionInfo ¶
type VersionInfo struct {
ServiceVersion string `json:"serviceVersion"`
GitCommit string `json:"gitCommit"`
BuildDate string `json:"buildDate"`
GoVersion string `json:"goVersion"`
Compiler string `json:"compiler"`
Platform string `json:"platform"`
}
VersionInfo object contains version related info