Documentation
¶
Overview ¶
Package config provides functions for setting the initial values of server parameters.
Index ¶
Constants ¶
const LogLevelVariable string = "LOG_LEVEL"
The name of the environment variable for the log level. Allowed values are from 0 to 6. See package "go_multi_log": https://pkg.go.dev/github.com/takecontrolsoft/go_multi_log/logger/levels#LogLevel
const LogPathVariable string = "LOG_PATH"
The name of the environment variable with the path for log files. This value should point to the directory where the log files to be stored. Absolute path is required in DOS or UNC format. Make sure the server process has read/write access to this location.
const MaxUploadFileSize int64 = 5 * 1024 * 1024 * 1024
The maximum stream size that is allowed to be uploaded to the server. The size is set to maximum 5GB.
const PortVariable = "SYNC_SERVER_PORT"
The name of the environment variable with TCP port number on witch the server can be reached.
const UploadPathVariable string = "SYNC_STORAGE_PATH"
The name of the environment variable with the storage path. This value should point to the directory where the uploaded files to be stored. Absolute path is required in DOS or UNC format. Make sure the server process has read/write access to this location.
Variables ¶
var ErrStoragePathEmpty = errors.Errorf("Storage path is empty.")
An error for empty storage path.
var LogLevel levels.LogLevel
Global variable for log level
var LogPath string
Global variable for log directory path
var PortNumber int
Global variable for port number
var UploadDirectory string
Global variable for storage directory path
Functions ¶
func ErrEnvVariableNotSet ¶
An error for not set value for an environment variable that is needed to run the sync server.
func ErrEnvVariableSetEmpty ¶
An error for empty value for an environment variable that is needed to run the sync server.
func InitFromEnvVariables ¶
func InitFromEnvVariables()
Initialize the variables UploadDirectory, PortNumber, LogPath and LogLevel from the environment variables UploadPathVariable, PortVariable, LogPathVariable and LogLevelVariable.
Types ¶
This section is empty.