fsthttp

Modulecompute-sdk-go v1.11.0

github.com/fastly/compute-sdk-go/fsthttp

Package fsthttp provides HTTP functionality for Fastly's Compute environment.

A Compute program can be thought of as an HTTP request handler. Each execution is triggered by an incoming request from a client, and is expected to respond to that request before terminating. The Serve function provides a Handler-style interface to that Request and its ResponseWriter.

The types in this package are similar to, but not the same as, corresponding types in the standard library's package net/http. Refer to the documentation for important caveats about usage.

Modules

Structs

BackendBackend is a fastly backend
BackendHealthcheckOptions
BackendOptionsBackendOption is a builder for the configuration of a dynamic backend.
BotDetectionResult
CacheOptionsCacheOptions control caching behavior for outgoing requests.
CandidateResponseCandidateResponse is a response from a backend that is a candidate for caching.
CookieA Cookie represents an HTTP cookie as sent in the Set-Cookie header of an HTTP response or the Cookie header of an HTTP request.
DecompressResponseOptionsDecompressResponseOptions control the auto decompress response behaviour.
FastlyMetaFastlyMeta holds various Fastly-specific metadata for a request.
InspectOptions
InspectResponse
LimitsdeprecatedLimits handles HTTP limits.
RequestRequest represents an HTTP request received by this server from a requesting client, or to be sent from this server during this execution. Some fields only have meaning in one context or the other.
ResponseResponse to an outgoing HTTP request made by this server.
ResVPNProxyResultResVPNProxyResult represents additional IP Proxy and VPN Intelligence data for a request.
ServeManyOptionsServeManyOptions controls the exit conditions for ServeMany. Note that Compute might terminate the request hander earlier.
TLSClientCertificateInfo
TLSInfoTLSInfo collects TLS-related metadata for incoming requests. All fields are ignored for outgoing requests.
TransportTransport is an http.RoundTripper implementation for backend requests on Compute.

Interfaces

HandlerHandler describes anything which can handle, or respond to, an HTTP request. It has the same semantics as net/http.Handler, but operates on the Request and ResponseWriter types defined in this package.
ResponseWriterResponseWriter is used to respond to client requests.

Enums

BackendHealth
NGWAFVerdict
SameSiteSameSite allows a server to define a cookie attribute making it impossible for the browser to send this cookie along with cross-site requests. The main goal is to mitigate the risk of cross-origin information leakage, and provide some protection against cross-site request forgery attacks.
TLSVersion

Type aliases

BotCategory
ClientCertificateVerifyResult
HandlerFuncHandlerFunc adapts a function to a Handler.
HeaderHeader represents the key-value pairs in a set of HTTP headers. Unlike net/http, keys are canonicalized to their lowercase form.
SendErrorSendError provides detailed information about backend request failures.
SendErrorTag

Functions

AdaptAdapt allows an http.Handler to be used as an fsthttp.Handler.
BackendFromName
CanonicalHeaderKeyCanonicalHeaderKey returns the canonical format of the header key s. The canonicalization converts the first letter and any letter following a hyphen to upper case; the rest are converted to lowercase. For example, the canonical key for "accept-encoding" is "Accept-Encoding". If s contains a space or invalid header field bytes, it is returned without modifications.
ErrorError replies to the request with the specified error message and HTTP code. It does not otherwise end the request; the caller should ensure no further writes are done to w. The error message should be plain text.
NewBackendHealthcheck
NewBackendOptions
NewHeaderNewHeader returns an initialized and empty set of headers.
NewRequestNewRequest constructs an outgoing request with the given HTTP method, URI, and body. The URI is parsed via url.Parse.
NewTransportNewTransport creates a new Transport instance with the given default backend. Any request made to a host not explicitly mapped to a backend using the AddHostBackend method will be sent to the default backend.
NotFoundNotFound replies to the request with an HTTP 404 not found error.
RegisterDynamicBackendRegisterDynamicBackend registers a new dynamic backend.
RequestFromContextRequestFromContext returns the fsthttp.Request associated with the context, if any.
ResponseFromContextResponseFromContext returns the fsthttp.Response associated with the context, if any.
ResponseWriterFromContextResponseWriterFromContext returns the fsthttp.ResponseWriter associated with the context, if any.
ServeServe calls h, providing it with a context that will be canceled when Serve returns, a Request representing the incoming client request that initiated this execution, and a ResponseWriter that can be used to respond to that request. Serve will ensure the ResponseWriter has been closed before returning, and so should only be called once per execution.
ServeFuncServeFunc is sugar for Serve(HandlerFunc(f)).
ServeManyServeMany allows a single Compute instance to handle multiple requests.
SetCookieSetCookie adds a Set-Cookie header to the provided ResponseWriter's headers. The provided cookie must have a valid Name. Invalid cookies may be silently dropped.
StatusTextStatusText returns a text for the HTTP status code. It returns the empty string if the code is unknown.

