mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-29 14:14:59 +00:00
19 lines
No EOL
857 B
Cheetah
19 lines
No EOL
857 B
Cheetah
// NOT ACTUALLY USING THIS CURRENTLY???
|
|
|
|
// ServerInterface represents all server handlers.
|
|
type ServerInterface interface {
|
|
{{range .}}{{.SummaryAsComment }}
|
|
// ({{.Method}} {{.Path}})
|
|
{{.OperationId}}(w http.ResponseWriter, r *http.Request{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}})
|
|
{{end}}
|
|
}
|
|
|
|
// TypedServerInterface is used to give each endpoint a fully typed method signature for cases where we're able to route automatically
|
|
type TypedServerInterface interface {
|
|
{{range .}}{{.SummaryAsComment }}
|
|
// ({{.Method}} {{.Path}})
|
|
{{$reqBody := genDefaultRequestBodyType . -}}
|
|
{{- if ne $reqBody "" }}{{$reqBody = printf ", body %s" $reqBody}}{{end -}}
|
|
{{.OperationId}}(w http.ResponseWriter{{genParamArgs .PathParams}}{{if .RequiresParamObject}}, params {{.OperationId}}Params{{end}}{{$reqBody}})
|
|
{{end}}
|
|
} |