OpenAPI: minor changes

This commit is contained in:
Nicola Murino
2021-01-18 13:24:38 +01:00
parent 778ec9b88f
commit 41a1af863e
8 changed files with 27 additions and 12 deletions

View File

@@ -4,6 +4,7 @@
package sftpd
import (
"strings"
"time"
)
@@ -39,10 +40,15 @@ type HostKey struct {
type ServiceStatus struct {
IsActive bool `json:"is_active"`
Bindings []Binding `json:"bindings"`
SSHCommands string `json:"ssh_commands"`
SSHCommands []string `json:"ssh_commands"`
HostKeys []HostKey `json:"host_keys"`
}
// GetSSHCommandsAsString returns enabled SSH commands as comma separated string
func (s ServiceStatus) GetSSHCommandsAsString() string {
return strings.Join(s.SSHCommands, ", ")
}
// GetStatus returns the server status
func GetStatus() ServiceStatus {
return serviceStatus