apigen/types.go

39 lines
902 B
Go

package main
type API struct {
BasePath string `yaml:"basepath"`
Host string `yaml:"host"`
Types map[string]*APIType `yaml:"types"`
Methods map[string]*APIMethod `yaml:"methods"`
Namespace string
}
type APIField struct {
Type string `yaml:"type"`
Array bool `yaml:"array"`
Desc string `yaml:"desc"`
Map bool `yaml:"map"`
Mapkey string `yaml:"mapkey"`
Mapval string `yaml:"mapval"`
}
type APIType struct {
Name string
Desc string `yaml:"desc"`
Fields map[string]*APIField `yaml:"fields"`
Col string `yaml:"col"`
}
type APIParamType struct {
Typename string
Ispointer bool
}
type APIMethod struct {
Desc string `yaml:"desc"`
Verb string `yaml:"verb"`
Path string `yaml:"path"`
Perm string `yaml:perm`
ReqType *APIParamType
ResType *APIParamType
Raw bool `yaml:"raw"`
}