1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-25 08:19:40 +02:00

Merge branch "refactor-backend-settings" into internal

This commit is contained in:
Anthony Lapenna 2016-08-03 21:18:46 +12:00
commit f4d90306b3
7 changed files with 28 additions and 37 deletions

18
api/settings.go Normal file
View file

@ -0,0 +1,18 @@
package main
import (
"encoding/json"
"net/http"
)
// Settings defines the settings available under the /settings endpoint
type Settings struct {
Swarm bool `json:"swarm"`
HiddenLabels pairList `json:"hiddenLabels"`
Registries pairList `json:"registries"`
}
// configurationHandler defines a handler function used to encode the configuration in JSON
func settingsHandler(w http.ResponseWriter, r *http.Request, s *Settings) {
json.NewEncoder(w).Encode(*s)
}