Constants

BackendHealthHealthy

BackendHealthread-onlyView source

Default: 1

Constants for dynamic backend health status

BackendHealthUnhealthy

BackendHealthread-onlyView source

Default: 2

Constants for dynamic backend health status

BackendHealthUnknown

BackendHealthread-onlyView source

Default: 0

Constants for dynamic backend health status

BotCategoryAICrawler

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryAICrawler

BotCategoryAICrawler is for crawlers used for training AIs and LLMs, generally used for building AI models or indexes.

BotCategoryAIFetcher

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryAIFetcher

BotCategoryAIFetcher is for fetchers used by AIs and LLMs for enriching results in response to a user query.

BotCategoryAccessibility

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryAccessibility

BotCategoryAccessibility is for tools that make content accessible (e.g., screen readers).

BotCategoryContentFetcher

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryContentFetcher

BotCategoryContentFetcher is for tools that extract content from websites to be used elsewhere.

BotCategoryHeadless

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryHeadless

BotCategoryHeadless is for a request that is suspected of being a headless bot.

BotCategoryMonitoringSiteTools

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryMonitoringSiteTools

BotCategoryMonitoringSiteTools is for tools that access your website to monitor things like performance, uptime, and proving domain control.

BotCategoryNone

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryNone

BotCategoryNone indicates bot detection was not executed, or no bot was detected.

BotCategoryOnlineMarketing

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryOnlineMarketing

BotCategoryOnlineMarketing is for crawlers from online marketing platforms (e.g., Facebook, Pinterest).

BotCategoryPagePreview

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryPagePreview

BotCategoryPagePreview is for tools that access your website to show a preview of the page in other online services and social media platforms.

BotCategoryPlatformIntegrations

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryPlatformIntegrations

BotCategoryPlatformIntegrations is for integration with other platforms by accessing the website's API, notably Webhooks.

BotCategoryResearch

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryResearch

BotCategoryResearch is for commercial and academic tools that collect and analyze data for research purposes.

BotCategorySearchEngineCrawler

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategorySearchEngineCrawler

BotCategorySearchEngineCrawler is for crawlers that index your website for search engines.

BotCategorySearchEngineSpecialization

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategorySearchEngineSpecialization

BotCategorySearchEngineSpecialization is for tools that support search engine optimization tasks (e.g., link analysis, ranking).

BotCategorySecurityTools

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategorySecurityTools

BotCategorySecurityTools is for security analysis tools that inspect your website for vulnerabilities, misconfigurations and other security features.

BotCategorySuspected

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategorySuspected

BotCategorySuspected is for a suspected bot.

BotCategoryUnknown

fastly.BotCategoryread-onlyView source

Default: fastly.BotCategoryUnknown

BotCategoryUnknown indicates the detected bot belongs to a category not recognized by this SDK version.

ClientCertificateVerifyResultBadCertificate

fastly.ClientCertificateVerifyResultread-onlyView source

Default: fastly.ClientCertificateVerifyResultBadCertificate

ClientCertificateVerifyResultBadCertificate means the certificate is corrupt (e.g., the certificate signatures do not verify correctly).

ClientCertificateVerifyResultCertificateExpired

fastly.ClientCertificateVerifyResultread-onlyView source

Default: fastly.ClientCertificateVerifyResultCertificateExpired

ClientCertificateVerifyResultCertificateExpired means the client certificate has expired or is not currently valid.

ClientCertificateVerifyResultCertificateMissing

fastly.ClientCertificateVerifyResultread-onlyView source

