commons

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultLogPath

func GetDefaultLogPath() string

func GetReleaseVersion

func GetReleaseVersion() string

GetReleaseVersion returns release version in string

func GetVersionJSON

func GetVersionJSON() (string, error)

GetVersionJSON returns VersionInfo object in JSON string

func SetLog

func SetLog(logDir string)

Types

type Config

type Config struct {
	// for public key auth
	IRODSProxyUsername string `envconfig:"IRODS_PROXY_USER"`
	IRODSProxyPassword string `envconfig:"IRODS_PROXY_PASSWORD"`

	// for iRODS auth
	IRODSHost string `envconfig:"IRODS_HOST"`
	IRODSPort int    `envconfig:"IRODS_PORT"`
	IRODSZone string `envconfig:"IRODS_ZONE"`
	// IRODSAuthScheme should be one of ['native','pam','pam_for_users']
	IRODSAuthScheme           string `envconfig:"IRODS_AUTH_SCHEME"`
	IRODSRequireCSNegotiation bool   `envconfig:"IRODS_REQUIRE_CS_NEGOTIATION"`
	// IRODSCSNegotiationPolicy should be one of ['CS_NEG_REFUSE','CS_NEG_REQUIRE','CS_NEG_DONT_CARE']
	IRODSCSNegotiationPolicy string `envconfig:"IRODS_CS_NEGOTIATION_POLICY"`

	// for SSL/PAM auth
	IRODSSSLCACertificatePath string `envconfig:"IRODS_SSL_CA_CERT_PATH"`
	IRODSSSLAlgorithm         string `envconfig:"IRODS_SSL_ALGORITHM"`
	IRODSSSLKeySize           int    `envconfig:"IRODS_SSL_KEY_SIZE"`
	IRODSSSLSaltSize          int    `envconfig:"IRODS_SSL_SALT_SIZE"`
	IRODSSSLHashRounds        int    `envconfig:"IRODS_SSL_HASH_ROUNDS"`

	// for fs mount
	IRODSShared   string `envconfig:"IRODS_SHARED"`
	SFTPGoHomeDir string `envconfig:"SFTPGO_HOME_PATH"`

	// SFTP args
	SFTPGoAuthdUsername  string `envconfig:"SFTPGO_AUTHD_USERNAME"`
	SFTPGoAuthdPassword  string `envconfig:"SFTPGO_AUTHD_PASSWORD"`
	SFTPGoAuthdPublickey string `envconfig:"SFTPGO_AUTHD_PUBLIC_KEY"`
	SFTPGoAuthdIP        string `envconfig:"SFTPGO_AUTHD_IP"`

	// for Logging
	SFTPGoLogDir string `envconfig:"SFTPGO_LOG_DIR"`
}

Config is a configuration struct

func ReadFromEnv

func ReadFromEnv() (*Config, error)

func (*Config) GetHomeDirPath added in v0.1.7

func (config *Config) GetHomeDirPath() string

GetSharedDirName returns shared dir's name

func (*Config) GetSharedDirName

func (config *Config) GetSharedDirName() string

GetSharedDirName returns shared dir's name

func (*Config) HasSharedDir

func (config *Config) HasSharedDir() bool

HasSharedDir checks if shared dir is provided

func (*Config) IsAnonymousUser

func (config *Config) IsAnonymousUser() bool

IsAnonymousUser checks if the user is anonymous

func (*Config) IsProxyAuth added in v0.1.10

func (config *Config) IsProxyAuth() bool

IsProxyAuth checks if it uses proxy auth

func (*Config) IsPublicKeyAuth

func (config *Config) IsPublicKeyAuth() bool

IsPublicKeyAuth checks if the auth mode is public key auth

func (*Config) Validate

func (config *Config) Validate() error

Validate validates field values and returns error if occurs

func (*Config) ValidateForPublicKeyAuth

func (config *Config) ValidateForPublicKeyAuth() error

ValidateForPublicKeyAuth validates field values and returns error if occurs

type VersionInfo

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