restructured project folders

This commit is contained in:
Philipp Häfelfinger 2019-02-23 21:57:54 +01:00
parent aacb7377d9
commit 894a039591
8 changed files with 83 additions and 73 deletions

View File

@ -0,0 +1,31 @@
package main
import (
"flag"
"github.com/sirupsen/logrus"
"haefelfinger.net/piwigo/DirectoriesToAlbums/internal/app/DirectoriesToAlbums"
"os"
)
func main() {
flag.Parse()
root := flag.Arg(0)
InitializeLog()
app.AuthenticateToPiwigo()
app.ScanLocalDirectories(root)
app.GetAllCategoriesFromServer()
app.FindMissingAlbums()
app.CreateMissingAlbums()
app.FindMissingImages()
app.UploadImages()
}
func InitializeLog() {
//TODO: make log configurable to file instead of console
logrus.SetLevel(logrus.DebugLevel)
logrus.SetOutput(os.Stdout)
logrus.Infoln("Starting Piwigo directories to albums...")
}

View File

@ -0,0 +1,37 @@
package app
import (
"github.com/sirupsen/logrus"
"haefelfinger.net/piwigo/DirectoriesToAlbums/internal/pkg/localFileStructure"
)
func AuthenticateToPiwigo() {
logrus.Warnln("Authenticating to piwigo server (NotImplemented)")
}
func ScanLocalDirectories(root string) {
fileNodes := localFileStructure.ScanLocalFileStructure(root)
logrus.Debugln("filepath.Walk() returned %v\n", fileNodes)
}
func GetAllCategoriesFromServer() {
// get all categories from server and flatten structure to match directory names
// 2018/2018 album blah
logrus.Warnln("Loading all categories from the server (NotImplemented)")
}
func FindMissingAlbums() {
logrus.Warnln("Looking up missing albums (NotImplemented)")
}
func CreateMissingAlbums() {
logrus.Warnln("Creating missing albums (NotImplemented)")
}
func FindMissingImages() {
logrus.Warnln("Finding missing images (NotImplemented)")
}
func UploadImages() {
logrus.Warnln("Uploading missing images (NotImplemented)")
}

View File

@ -0,0 +1,8 @@
package authentication
type PiwigoConfig struct {
url string
username string
password string
}

View File

@ -0,0 +1,7 @@
package category
type PiwigoCategory struct {
id int
name string
key string
}

60
main.go
View File

@ -1,60 +0,0 @@
package main
import (
"flag"
"haefelfinger.net/piwigo/DirectoriesToAlbums/pkg/localFileStructure"
"log"
"os"
)
func main() {
flag.Parse()
root := flag.Arg(0)
InitializeLog()
AuthenticateToPiwigo()
ScanLocalDirectories(root)
GetAllCategoriesFromServer()
FindMissingAlbums()
CreateMissingAlbums()
FindMissingImages()
UploadImages()
}
func InitializeLog() {
//TODO: make log configurable to file instead of console
log.SetOutput(os.Stdout)
log.Println("Starting Piwigo directories to albums...")
}
func AuthenticateToPiwigo() {
log.Println("Authenticating to piwigo server (NotImplemented)")
}
func ScanLocalDirectories(root string) {
fileNodes := localFileStructure.ScanLocalFileStructure(root)
log.Printf("filepath.Walk() returned %v\n", fileNodes)
}
func GetAllCategoriesFromServer() {
// get all categories from server and flatten structure to match directory names
// 2018/2018 album blah
log.Println("Loading all categories from the server (NotImplemented)")
}
func FindMissingAlbums() {
log.Println("Looking up missing albums (NotImplemented)")
}
func CreateMissingAlbums() {
log.Println("Creating missing albums (NotImplemented)")
}
func FindMissingImages() {
log.Println("Finding missing images (NotImplemented)")
}
func UploadImages() {
log.Println("Uploading missing images (NotImplemented)")
}

View File

@ -1,13 +0,0 @@
package piwigo
type PiwigoConfig struct {
url string
username string
password string
}
type PiwigoCategory struct {
id int
name string
key string
}