Add add config validators

This commit is contained in:
2025-02-24 04:33:43 +01:00
parent dfe1bdfeb4
commit d4c83e27d2
8 changed files with 262 additions and 42 deletions

View File

@@ -11,11 +11,6 @@ type MDWebDavUploaderConfig struct {
PublishOnImport bool `json:"visible"`
}
type ParserListItem struct {
name string
}
// Returns a uniform filepath for the configuration of this tool.
// To be compatible across operating systems, this will be a JSON
// file in the same directory as the current programm.
@@ -23,45 +18,8 @@ func getConfigFilepath() string {
}
// Returns a uniform filepath for the cache for the list of
// available parsers.
func getParserCacheFilepath() string {
}
// Loads configuration from the configuration file (located using
// getConfigFilepath()).
func LoadFromFile() MDWebDavUploaderConfig {
}
// Stores a parser list to a cache file (located via
// getParserCacheFilepath()).
func StoreParserList(parserList []ParserListItem) {
}
// Returns a list of the available parsers.
func ListParsers() []ParserListItem {
}
// Checks if inputParser is in the list of available parsers.
// Returns the parser name or an error.
func ValidateParser(inputParser string) (string, error) {
}
// Validates an input mail address.
// Returns the valid mail address or an eQueries therror.
func ValidateMail(mail string) (string, error) {
}
// Validates an entered instance URL.
// Returns the entered URL in a unified form (minus optional
// trailing slashes and the /musdb suffix) or an error.
func ValidateInstanceLink(instanceUrl string) (string, error) {
}