Extend and structure
This commit is contained in:
parent
7f7c34f9e0
commit
2e0f11c79a
2
go.mod
2
go.mod
@ -1,3 +1,3 @@
|
|||||||
module MDWebDavUploader
|
module gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader
|
||||||
|
|
||||||
go 1.24.0
|
go 1.24.0
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import "fmt"
|
import "fmt"
|
||||||
|
import (
|
||||||
|
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/configLoader"
|
||||||
|
"gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/setup"
|
||||||
|
)
|
||||||
|
|
||||||
// Attempts to connect to WebDAV server, verifying that the authentication data
|
// Attempts to connect to WebDAV server, verifying that the authentication data
|
||||||
// works and that the server is one for uploads with museum-digital.
|
// works and that the server is one for uploads with museum-digital.
|
@ -1,4 +1,4 @@
|
|||||||
package main
|
package configLoader
|
||||||
|
|
||||||
type MDWebDavUploaderConfig struct {
|
type MDWebDavUploaderConfig struct {
|
||||||
InstanceLink string `json:"instance"`
|
InstanceLink string `json:"instance"`
|
15
src/setup.go
15
src/setup.go
@ -1,15 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
// Fetches user information from the relevant musdb API:
|
|
||||||
// https://demo.museum-digital.org/musdb/swagger/#/user/userReadOwnData
|
|
||||||
func getUserInformation(instanceUrl string, username string, password string) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Uses musdb's API to generate an access token:
|
|
||||||
// https://demo.museum-digital.org/musdb/swagger/#/user/userGenerateWebdavAccessToken
|
|
||||||
// Returns either the token or an error.
|
|
||||||
func getWebDavAccessToken(instanceUrl string) (string, error) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
24
src/setup/setup.go
Normal file
24
src/setup/setup.go
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package setup
|
||||||
|
|
||||||
|
import "gitea.armuli.eu/museum-digital/museum-digital-webdav-uploader/src/configLoader"
|
||||||
|
|
||||||
|
// Fetches user information from the relevant musdb API:
|
||||||
|
// https://demo.museum-digital.org/musdb/swagger/#/user/userReadOwnData
|
||||||
|
func getUserInformationFromApi(instanceUrl string, username string, password string) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Uses musdb's API to generate an access token:
|
||||||
|
// https://demo.museum-digital.org/musdb/swagger/#/user/userGenerateWebdavAccessToken
|
||||||
|
// Returns either the token or an error.
|
||||||
|
func getWebDavAccessTokenFromApi(instanceUrl string) (string, error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
func setup() error {
|
||||||
|
|
||||||
|
// Request input data
|
||||||
|
|
||||||
|
validateInstanceLink()
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user