Default: fastly.ClientCertificateVerifyResultCertificateMissing

ClientCertificateVerifyResultCertificateMissing means the client did not provide a certificate during the handshake.

ClientCertificateVerifyResultCertificateRevoked

fastly.ClientCertificateVerifyResultread-onlyView source

Default: fastly.ClientCertificateVerifyResultCertificateRevoked

ClientCertificateVerifyResultCertificateRevoked means the client certificate is revoked by its signer.

ClientCertificateVerifyResultCertificateUnknown

fastly.ClientCertificateVerifyResultread-onlyView source

Default: fastly.ClientCertificateVerifyResultCertificateUnknown

ClientCertificateVerifyResultCertificateUnknown means the client certificate was received, but some other (unspecified) issue arose in processing the certificate, rendering it unacceptable.

ClientCertificateVerifyResultOK

fastly.ClientCertificateVerifyResultread-onlyView source

Default: fastly.ClientCertificateVerifyResultOK

ClientCertificateVerifyResultOK indicates that client certificate verified successfully.

ClientCertificateVerifyResultUnknownCA

fastly.ClientCertificateVerifyResultread-onlyView source

Default: fastly.ClientCertificateVerifyResultUnknownCA

ClientCertificateVerifyResultUnknownCA means the valid certificate chain or partial chain was received, but the certificate was not accepted because the CA certificate could not be located or could not be matched with a known trust anchor.

InspectVerdictAllow

NGWAFVerdictread-onlyView source

Default: "allow"

InspectVerdictBlock

NGWAFVerdictread-onlyView source

Default: "block"

InspectVerdictUnauthorized

NGWAFVerdictread-onlyView source

Default: "unauthorized"

MethodConnect

untyped stringread-onlyView source

Default: "CONNECT"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

MethodDelete

untyped stringread-onlyView source

Default: "DELETE"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

MethodGet

untyped stringread-onlyView source

Default: "GET"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

MethodHead

untyped stringread-onlyView source

Default: "HEAD"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

MethodOptions

untyped stringread-onlyView source

Default: "OPTIONS"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

MethodPatch

untyped stringread-onlyView source

Default: "PATCH"

RFC 5789

MethodPost

untyped stringread-onlyView source

Default: "POST"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

MethodPut

untyped stringread-onlyView source

Default: "PUT"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

MethodTrace

untyped stringread-onlyView source

Default: "TRACE"

Common HTTP methods.

Unless otherwise noted, these are defined in RFC 7231 section 4.3.

SameSiteDefaultMode

SameSiteread-onlyView source

Default: iota + 1

SameSiteLaxMode

SameSiteread-onlyView source

Default: 2

SameSiteNoneMode

SameSiteread-onlyView source

Default: 4

SameSiteStrictMode

SameSiteread-onlyView source

Default: 3

SendErrorConnectionLimitReached

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagConnectionLimitReached

SendErrorConnectionLimitReached indicates the system is configured to limit the number of connections it has to the backend, and that limit has been reached.

SendErrorConnectionRefused

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagConnectionRefused

SendErrorConnectionRefused indicates the system's connection to the backend was refused.

SendErrorConnectionTerminated

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagConnectionTerminated

SendErrorConnectionTerminated indicates the system's connection to the backend was closed before a complete response was received.

SendErrorConnectionTimeout

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagConnectionTimeout

SendErrorConnectionTimeout indicates the system's attempt to open a connection to the backend timed out.

SendErrorDNSError

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagDNSError

SendErrorDNSError indicates the system encountered a DNS error when trying to find an IP address for the backend hostname. Use DNSErrorRCode() and DNSErrorInfoCode() to get additional details.

SendErrorDNSTimeout

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagDNSTimeout

SendErrorDNSTimeout indicates the system encountered a timeout when trying to find an IP address for the backend hostname.

SendErrorDestinationIPUnroutable

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagDestinationIPUnroutable

SendErrorDestinationIPUnroutable indicates the system cannot find a route to the next-hop IP address.

SendErrorDestinationNotFound

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagDestinationNotFound

SendErrorDestinationNotFound indicates the system cannot determine which backend to use, or the specified backend was invalid.

SendErrorDestinationUnavailable

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagDestinationUnavailable

