Maintenance: refactor servers updater code
- Require at least 80% of number of servers now to pass - Each provider is in its own package with a common structure - Unzip package with unzipper interface - Openvpn package with extraction and download functions
This commit is contained in:
15
internal/updater/providers/cyberghost/string.go
Normal file
15
internal/updater/providers/cyberghost/string.go
Normal file
@@ -0,0 +1,15 @@
|
||||
package cyberghost
|
||||
|
||||
import "github.com/qdm12/gluetun/internal/models"
|
||||
|
||||
// Stringify converts servers to code string format.
|
||||
func Stringify(servers []models.CyberghostServer) (s string) {
|
||||
s = "func CyberghostServers() []models.CyberghostServer {\n"
|
||||
s += " return []models.CyberghostServer{\n"
|
||||
for _, server := range servers {
|
||||
s += " " + server.String() + ",\n"
|
||||
}
|
||||
s += " }\n"
|
||||
s += "}"
|
||||
return s
|
||||
}
|
||||
Reference in New Issue
Block a user