BackendOptions
type BackendOptions struct { // contains filtered or unexported fields}BackendOption is a builder for the configuration of a dynamic backend.
Methods
BetweenBytesTimeout
View sourceBetweenBytesTimeout sets the maximum duration that Fastly will wait while receiving no data on a download from a backend.
Parameters
Returns
CACert
View sourcefunc (b *BackendOptions) CACert(cert string) *BackendOptionsCACert sets the CA certificate to use when checking the validity of the backend. Setting this will enable SSL for the connection as a side effect.
If CACert is not provided (default), the backend's certificate is validated using a set of public root CAs.
Parameters
- cert: string
Returns
CertHostname
View sourcefunc (b *BackendOptions) CertHostname(host string) *BackendOptionsCertHostname sets the hostname that the server certificate should declare. Setting this will enable SSL for the connection as a side effect.
If CertHostname is not provided (default), the server certificate's hostname can have any value.
Parameters
- host: string
Returns
Ciphers
View sourcefunc (b *BackendOptions) Ciphers(ciphers string) *BackendOptionsCiphers sets the list of OpenSSL ciphers to support for connections to this origin. Setting this will enable SSL for the connection as a side effect.
Parameters
- ciphers: string
Returns
ClientCertificate
View sourcefunc (b *BackendOptions) ClientCertificate(certificate string, key secretstore.Secret) *BackendOptionsClientCertificate sets the client certificate to be provided to the server as part of the SSL handshake. Setting this will enable SSL for the connection as a side effect.
Parameters
- certificate: string
- key: secretstore.Secret
Returns
ConnectTimeout
View sourceConnectTimeout sets the maximum duration to wait for a connection to this backend to be established.
Parameters
Returns
FirstByteTimeout
View sourceFirstByteTimeout sets the maximum duration to wait for the server response to begin after a TCP connection is established and the request has been sent.
Parameters
Returns
Healthcheck
View sourceHealthcheck sets the backend health check configuration
NOTE: Support for this feature is experimental and may be removed at any time.
Parameters
Returns
HostOverride
View sourcefunc (b *BackendOptions) HostOverride(host string) *BackendOptionsHostOverride sets the HTTP Host header on connections to this backend.
Parameters
- host: string
Returns
HTTPKeepaliveTime
View sourceHTTPKeepaliveTime configures how long to allow HTTP connections to remain idle in a connection pool before it should be considered closed.
Parameters
Returns
MaxConnections
View sourcefunc (b *BackendOptions) MaxConnections(count uint32) *BackendOptionsMaxConnections sets how many connections to allow in the connection pool for this backend.
0 is treated as unlimited. The default is 200.
Note that this limit is best determined experimentally, since the total number of connections to the backend will depend on POP sizes, HTTP keepalive limits, and the traffic patterns for individual POPs.
Parameters
- count: uint32
Returns
MaxLifetime
View sourceMaxLifetime sets an upper bound for how long a pooled HTTP keepalive connection is allowed to have been open before we stop trying to reuse it.
0ms is treated as unlimited. The default is 0ms.
Parameters
Returns
MaxUse
View sourcefunc (b *BackendOptions) MaxUse(count uint32) *BackendOptionsMaxUse sets how many times an HTTP keepalive connection can be reused in a connection pool.
0 is treated as unlimited. The default is 0.
Parameters
- count: uint32
Returns
PoolConnections
View sourcefunc (b *BackendOptions) PoolConnections(poolingOn bool) *BackendOptionsPoolConnections allows users to turn connection pooling on or off for the backend. Pooling allows the Compute platform to reuse connections across multiple executions, resulting in lower resource use at the server (because it does not need to repeat the TCP handhsake and TLS authentication when the connection is reused). The default is to pool connections. Set this to false to create a new connection to the backend for every incoming request.
Parameters
- poolingOn: bool
Returns
PreferIPV6
View sourcefunc (b *BackendOptions) PreferIPV6(v bool) *BackendOptionsPreferIPV6 sets whether to prefer trying IPv6 connections first before IPv4 when a hostname has both A and AAAA records.
This defaults to true.
Parameters
- v: bool
Returns
SNIHostname
View sourcefunc (b *BackendOptions) SNIHostname(host string) *BackendOptionsSNIHostname sets the SNI hostname to use on connections to this backend. Setting this will enable SSL for the connection as a side effect.
Parameters
- host: string
Returns
SSLMaxVersion
View sourceSSLMaxVersion sets the maximum allowed TLS version on SSL connections to this backend. Setting this will enable SSL for the connection as a side effect.
Parameters
- max: TLSVersion
Returns
SSLMinVersion
View sourceSSLMinVersion sets the minimum allowed TLS version on SSL connections to this backend. Setting this will enable SSL for the connection as a side effect.
Parameters
- min: TLSVersion
Returns
TCPKeepaliveEnable
View sourcefunc (b *BackendOptions) TCPKeepaliveEnable(enable bool) *BackendOptionsTCPKeepaliveEnable sets whether or not to use TCP keepalives to try to maintain the connetion to the backend.
Parameters
- enable: bool
Returns
TCPKeepaliveInterval
View sourceTCPKeepaliveInterval sets the interval to use when sending TCP keepalive probes. Intervals of less than 1 second will be rounded up to 1 second.
Setting this value implicitly enables TCP keepalives. If you are calling both
this method and TCPKeepAliveEnable with dynamically loaded or generated
values, make sure to call TCPKeepAliveEnable last.
Parameters
- interval: time.Duration
Returns
TCPKeepaliveProbes
View sourcefunc (b *BackendOptions) TCPKeepaliveProbes(count uint32) *BackendOptionsTCPKeepaliveProbes sets how many unanswered TCP probes we should send to the backend before we consider the connection dead. Setting this value implicitly enables TCP keepalives.
Parameters
- count: uint32
Returns
TCPKeepaliveTime
View sourceTCPKeepaliveTime sets how long to wait after the last data was sent before starting to send keepalive probes. Setting this value implicitly enables TCP keepalives.
Parameters
- interval: time.Duration
Returns
UseGRPC
View sourcefunc (b *BackendOptions) UseGRPC(v bool) *BackendOptionsUseGRPC sets whether or not to connect to the backend via gRPC
Parameters
- v: bool
Returns
UseSSL
View sourcefunc (b *BackendOptions) UseSSL(v bool) *BackendOptionsUseSSL sets whether or not to require TLS for connections to this backend.
When using TLS, Fastly checks the validity of the backend's certificate, and fails the connection if the certificate is invalid. This check is not optional: an invalid certificate will cause the backend connection to fail (but read on).
By default, the validity check does not require that the certificate hostname matches the hostname of your request. You can use BackendOptions.CertHostname to request a check of the certificate hostname.
By default, certificate validity uses a set of public certificate authorities. You can specify an alternative CA using BackendOptions.CACert.
Parameters
- v: bool
Returns