format and function visibility fixed
This commit is contained in:
parent
4721c762f1
commit
ff00ca9f0a
@ -7,7 +7,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Run(rootPath string) {
|
func Run(rootPath string) {
|
||||||
context := ConfigureContext(rootPath)
|
context := configureContext(rootPath)
|
||||||
|
|
||||||
loginToPiwigoAndConfigureContext(context)
|
loginToPiwigoAndConfigureContext(context)
|
||||||
|
|
||||||
@ -22,22 +22,6 @@ func Run(rootPath string) {
|
|||||||
authentication.Logout(context.Piwigo)
|
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) {
|
func ScanLocalDirectories(context *AppContext) {
|
||||||
var fileNodes map[string]localFileStructure.FilesystemNode = localFileStructure.ScanLocalFileStructure(context.LocalRootPath)
|
var fileNodes map[string]localFileStructure.FilesystemNode = localFileStructure.ScanLocalFileStructure(context.LocalRootPath)
|
||||||
for _, node := range fileNodes {
|
for _, node := range fileNodes {
|
||||||
@ -67,6 +51,22 @@ func UploadImages() {
|
|||||||
logrus.Warnln("Uploading missing images (NotImplemented)")
|
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) {
|
func loginToPiwigoAndConfigureContext(context *AppContext) {
|
||||||
logrus.Infoln("Logging in to piwigo and getting chunk size configuration for uploads")
|
logrus.Infoln("Logging in to piwigo and getting chunk size configuration for uploads")
|
||||||
authentication.Login(context.Piwigo)
|
authentication.Login(context.Piwigo)
|
||||||
|
@ -14,7 +14,7 @@ func Login(context *PiwigoContext) {
|
|||||||
|
|
||||||
logrus.Debugf("Logging in to %s using user %s", context.Url, context.Username)
|
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)
|
logrus.Warnf("The server url %s does not use https! Credentials are not encrypted!", context.Url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user