2018-10-01 15:43:18 +00:00
|
|
|
package config
|
2018-10-01 10:29:05 +00:00
|
|
|
|
2019-05-01 08:29:02 +00:00
|
|
|
import "net/http"
|
2018-10-01 10:29:05 +00:00
|
|
|
|
2019-05-01 08:29:02 +00:00
|
|
|
var availableHTTPMethods = []string{http.MethodGet, http.MethodPost, http.MethodPut, http.MethodDelete}
|
2018-10-01 10:29:05 +00:00
|
|
|
|
2019-05-01 08:29:02 +00:00
|
|
|
// Parameter represents a parameter definition (from api.json)
|
|
|
|
type Parameter struct {
|
|
|
|
Description string `json:"info"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
Rename string `json:"name,omitempty"`
|
|
|
|
Optional bool
|
2020-03-14 14:24:17 +00:00
|
|
|
// Default *interface{} `json:"default"`
|
2019-05-01 08:29:02 +00:00
|
|
|
}
|
2018-10-01 10:29:05 +00:00
|
|
|
|
2020-03-14 14:24:17 +00:00
|
|
|
// Service represents a service definition (from api.json)
|
|
|
|
type Service struct {
|
|
|
|
Method string `json:"method"`
|
|
|
|
Pattern string `json:"path"`
|
2019-05-02 18:57:58 +00:00
|
|
|
Scope [][]string `json:"scope"`
|
2020-03-14 14:24:17 +00:00
|
|
|
Description string `json:"info"`
|
2019-05-01 08:29:02 +00:00
|
|
|
Download *bool `json:"download"`
|
2020-03-14 14:24:17 +00:00
|
|
|
Input map[string]*Parameter `json:"in"`
|
|
|
|
// Output map[string]*Parameter `json:"out"`
|
|
|
|
|
2018-10-01 10:29:05 +00:00
|
|
|
}
|
2020-03-14 14:24:17 +00:00
|
|
|
|
|
|
|
// Services contains every service that represents a server configuration
|
|
|
|
type Services []*Service
|