restructured project folders
This commit is contained in:
parent
aacb7377d9
commit
894a039591
31
cmd/DirectoriesToAlbums/main.go
Normal file
31
cmd/DirectoriesToAlbums/main.go
Normal 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...")
|
||||
}
|
37
internal/app/DirectoriesToAlbums/app.go
Normal file
37
internal/app/DirectoriesToAlbums/app.go
Normal 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)")
|
||||
}
|
8
internal/pkg/piwigo/authentication/types.go
Normal file
8
internal/pkg/piwigo/authentication/types.go
Normal file
@ -0,0 +1,8 @@
|
||||
package authentication
|
||||
|
||||
type PiwigoConfig struct {
|
||||
url string
|
||||
username string
|
||||
password string
|
||||
}
|
||||
|
7
internal/pkg/piwigo/category/types.go
Normal file
7
internal/pkg/piwigo/category/types.go
Normal file
@ -0,0 +1,7 @@
|
||||
package category
|
||||
|
||||
type PiwigoCategory struct {
|
||||
id int
|
||||
name string
|
||||
key string
|
||||
}
|
60
main.go
60
main.go
@ -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)")
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
package piwigo
|
||||
|
||||
type PiwigoConfig struct {
|
||||
url string
|
||||
username string
|
||||
password string
|
||||
}
|
||||
|
||||
type PiwigoCategory struct {
|
||||
id int
|
||||
name string
|
||||
key string
|
||||
}
|
Loading…
Reference in New Issue
Block a user