2023-01-16 13:02:18 +01:00
|
|
|
package webview
|
|
|
|
|
|
|
|
|
|
import (
|
2023-03-31 10:08:31 +02:00
|
|
|
"errors"
|
2023-01-16 13:02:18 +01:00
|
|
|
"net/http"
|
|
|
|
|
)
|
|
|
|
|
|
2023-03-31 10:08:31 +02:00
|
|
|
const (
|
|
|
|
|
HeaderContentLength = "Content-Length"
|
|
|
|
|
HeaderContentType = "Content-Type"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
errRequestStopped = errors.New("request has been stopped")
|
|
|
|
|
errResponseFinished = errors.New("response has been finished")
|
|
|
|
|
)
|
|
|
|
|
|
2023-01-16 13:02:18 +01:00
|
|
|
// A ResponseWriter interface is used by an HTTP handler to
|
|
|
|
|
// construct an HTTP response for the WebView.
|
|
|
|
|
type ResponseWriter interface {
|
|
|
|
|
http.ResponseWriter
|
|
|
|
|
|
2023-04-20 12:06:37 +02:00
|
|
|
// Finish the response and flush all data. A Finish after the request has already been finished has no effect.
|
2023-09-20 19:28:18 +02:00
|
|
|
Finish() error
|
2023-01-16 13:02:18 +01:00
|
|
|
}
|