Documentation ¶
Index ¶
Constants ¶
View Source
const (
DefaultMaxIdleConnsPerHost = 64
)
Variables ¶
This section is empty.
Functions ¶
func NewConnection ¶
func NewConnection(config ConnectionConfig) (driver.Connection, error)
NewConnection creates a new HTTP connection based on the given configuration settings.
Types ¶
type ConnectionConfig ¶
type ConnectionConfig struct { // Endpoints holds 1 or more URL's used to connect to the database. // In case of a connection to an ArangoDB cluster, you must provide the URL's of all coordinators. Endpoints []string // TLSConfig holds settings used to configure a TLS (HTTPS) connection. // This is only used for endpoints using the HTTPS scheme. TLSConfig *tls.Config // Transport allows the use of a custom round tripper. // If Transport is not of type `*http.Transport`, the `TLSConfig` property is not used. // Otherwise a `TLSConfig` property other than `nil` will overwrite the `TLSClientConfig` // property of `Transport`. // // When using a custom `http.Transport`, make sure to set the `MaxIdleConnsPerHost` field at least as // high as the maximum number of concurrent requests you will make to your database. // A lower number will cause the golang runtime to create additional connections and close them // directly after use, resulting in a large number of connections in `TIME_WAIT` state. // When this value is not set, the driver will set it to 64 automatically. Transport http.RoundTripper // DontFollowRedirect; if set, redirect will not be followed, response from the initial request will be returned without an error // DontFollowRedirect takes precendance over FailOnRedirect. DontFollowRedirect bool // FailOnRedirect; if set, redirect will not be followed, instead the status code is returned as error FailOnRedirect bool // Cluster configuration settings cluster.ConnectionConfig // ContentType specified type of content encoding to use. ContentType driver.ContentType }
ConnectionConfig provides all configuration options for a HTTP connection.
Click to show internal directories.
Click to hide internal directories.