aicra/internal/api/types.go

31 lines
894 B
Go
Raw Normal View History

package api
2018-05-19 13:17:21 +00:00
/* (1) Configuration
---------------------------------------------------------*/
2018-10-07 09:14:04 +00:00
// Parameter represents a parameter definition (from api.json)
2018-06-01 08:51:51 +00:00
type Parameter struct {
Description string `json:"info"`
Type string `json:"type"`
Rename string `json:"name,omitempty"`
Optional bool
Default *interface{} `json:"default"`
2018-05-19 13:17:21 +00:00
}
2018-10-07 09:14:04 +00:00
// Method represents a method definition (from api.json)
2018-05-20 08:46:39 +00:00
type Method struct {
Description string `json:"info"`
Permission [][]string `json:"scope"`
Parameters map[string]*Parameter `json:"in"`
Download *bool `json:"download"`
2018-05-19 13:17:21 +00:00
}
2018-10-07 09:14:04 +00:00
// Controller represents a controller definition (from api.json)
2018-05-20 08:46:39 +00:00
type Controller struct {
GET *Method `json:"GET"`
POST *Method `json:"POST"`
PUT *Method `json:"PUT"`
DELETE *Method `json:"DELETE"`
2018-05-19 13:17:21 +00:00
Children map[string]*Controller `json:"/"`
2018-05-19 13:17:21 +00:00
}