commons

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2025 License: BSD-3-Clause Imports: 24 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ClientProgramName string = "irodsfs"
	FuseFSName        string = "irodsfs"

	IRODSEnvironmentFileEnvKey string = "IRODS_ENVIRONMENT_FILE"

	ReadAheadMaxDefault        int           = 1024 * 128      // 128KB
	ReadWriteMaxDefault        int           = 1 * 1024 * 1024 // 1MB
	FilesystemTimeout          time.Duration = 10 * time.Minute
	ConnectionMaxDefault       int           = 10
	TCPBufferSizeDefault       int           = 4 * 1024 * 1024 // 4MB
	TCPBufferSizeStringDefault string        = "4MB"
	ProfileServicePortDefault  int           = 11021
)

Variables

This section is empty.

Functions

func ExpandHomeDir added in v0.10.1

func ExpandHomeDir(p string) (string, error)

func Fprintf added in v0.10.3

func Fprintf(w io.Writer, format string, a ...any) (int, error)

func GetClientVersion

func GetClientVersion() string

GetClientVersion returns client version in string

func GetDefaultDataRootDirPath added in v0.8.0

func GetDefaultDataRootDirPath() string

GetDefaultDataRootDirPath returns default data root path

func GetDefaultIRODSConfigPath added in v0.10.1

func GetDefaultIRODSConfigPath() string

GetDefaultIRODSConfigPath returns default config path

func GetDefaultInstanceID added in v0.8.4

func GetDefaultInstanceID() string

GetDefaultInstanceID returns default instance id

func GetVersionJSON

func GetVersionJSON() (string, error)

GetVersionJSON returns VersionInfo object in JSON string

func GetVersionParts added in v0.10.1

func GetVersionParts(version string) (int, int, int)

GetVersionParts returns version parts (major, minor, patch)

func InitTerminalOutput added in v0.10.3

func InitTerminalOutput()

func Input added in v0.10.3

func Input(msg string) string

func InputInt added in v0.10.3

func InputInt(msg string) int

func InputPassword added in v0.10.3

func InputPassword(msg string) string

func InputYN added in v0.10.3

func InputYN(msg string) bool

InputYN inputs Y or N true for Y, false for N

func IsNewerVersion added in v0.10.1

func IsNewerVersion(ver1 []int, ver2 []int) bool

IsNewerVersion compares ver1 against ver2

func ParsePoolServiceEndpoint added in v0.7.3

func ParsePoolServiceEndpoint(endpoint string) (string, string, error)

ParsePoolServiceEndpoint parses endpoint string

func Print added in v0.10.3

func Print(a ...any) (n int, err error)

func PrintErrorf added in v0.10.3

func PrintErrorf(format string, a ...any) (int, error)

func PrintInfof added in v0.10.3

func PrintInfof(format string, a ...any) (n int, err error)

func PrintInfoln added in v0.10.3

func PrintInfoln(a ...any) (n int, err error)

func Printf added in v0.10.3

func Printf(format string, a ...any) (n int, err error)

func Println added in v0.10.3

func Println(a ...any) (n int, err error)

Types

type Config

type Config struct {
	irodsclient_config.Config

	PathMappings      []irodsfs_common_vpath.VPathMapping `json:"path_mappings,omitempty" yaml:"path_mappings,omitempty"`
	ReadAheadMax      int                                 `json:"read_ahead_max,omitempty" yaml:"read_ahead_max,omitempty"`
	ReadWriteMax      int                                 `json:"read_write_max,omitempty" yaml:"read_write_max,omitempty"`
	NoPermissionCheck bool                                `json:"no_permission_check,omitempty" yaml:"no_permission_check,omitempty"`
	NoSetXattr        bool                                `json:"no_set_xattr,omitempty" yaml:"no_set_xattr,omitempty"`
	UID               int                                 `json:"uid,omitempty" yaml:"uid,omitempty"`
	GID               int                                 `json:"gid,omitempty" yaml:"gid,omitempty"`
	SystemUser        string                              `json:"system_user,omitempty" yaml:"system_user,omitempty"`
	MountPath         string                              `json:"mount_path,omitempty" yaml:"mount_path,omitempty"`

	MetadataConnection irodsclient_fs.ConnectionConfig `json:"metadata_connection,omitempty" yaml:"metadata_connection,omitempty"`
	IOConnection       irodsclient_fs.ConnectionConfig `json:"io_connection,omitempty" yaml:"io_connection,omitempty"`
	Cache              irodsclient_fs.CacheConfig      `json:"cache,omitempty" yaml:"cache,omitempty"`

	DataRootPath string `json:"data_root_path,omitempty" yaml:"data_root_path,omitempty"`
	LogPath      string `json:"log_path,omitempty" yaml:"log_path,omitempty"`

	PoolEndpoint string `json:"pool_endpoint,omitempty" yaml:"pool_endpoint,omitempty"`

	Profile            bool `json:"profile,omitempty" yaml:"profile,omitempty"`
	ProfileServicePort int  `json:"profile_service_port,omitempty" yaml:"profile_service_port,omitempty"`

	Foreground      bool   `json:"foreground,omitempty" yaml:"foreground,omitempty"`
	LogLevel        string `json:"log_level,omitempty" yaml:"log_level,omitempty"`
	Debug           bool   `json:"debug,omitempty" yaml:"debug,omitempty"`
	AllowOther      bool   `json:"allow_other,omitempty" yaml:"allow_other,omitempty"`
	Readonly        bool   `json:"readonly,omitempty" yaml:"readonly,omitempty"`
	ChildProcess    bool   `json:"childprocess,omitempty" yaml:"childprocess,omitempty"`
	WatchdogProcess bool   `json:"watchdogprocess,omitempty" yaml:"watchdogprocess,omitempty"`
	WatchPID        int    `json:"watchpid,omitempty" yaml:"watchpid,omitempty"`

	InstanceID  string   `json:"instanceid,omitempty" yaml:"instanceid,omitempty"`
	FuseOptions []string `json:"fuse_options,omitempty" yaml:"fuse_options,omitempty"`
}

