Documentation ¶
Index ¶
- Constants
- Variables
- func CreateClient(cfg Config) (*engine.Client, error)
- func IsSocketConfigured(cfg Config) bool
- type Config
- func (cfg *Config) SetDialTimeout(dialTimeout uint)
- func (cfg *Config) SetHttpIdleConnTimeout(httpIdleConnTimeout uint)
- func (cfg *Config) SetHttpReadBufferSize(httpReadBufferSize int)
- func (cfg *Config) SetHttpUrl(httpUrl string)
- func (cfg *Config) SetHttpWriteBufferSize(httpWriteBufferSize int)
- func (cfg *Config) SetSocket(socketPath string)
- func (cfg *Config) SetTimeout(timeout uint)
- func (cfg *Config) SetTlsClientCert(tlsClientCert string)
- func (cfg *Config) SetTlsClientKey(tlsClientKey string)
- func (cfg *Config) SetTlsInsecureSkipVerify(tlsInsecureSkipVerify bool)
- func (cfg *Config) SetTlsMode(tlsMode string)
- func (cfg *Config) SetTlsRootCA(tlsRootCA string)
- func (cfg *Config) Validate() error
Constants ¶
View Source
const ( NoConnection string = "none" UnixDomainSocketConnection string = "unix" HttpConnection string = "http" )
View Source
const ( TlsOff string = "off" TlsStrict string = "strict" )
Variables ¶
View Source
var DefaultConfig = Config{ Timeout: 5, DialTimeout: 1, HttpIdleConnTimeout: 10, TlsMode: TlsOff, }
View Source
var NoConnectionConfig = Config{ ConnectionType: NoConnection, TlsMode: TlsOff, }
Functions ¶
func IsSocketConfigured ¶
Types ¶
type Config ¶
type Config struct { ConnectionType string `toml:"-"` // connection type is not loaded from toml Socket string // filename for unix domain socket WorkDir string // directory for unix domain socket HttpUrl string // transaction manager URL for HTTP connection Timeout uint // timeout for overall client call (seconds), zero means timeout disabled DialTimeout uint // timeout for connecting to unix socket (seconds) HttpIdleConnTimeout uint // timeout for idle http connection (seconds), zero means timeout disabled HttpWriteBufferSize int // size of http connection write buffer (bytes), if zero then uses http.Transport default HttpReadBufferSize int // size of http connection read buffer (bytes), if zero then uses http.Transport default TlsMode string // whether TLS is enabled on HTTP connection (can be "off" or "strict") TlsRootCA string // path to file containing certificate for root CA (defaults to host's certificates) TlsClientCert string // path to file containing client certificate (or chain of certs) TlsClientKey string // path to file containing client's private key TlsInsecureSkipVerify bool // if true then does not verify that server certificate is CA signed }
func FetchConfig ¶
FetchConfig sets up the configuration for the connection to a txn manager. It will accept a path to an ipc file or a path to a config file, and returns the full configuration info for the specified type of connection.
func FetchConfigOrIgnore ¶
This will accept path as any of the following and return relevant configuration:
- path set to "ignore"
- path to an ipc file
- path to a config file
func LoadConfigFile ¶
func (*Config) SetDialTimeout ¶
func (*Config) SetHttpIdleConnTimeout ¶
func (*Config) SetHttpReadBufferSize ¶
func (*Config) SetHttpUrl ¶
func (*Config) SetHttpWriteBufferSize ¶
func (*Config) SetTimeout ¶
func (*Config) SetTlsClientCert ¶
func (*Config) SetTlsClientKey ¶
func (*Config) SetTlsInsecureSkipVerify ¶
func (*Config) SetTlsMode ¶
func (*Config) SetTlsRootCA ¶
Click to show internal directories.
Click to hide internal directories.