SendErrorDestinationUnavailable indicates the system considers the backend to be unavailable (e.g., recent attempts to communicate with it may have failed, or a health check may indicate that it is down).

SendErrorHTTPIncompleteResponse

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPIncompleteResponse

SendErrorHTTPIncompleteResponse indicates the system received an incomplete response to the request from the backend.

SendErrorHTTPProtocolError

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPProtocolError

SendErrorHTTPProtocolError indicates the system encountered an HTTP protocol error when communicating with the backend. This error will only be used when a more specific one is not defined.

SendErrorHTTPRequestCacheKeyInvalid

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPRequestCacheKeyInvalid

SendErrorHTTPRequestCacheKeyInvalid indicates an invalid Fastly cache key was provided for the request.

SendErrorHTTPRequestURIInvalid

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPRequestURIInvalid

SendErrorHTTPRequestURIInvalid indicates an invalid URI was provided for the request.

SendErrorHTTPResponseBodyTooLarge

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPResponseBodyTooLarge

SendErrorHTTPResponseBodyTooLarge indicates the system received a response to the request whose body was considered too large. For specific limits, visit the Compute resource limits documentation.

SendErrorHTTPResponseHeaderSectionTooLarge

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPResponseHeaderSectionTooLarge

SendErrorHTTPResponseHeaderSectionTooLarge indicates the system received a response to the request whose header section was considered too large. For specific limits, visit the Compute resource limits documentation.

SendErrorHTTPResponseStatusInvalid

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPResponseStatusInvalid

SendErrorHTTPResponseStatusInvalid indicates the system received a response to the request whose status code or reason phrase was invalid.

SendErrorHTTPResponseTimeout

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPResponseTimeout

SendErrorHTTPResponseTimeout indicates the system reached a configured time limit waiting for the complete response. The limit is configured on the backend.

SendErrorHTTPUpgradeFailed

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagHTTPUpgradeFailed

SendErrorHTTPUpgradeFailed indicates the process of negotiating an upgrade of the HTTP version between the system and the backend failed.

SendErrorInternalError

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagInternalError

SendErrorInternalError indicates the system encountered an unexpected internal error.

SendErrorTLSAlertReceived

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagTLSAlertReceived

SendErrorTLSAlertReceived indicates the system received a TLS alert from the backend. Use TLSAlertID() and TLSAlertDescription() to get the specific alert.

SendErrorTLSCertificateError

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagTLSCertificateError

SendErrorTLSCertificateError indicates the system encountered an error when verifying the certificate presented by the backend.

SendErrorTLSConfigurationError

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagTLSConfigurationError

SendErrorTLSConfigurationError indicates the system encountered an error with the backend TLS configuration.

SendErrorTLSProtocolError

fastly.SendErrorDetailTagread-onlyView source

Default: fastly.SendErrorDetailTagTLSProtocolError

SendErrorTLSProtocolError indicates the system encountered a TLS error when communicating with the backend, either during the handshake or afterwards.

StatusAccepted

untyped intread-onlyView source

Default: 202

RFC 7231, 6.3.3

StatusAlreadyReported

untyped intread-onlyView source

Default: 208

RFC 5842, 7.1

StatusBadGateway

untyped intread-onlyView source

Default: 502

RFC 7231, 6.6.3

StatusBadRequest

untyped intread-onlyView source

Default: 400

RFC 7231, 6.5.1

StatusConflict

untyped intread-onlyView source

Default: 409

RFC 7231, 6.5.8

StatusContinue

untyped intread-onlyView source

Default: 100

RFC 7231, 6.2.1

StatusCreated

untyped intread-onlyView source

Default: 201

RFC 7231, 6.3.2

StatusEarlyHints

untyped intread-onlyView source

Default: 103

RFC 8297

StatusExpectationFailed

untyped intread-onlyView source

Default: 417

RFC 7231, 6.5.14

StatusFailedDependency

untyped intread-onlyView source

Default: 424

RFC 4918, 11.4

StatusForbidden

untyped intread-onlyView source

Default: 403

RFC 7231, 6.5.3

StatusFound

untyped intread-onlyView source

Default: 302

RFC 7231, 6.4.3

StatusGatewayTimeout

untyped intread-onlyView source

Default: 504

