commons

package
v0.0.0-...-737feb0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServicePortDefault        int    = 8080
	IrodsPortDefault          int    = 1247
	IrodsSharedDirnameDefault string = "public"
)

Variables

This section is empty.

Functions

func GetDefaultDataRootDirPath

func GetDefaultDataRootDirPath() string

func GetServiceVersion

func GetServiceVersion() string

GetServiceVersion returns service version in string

func GetVersionJSON

func GetVersionJSON() (string, error)

GetVersionJSON returns VersionInfo object in JSON string

Types

type Config

type Config struct {
	Port         int    `yaml:"port"`
	DataRootPath string `yaml:"data_root_path,omitempty"`

	LogPath string `yaml:"log_path,omitempty"`

	IrodsHost          string `yaml:"irods_host"`
	IrodsPort          int    `yaml:"irods_port"`
	IrodsAdminUsername string `yaml:"irods_admin_username"`
	IrodsAdminPassword string `yaml:"irods_admin_password"`

	IrodsSharedDirname string `yaml:"irods_shared_dirname,omitempty"`

	Foreground   bool `yaml:"foreground,omitempty"`
	Debug        bool `yaml:"debug,omitempty"`
	ChildProcess bool `yaml:"childprocess,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 returns a default config

func (*Config) CleanWorkDirs

func (config *Config) CleanWorkDirs() error

CleanWorkDirs cleans dirs used

func (*Config) GetLogFilePath

func (config *Config) GetLogFilePath() string

GetLogFilePath returns log file path

func (*Config) MakeLogDir

func (config *Config) MakeLogDir() error

MakeLogDir makes a log dir required

func (*Config) MakeWorkDirs

func (config *Config) MakeWorkDirs() error

MakeWorkDirs makes dirs required

func (*Config) Validate

func (config *Config) Validate() error

Validate validates configuration

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