Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ValidHTTPStatusCodes = []int{ http.StatusForbidden, http.StatusPreconditionFailed, http.StatusInternalServerError, http.StatusBadRequest, http.StatusBadGateway, http.StatusExpectationFailed, http.StatusTooEarly, http.StatusTooManyRequests, http.StatusServiceUnavailable, http.StatusMovedPermanently, }
ValidHTTPStatusCodes is a list of valid status codes for the web server.
Functions ¶
This section is empty.
Types ¶
type ErrorCacheItem ¶ added in v0.3.2
ErrorCacheItem is the structure for the WebServer cache item.
type WebServer ¶
type WebServer struct {
Host string
Port int
Hallucinator *hallucinator.Hallucinator
Statistics *statistics.Statistics
HTTPOkProbability float64
Uncertainty float64
HTTPResponseCache []ErrorCacheItem
HTTPResponseCacheSize int
HTTPResponseCacheLock sync.Mutex
HTTPBaseURL url.URL
ServeMux *http.ServeMux
Logger *slog.Logger
MaxPageDeliveryDelay time.Duration
}
WebServer is the structure for the WebServer.
func NewWebServer ¶
func NewWebServer(ctx context.Context, logger *slog.Logger, host string, port int, hallucinator *hallucinator.Hallucinator, statistics *statistics.Statistics, baseURL url.URL, httpOkProbability, uncertainty float64, errorCacheSize int, maxPageDeliveryDelay time.Duration, ) *WebServer
NewWebServer creates a new WebServer instance.
Click to show internal directories.
Click to hide internal directories.