RFC 7231, 6.6.5

StatusGone

untyped intread-onlyView source

Default: 410

RFC 7231, 6.5.9

StatusHTTPVersionNotSupported

untyped intread-onlyView source

Default: 505

RFC 7231, 6.6.6

StatusIMUsed

untyped intread-onlyView source

Default: 226

RFC 3229, 10.4.1

StatusInsufficientStorage

untyped intread-onlyView source

Default: 507

RFC 4918, 11.5

StatusInternalServerError

untyped intread-onlyView source

Default: 500

RFC 7231, 6.6.1

StatusLengthRequired

untyped intread-onlyView source

Default: 411

RFC 7231, 6.5.10

StatusLocked

untyped intread-onlyView source

Default: 423

RFC 4918, 11.3

StatusLoopDetected

untyped intread-onlyView source

Default: 508

RFC 5842, 7.2

StatusMethodNotAllowed

untyped intread-onlyView source

Default: 405

RFC 7231, 6.5.5

StatusMisdirectedRequest

untyped intread-onlyView source

Default: 421

RFC 7540, 9.1.2

StatusMovedPermanently

untyped intread-onlyView source

Default: 301

RFC 7231, 6.4.2

StatusMultiStatus

untyped intread-onlyView source

Default: 207

RFC 4918, 11.1

StatusMultipleChoices

untyped intread-onlyView source

Default: 300

RFC 7231, 6.4.1

StatusNetworkAuthenticationRequired

untyped intread-onlyView source

Default: 511

RFC 6585, 6

StatusNoContent

untyped intread-onlyView source

Default: 204

RFC 7231, 6.3.5

StatusNonAuthoritativeInfo

untyped intread-onlyView source

Default: 203

RFC 7231, 6.3.4

StatusNotAcceptable

untyped intread-onlyView source

Default: 406

RFC 7231, 6.5.6

StatusNotExtended

untyped intread-onlyView source

Default: 510

RFC 2774, 7

StatusNotFound

untyped intread-onlyView source

Default: 404

RFC 7231, 6.5.4

StatusNotImplemented

untyped intread-onlyView source

Default: 501

RFC 7231, 6.6.2

StatusNotModified

untyped intread-onlyView source

Default: 304

RFC 7232, 4.1

StatusOK

untyped intread-onlyView source

Default: 200

RFC 7231, 6.3.1

StatusPartialContent

untyped intread-onlyView source

Default: 206

RFC 7233, 4.1

StatusPaymentRequired

untyped intread-onlyView source

Default: 402

RFC 7231, 6.5.2

StatusPermanentRedirect

untyped intread-onlyView source

Default: 308

RFC 7538, 3

StatusPreconditionFailed

untyped intread-onlyView source

Default: 412

RFC 7232, 4.2

StatusPreconditionRequired

untyped intread-onlyView source

Default: 428

RFC 6585, 3

StatusProcessing

untyped intread-onlyView source

Default: 102

RFC 2518, 10.1

StatusProxyAuthRequired

untyped intread-onlyView source

Default: 407

RFC 7235, 3.2

StatusRequestEntityTooLarge

untyped intread-onlyView source

Default: 413

RFC 7231, 6.5.11

StatusRequestHeaderFieldsTooLarge

untyped intread-onlyView source

Default: 431

RFC 6585, 5

StatusRequestTimeout

untyped intread-onlyView source

Default: 408

RFC 7231, 6.5.7

StatusRequestURITooLong

untyped intread-onlyView source

Default: 414

RFC 7231, 6.5.12

StatusRequestedRangeNotSatisfiable

untyped intread-onlyView source

Default: 416

RFC 7233, 4.4

StatusResetContent

untyped intread-onlyView source

Default: 205

RFC 7231, 6.3.6

StatusSeeOther

untyped intread-onlyView source

Default: 303

RFC 7231, 6.4.4

StatusServiceUnavailable

untyped intread-onlyView source

Default: 503

RFC 7231, 6.6.4

StatusSwitchingProtocols

untyped intread-onlyView source

Default: 101

RFC 7231, 6.2.2

StatusTeapot

untyped intread-onlyView source

Default: 418

RFC 7168, 2.3.3

StatusTemporaryRedirect

untyped intread-onlyView source

