2021-08-28 15:27:24 +00:00
|
|
|
package plugins
|
|
|
|
|
|
|
|
import "net/http"
|
|
|
|
|
|
|
|
type (
|
|
|
|
HTTPRouteParamDocumentation struct {
|
|
|
|
Description string
|
|
|
|
Name string
|
|
|
|
Required bool
|
|
|
|
Type string
|
|
|
|
}
|
|
|
|
|
|
|
|
HTTPRouteRegistrationArgs struct {
|
2021-10-22 20:27:03 +00:00
|
|
|
Accept []string
|
2021-09-22 13:36:45 +00:00
|
|
|
Description string
|
|
|
|
HandlerFunc http.HandlerFunc
|
|
|
|
IsPrefix bool
|
|
|
|
Method string
|
|
|
|
Module string
|
|
|
|
Name string
|
|
|
|
Path string
|
|
|
|
QueryParams []HTTPRouteParamDocumentation
|
|
|
|
RequiresEditorsAuth bool
|
|
|
|
ResponseType HTTPRouteResponseType
|
|
|
|
RouteParams []HTTPRouteParamDocumentation
|
|
|
|
SkipDocumentation bool
|
2021-08-28 15:27:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HTTPRouteResponseType uint64
|
|
|
|
|
|
|
|
HTTPRouteRegistrationFunc func(HTTPRouteRegistrationArgs) error
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
HTTPRouteResponseTypeNo200 HTTPRouteResponseType = iota
|
|
|
|
HTTPRouteResponseTypeTextPlain
|
|
|
|
HTTPRouteResponseTypeJSON
|
2021-10-22 20:27:03 +00:00
|
|
|
HTTPRouteResponseTypeMultiple
|
2021-08-28 15:27:24 +00:00
|
|
|
)
|