twitch-bot/plugins/http_api.go
Knut Ahlers 411756fa45
[openapi] Allow multiple mime-types on single route
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2021-10-22 22:27:03 +02:00

39 lines
907 B
Go

package plugins
import "net/http"
type (
HTTPRouteParamDocumentation struct {
Description string
Name string
Required bool
Type string
}
HTTPRouteRegistrationArgs struct {
Accept []string
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
}
HTTPRouteResponseType uint64
HTTPRouteRegistrationFunc func(HTTPRouteRegistrationArgs) error
)
const (
HTTPRouteResponseTypeNo200 HTTPRouteResponseType = iota
HTTPRouteResponseTypeTextPlain
HTTPRouteResponseTypeJSON
HTTPRouteResponseTypeMultiple
)