Default: 307

RFC 7231, 6.4.7

StatusTooEarly

untyped intread-onlyView source

Default: 425

RFC 8470, 5.2.

StatusTooManyRequests

untyped intread-onlyView source

Default: 429

RFC 6585, 4

StatusUnauthorized

untyped intread-onlyView source

Default: 401

RFC 7235, 3.1

StatusUnavailableForLegalReasons

untyped intread-onlyView source

Default: 451

RFC 7725, 3

StatusUnprocessableEntity

untyped intread-onlyView source

Default: 422

RFC 4918, 11.2

StatusUnsupportedMediaType

untyped intread-onlyView source

Default: 415

RFC 7231, 6.5.13

StatusUpgradeRequired

untyped intread-onlyView source

Default: 426

RFC 7231, 6.5.15

StatusUseProxy

untyped intread-onlyView source

Default: 305

RFC 7231, 6.4.5

StatusVariantAlsoNegotiates

untyped intread-onlyView source

Default: 506

RFC 2295, 8.1

TLSVersion1_0

TLSVersionread-onlyView source

Default: 0

Constants for dynamic backend TLS configuration

TLSVersion1_1

TLSVersionread-onlyView source

Default: 1

Constants for dynamic backend TLS configuration

TLSVersion1_2

TLSVersionread-onlyView source

Default: 2

Constants for dynamic backend TLS configuration

TLSVersion1_3

TLSVersionread-onlyView source

Default: 3

Constants for dynamic backend TLS configuration

TimeFormat

untyped stringread-onlyView source

Default: "Mon, 02 Jan 2006 15:04:05 GMT"

TimeFormat is the time format to use when generating times in HTTP headers. It is like time.RFC1123 but hard-codes GMT as the time zone. The time being formatted must be in UTC for Format to generate the correct format.

For parsing this time format, see ParseTime.

TrailerPrefix

untyped stringread-onlyView source

Default: "Trailer:"

TrailerPrefix is a magic prefix for ResponseWriter.Header map keys that, if present, signals that the map entry is actually for the response trailers, and not the response headers. The prefix is stripped after the ServeHTTP call finishes and the values are sent in the trailers.

This mechanism is intended only for trailers that are not known prior to the headers being written. If the set of trailers is fixed or known before the header is written, the normal Go trailers mechanism is preferred.

Variables

ErrBackendNameInUse

errorView source

Default: errors.New("backend name already in use")

ErrBackendNameInUse indicates the backend name is already in use.

ErrBackendNotFound

errorView source

Default: errors.New("backend not found")

ErrBackendNotFound indicates the provided backend was not found.

ErrCachingNotSupported

errorView source

Default: errors.New("fsthttp: caching not supported")

ErrCachingNotSupported is returned by Send() if the requested caching type (host or guest) is not supported by the request configuration or runtime.

ErrClosed

errorView source

Default: errors.New("connection has been closed")

ErrClosed is returned when attempting to write to a ResponseWriter whose network connection has been closed.

ErrDynamicBackendDisallowed

errorView source

Default: errors.New("dynamic backends not supported for this service")

ErrDynamicBackendDisallowed indicates the service is not allowed to create dynamic backends.

ErrFanoutNotEnabled

errorView source

Default: errors.New("fanout or websockets are not enabled on this service; please contact support for help")

ErrHandoffNotSupported

errorView source

Default: errors.New("handoff not supported on this request")

ErrInvalidStatusCode

errorView source

Default: errors.New("invalid HTTP status code")

ErrInvalidStatusCode is returned when attempting to write a resposne with an invalid HTTP status code.

ErrNoCookie

errorView source

Default: errors.New("fsthttp: named cookie not present")

ErrNoCookie is returned by Request's Cookie method when a cookie is not found.

ErrRequestCollapse

errorView source

Default: errors.New("error during request collapse")

ErrTrailersNotReady

errorView source

Default: errors.New("trailers not available")

ErrUnexpected

errorView source

Default: errors.New("unexpected error")

ErrUnexpected indicates an unexpected error occurred.

RequestLimits

LimitsView source

RequestLimits are the limits for the components of an HTTP request.

ResponseLimits

LimitsView source

ResponseLimits are the limits for the components of an HTTP response.