Reste à prévoir la pagination et la recherche
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user