Extend and structure
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
package main
|
||||
package configLoader
|
||||
|
||||
type MDWebDavUploaderConfig struct {
|
||||
InstanceLink string `json:"instance"`
|
34
src/main.go
34
src/main.go
@ -1,34 +0,0 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
// Attempts to connect to WebDAV server, verifying that the authentication data
|
||||
// works and that the server is one for uploads with museum-digital.
|
||||
// A museum-digital WebDAV directory can be identified by the availability of the
|
||||
// directories IMPORT_IMG and IMPORT_XML.
|
||||
func verifyConnection(config MDWebDavUploaderConfig) bool {
|
||||
|
||||
}
|
||||
|
||||
// Generates the contents of the file import_config.txt necessary
|
||||
// to let museum-digital know about the required import configuration.
|
||||
func generateImportConfigFile() string {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Uploads metadata files to the configured instance of
|
||||
// museum-digital / musdb.
|
||||
func uploadMetadataFiles() {
|
||||
|
||||
}
|
||||
|
||||
// Uploads media files to the configured instance of
|
||||
// museum-digital / musdb.
|
||||
func uploadMediaFiles() {
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
fmt.Println("hi")
|
||||
}
|
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()
|
||||
|
||||
}
|
Reference in New Issue
Block a user