Config holds the parameters list which can be configured

func NewConfigFromFile added in v0.10.1

func NewConfigFromFile(config *Config, filePath string) (*Config, error)

NewConfigFromFile creates Config from file

func NewConfigFromICommandsEnvDir added in v0.10.1

func NewConfigFromICommandsEnvDir(config *Config, dirPath string) (*Config, error)

NewConfigFromICommandsEnvDir creates Config from icommands environment dir (e.g., ~/.irods)

func NewConfigFromJSONFile added in v0.10.1

func NewConfigFromJSONFile(config *Config, jsonPath string) (*Config, error)

NewConfigFromJSONFile creates Config from JSON

func NewConfigFromYAML

func NewConfigFromYAML(config *Config, yamlBytes []byte) (*Config, error)

NewConfigFromYAML creates Config from YAML

func NewConfigFromYAMLFile added in v0.10.1

func NewConfigFromYAMLFile(config *Config, yamlPath string) (*Config, error)

NewConfigFromYAMLFile creates Config from YAML

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig returns a default config

func (*Config) FixPathMappings added in v0.10.1

func (config *Config) FixPathMappings()

FixPathMappings fixes path mappings

func (*Config) FixSystemUserConfiguration added in v0.10.5

func (config *Config) FixSystemUserConfiguration() error

FixSystemUserConfiguration fixes system user configuration

func (*Config) FromIRODSUrl added in v0.10.1

func (config *Config) FromIRODSUrl(inputURL string) error

FromIRODSUrl reads info from inputURL and updates config

func (*Config) GetInstanceDataRootDirPath added in v0.8.0

func (config *Config) GetInstanceDataRootDirPath() string

func (*Config) GetLogFilePath added in v0.8.0

func (config *Config) GetLogFilePath() string

GetLogFilePath returns log file path

func (*Config) MakeLogDir added in v0.8.0

func (config *Config) MakeLogDir() error

MakeLogDir makes a log dir required

func (*Config) Validate

func (config *Config) Validate() error

Validate validates configuration

type IRODSAccessURL added in v0.10.1

type IRODSAccessURL struct {
	User     string
	Password string
	Host     string
	Port     int
	Zone     string
	Path     string
}

IRODSAccessURL is used to extract iRODS access information from iRODS Access URL (irods://host:port/zone/path)

func ParseIRODSUrl added in v0.10.1

func ParseIRODSUrl(inputURL string) (*IRODSAccessURL, error)

ParseIRODSUrl parses iRODS Access URL string and returns IRODSAccessURL struct

type TerminalWriter added in v0.10.3

type TerminalWriter struct {
	// contains filtered or unexported fields
}

func GetTerminalWriter added in v0.10.3

func GetTerminalWriter() *TerminalWriter

func (*TerminalWriter) Lock added in v0.10.3

func (writer *TerminalWriter) Lock()

func (*TerminalWriter) Unlock added in v0.10.3

func (writer *TerminalWriter) Unlock()

func (*TerminalWriter) Write added in v0.10.3

func (writer *TerminalWriter) Write(p []byte) (n int, err error)

type VersionInfo

type VersionInfo struct {
	ClientVersion string `json:"clientVersion"`
	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

func GetVersion

func GetVersion() VersionInfo

GetVersion returns VersionInfo object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