Documentation ¶
Index ¶
- Constants
- func AddLogger(logger io.Writer, shortLog bool)
- func CleanPath(path string) (absolutePath string, err error)
- func ConfigureLogging(loggingLevel zerolog.Level, shortLog bool, loggersIn ...io.Writer)
- func IsSubdir(rootDir, subdir string) bool
- func LogError(err error, message string)
- func LogErrorStack(err error, message string)
- type ClientConfig
- type DirectoryDecoder
- type LogFileDecoder
- type ServerConfig
- type ServerConnectionConfig
- type WatchedDirectory
Constants ¶
const ( // DefaultAddress for a server DefaultAddress string = "localhost" // DefaultPort for a server DefaultPort uint64 = 9650 )
const DefaultBlockSize = 1024
DefaultBlockSize is the minimal block that is transferred to the server
Variables ¶
This section is empty.
Functions ¶
func AddLogger ¶
AddLogger adds a new logger to the application and logs to all active loggers ConfigureLogging must be called prior to this call
func CleanPath ¶
CleanPath takes a directory path and evaluates symlinks, takes the absolute path, and adds path separators based on the OS
func ConfigureLogging ¶
ConfigureLogging configures all the log related settings for the application
func LogErrorStack ¶
LogErrorStack wrapper around logging an error with the current stack
Types ¶
type ClientConfig ¶
type ClientConfig struct { Servers []ServerConnectionConfig `json:"Servers"` WatchedDirectories []WatchedDirectory `json:"WatchedDirectories"` DeleteOnComplete bool `json:"DeleteFileOnComplete"` }
ClientConfig json representation
type DirectoryDecoder ¶
DirectoryDecoder decodes a directory from json
func (*DirectoryDecoder) Decode ¶
func (d *DirectoryDecoder) Decode(value string) error
Decode take a file name and uses it as the filepath
type LogFileDecoder ¶
LogFileDecoder wraps a writer and writes to it
func (*LogFileDecoder) Decode ¶
func (d *LogFileDecoder) Decode(value string) error
Decode takes a file name and opens it as the log file
type ServerConfig ¶
type ServerConfig struct { Debug bool `envconfig:"DEBUG" default:"true"` Address string `envconfig:"ADDRESS" default:"localhost" json:"Address"` Port uint32 `envconfig:"PORT" default:"9650" json:"Port"` Logfile LogFileDecoder `envconfig:"LOGFILE" default:""` SaveDir DirectoryDecoder `envconfig:"MEDIADIR" default:"."` }
ServerConfig describes all the environment specific details for running the server
type ServerConnectionConfig ¶
type ServerConnectionConfig struct { Address string `json:"Address"` Port uint32 `json:"Port"` UseTLS bool `json:"Secure"` CertFile string `json:"CertFile"` OAuthFile string `json:"OAuthFile"` }
ServerConnectionConfig json representation
type WatchedDirectory ¶
type WatchedDirectory struct { Directory string `json:"Directory"` MediaRoot string `json:"MediaRoot"` }
WatchedDirectory json representation