Reste à prévoir la pagination et la recherche

This commit is contained in:
Laurent Ulrich
2025-08-20 16:19:55 +02:00
parent 10ebdaad4a
commit 9dd396e95f
8 changed files with 183 additions and 70 deletions

View File

@@ -14,10 +14,15 @@ type MailBoxConfiguration struct {
SSL string
InBox string
}
type ServiceConfiguration struct {
Address string
Port string
}
type BlogConfiguration struct {
Title string
ShortName string
MailBox MailBoxConfiguration
Service ServiceConfiguration
}
func (configuration *BlogConfiguration) Prompt() error {
@@ -31,7 +36,7 @@ func (configuration *BlogConfiguration) Prompt() error {
return err
}
if !regexp.MustCompile(`^[a-zA-Z0-9]+$`).MatchString(configuration.ShortName) {
return fmt.Errorf("short same invalid")
return fmt.Errorf("short name invalid")
}
/*
@@ -73,5 +78,15 @@ func (configuration *BlogConfiguration) Prompt() error {
return err
}
configuration.Service.Address, err = prompt("Listen address", nil, "127.0.0.1", configuration.Service.Address, false)
if err != nil {
return err
}
configuration.Service.Port, err = prompt("Listen port", nil, "8080", configuration.Service.Port, false)
if err != nil {
return err
}
return nil
}