aicra/config/types.go

30 lines
822 B
Go
Raw Normal View History

2018-05-20 08:46:39 +00:00
package config
2018-05-19 13:17:21 +00:00
/* (1) Configuration
---------------------------------------------------------*/
2018-05-20 08:46:39 +00:00
type MethodParameter struct {
2018-05-19 13:17:21 +00:00
Description string `json:"des"`
Type string `json:"typ"`
Rename *string `json:"ren"`
Optional *bool `json:"opt"`
Default *interface{} `json:"def"`
}
2018-05-20 08:46:39 +00:00
type Method struct {
Description string `json:"des"`
Permission [][]string `json:"per"`
Parameters map[string]*MethodParameter `json:"par"`
Options map[string]interface{} `json:"opt"`
2018-05-19 13:17:21 +00:00
}
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
}
var AvailableMethods = []string{"GET", "POST", "PUT", "DELETE"}