format and function visibility fixed

This commit is contained in:
Philipp Häfelfinger 2019-02-24 01:17:10 +01:00
parent 4721c762f1
commit ff00ca9f0a
2 changed files with 18 additions and 18 deletions

View File

@ -7,7 +7,7 @@ import (
)
func Run(rootPath string) {
context := ConfigureContext(rootPath)
context := configureContext(rootPath)
loginToPiwigoAndConfigureContext(context)
@ -22,22 +22,6 @@ func Run(rootPath string) {
authentication.Logout(context.Piwigo)
}
func ConfigureContext(rootPath string) *AppContext {
logrus.Infoln("Preparing application context and configuration")
context := new(AppContext)
context.LocalRootPath = rootPath
context.Piwigo = new(authentication.PiwigoContext)
//TODO: Move this values to configuration files
//No, these are not real credentials :-P
context.Piwigo.Url = "http://pictures.haefelfinger.net/ws.php?format=json"
context.Piwigo.Username = "admin"
context.Piwigo.Password = "asdf"
return context
}
func ScanLocalDirectories(context *AppContext) {
var fileNodes map[string]localFileStructure.FilesystemNode = localFileStructure.ScanLocalFileStructure(context.LocalRootPath)
for _, node := range fileNodes {
@ -67,6 +51,22 @@ func UploadImages() {
logrus.Warnln("Uploading missing images (NotImplemented)")
}
func configureContext(rootPath string) *AppContext {
logrus.Infoln("Preparing application context and configuration")
context := new(AppContext)
context.LocalRootPath = rootPath
context.Piwigo = new(authentication.PiwigoContext)
//TODO: Move this values to configuration files
//No, these are not real credentials :-P
context.Piwigo.Url = "http://pictures.haefelfinger.net/ws.php?format=json"
context.Piwigo.Username = "admin"
context.Piwigo.Password = "asdf"
return context
}
func loginToPiwigoAndConfigureContext(context *AppContext) {
logrus.Infoln("Logging in to piwigo and getting chunk size configuration for uploads")
authentication.Login(context.Piwigo)

View File

@ -14,7 +14,7 @@ func Login(context *PiwigoContext) {
logrus.Debugf("Logging in to %s using user %s", context.Url, context.Username)
if !strings.HasPrefix(context.Url,"https") {
if !strings.HasPrefix(context.Url, "https") {
logrus.Warnf("The server url %s does not use https! Credentials are not encrypted!", context.Url)
}