Problem
Reference to logger needs to set one in instance. Keeping out a logger is not possible.
Solution
- According to seperation of concerns logger removed from module
Issue
Problem
To implement logging using a module (like logrus) the functions must be implemented either in main.go or in dovecot using exactly the choosen module.
Using an other module later would be a huge effort for refactoring
Solution
To be able to use any logging api you want logging is implemented as callbacks including seperate functions for
- Info
- Error
- Warn
- Fatal
Need to implement on every function of godovecot, but first a template must be created
Issue
Problem
Public fields would allow changes on created field values by constructor
Solution
Set fields of server struct to priavte and implemented custom json.MarshalJSON and custom json.UnmarshalJSON functions
Issue
closes#19
Problem
Should not use password for ssh authentication
Solution
Using openssh rsa private key file and knownhosts file to authenticate instead of password
- Added internal function getSSHConfig() (*ssh.ClientConfig, error) to provide ssh configuration for all functions acting with the server over ssh
- Changed all functions to get ssh.ClientConfiguration using function getSSHConfig() (*ssh.ClientConfig, error)
Note
Need to add paths to id_rsa and knownhosts to cnfiguration
Issue
Problem
Having only some functions allocated to a pointer to Server struct creates a copy of struct during runtime calling the variable-allocated functions
Solution
Changed all functions to pointer allocation
Issue
close#12
Problem
Functions were assigned to the server struct variable, so a copy struct was generated
Solution
SynchroniseMail() and BackupAccounts() functions are allocated to *Server instead of Server - Pointer allocation
Issue
resolve#12