commons

package
v0.5.9 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataCacheSizeMaxDefault        int64  = 1024 * 1024 * 1024 * 20 // 20GB
	DataCacheRootPathPrefixDefault string = "/tmp/irodsfs_pool_cache"
	LogFilePathPrefixDefault       string = "/tmp/irodsfs_pool"
	TempRootPathPrefixDefault      string = "/tmp/irodsfs_pool_temp"
	ServiceEndpointDefault         string = "unix:///tmp/irodsfs_pool_comm.sock"
	ProfileServicePortDefault      int    = 12021
)

Variables

This section is empty.

Functions

func GetDefaultDataCacheRootPath

func GetDefaultDataCacheRootPath() string

GetDefaultDataCacheRootPath returns default data cache root path

func GetDefaultLogFilePath

func GetDefaultLogFilePath() string

GetDefaultLogFilePath returns default log file path

func GetDefaultTempRootPath added in v0.5.0

func GetDefaultTempRootPath() string

GetDefaultTempRootPath returns default temp root path

func GetServiceVersion

func GetServiceVersion() string

GetServiceVersion returns service version in string

func GetVersionJSON

func GetVersionJSON() (string, error)

GetVersionJSON returns VersionInfo object in JSON string

func ParsePoolServiceEndpoint added in v0.5.6

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

ParsePoolServiceEndpoint parses endpoint string

Types

type Config

type Config struct {
	ServiceEndpoint      string                        `yaml:"service_endpoint"`
	DataCacheSizeMax     int64                         `yaml:"data_cache_size_max"`
	DataCacheRootPath    string                        `yaml:"data_cache_root_path"`
	TempRootPath         string                        `yaml:"temp_root_path"`
	CacheTimeoutSettings []MetadataCacheTimeoutSetting `yaml:"cache_timeout_settings,omitempty"`

	LogPath string `yaml:"log_path,omitempty"`

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

	Foreground   bool `yaml:"foreground,omitempty"`
	Debug        bool `yaml:"debug,omitempty"`
	ChildProcess bool `yaml:"childprocess,omitempty"`

	InstanceID string `yaml:"instanceid,omitempty"`
}

Config holds the parameters list which can be configured

func NewConfigFromYAML

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

NewConfigFromYAML creates Config from YAML

func NewDefaultConfig

func NewDefaultConfig() *Config

NewDefaultConfig creates DefaultConfig

func (*Config) MakeTempRootDir added in v0.5.1

func (config *Config) MakeTempRootDir() error

MakeTempRootDir makes temp root dir

func (*Config) RemoveTempRootDir added in v0.5.1

func (config *Config) RemoveTempRootDir() error

RemoveTempRootDir removes temp root dir

func (*Config) Validate

func (config *Config) Validate() error

Validate validates configuration

type MetadataCacheTimeoutSetting added in v0.2.1

type MetadataCacheTimeoutSetting struct {
	Path    string                        `yaml:"path" json:"path"`
	Timeout irodsfs_common_utils.Duration `yaml:"timeout" json:"timeout"`
	Inherit bool                          `yaml:"inherit,omitempty" json:"inherit,omitempty"`
}

MetadataCacheTimeoutSetting defines cache timeout for path

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

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