connutil

package
v0.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 8, 2017 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CassandraConnectionProducer

type CassandraConnectionProducer struct {
	Hosts             string      `json:"hosts" structs:"hosts" mapstructure:"hosts"`
	Username          string      `json:"username" structs:"username" mapstructure:"username"`
	Password          string      `json:"password" structs:"password" mapstructure:"password"`
	TLS               bool        `json:"tls" structs:"tls" mapstructure:"tls"`
	InsecureTLS       bool        `json:"insecure_tls" structs:"insecure_tls" mapstructure:"insecure_tls"`
	ProtocolVersion   int         `json:"protocol_version" structs:"protocol_version" mapstructure:"protocol_version"`
	ConnectTimeoutRaw interface{} `json:"connect_timeout" structs:"connect_timeout" mapstructure:"connect_timeout"`
	TLSMinVersion     string      `json:"tls_min_version" structs:"tls_min_version" mapstructure:"tls_min_version"`
	Consistency       string      `json:"consistency" structs:"consistency" mapstructure:"consistency"`
	PemBundle         string      `json:"pem_bundle" structs:"pem_bundle" mapstructure:"pem_bundle"`
	PemJSON           string      `json:"pem_json" structs:"pem_json" mapstructure:"pem_json"`

	Initialized bool
	Type        string

	sync.Mutex
	// contains filtered or unexported fields
}

CassandraConnectionProducer implements ConnectionProducer and provides an interface for cassandra databases to make connections.

func (*CassandraConnectionProducer) Close

func (*CassandraConnectionProducer) Connection

func (c *CassandraConnectionProducer) Connection() (interface{}, error)

func (*CassandraConnectionProducer) Initialize

func (c *CassandraConnectionProducer) Initialize(conf map[string]interface{}, verifyConnection bool) error

type ConnectionProducer

type ConnectionProducer interface {
	Close() error
	Initialize(map[string]interface{}, bool) error
	Connection() (interface{}, error)

	sync.Locker
}

ConnectionProducer can be used as an embeded interface in the Database definition. It implements the methods dealing with individual database connections and is used in all the builtin database types.

type SQLConnectionProducer

type SQLConnectionProducer struct {
	ConnectionURL            string      `json:"connection_url" structs:"connection_url" mapstructure:"connection_url"`
	MaxOpenConnections       int         `json:"max_open_connections" structs:"max_open_connections" mapstructure:"max_open_connections"`
	MaxIdleConnections       int         `json:"max_idle_connections" structs:"max_idle_connections" mapstructure:"max_idle_connections"`
	MaxConnectionLifetimeRaw interface{} `json:"max_connection_lifetime" structs:"max_connection_lifetime" mapstructure:"max_connection_lifetime"`

	Type string

	Initialized bool

	sync.Mutex
	// contains filtered or unexported fields
}

SQLConnectionProducer implements ConnectionProducer and provides a generic producer for most sql databases

func (*SQLConnectionProducer) Close

func (c *SQLConnectionProducer) Close() error

Close attempts to close the connection

func (*SQLConnectionProducer) Connection

func (c *SQLConnectionProducer) Connection() (interface{}, error)

func (*SQLConnectionProducer) Initialize

func (c *SQLConnectionProducer) Initialize(conf map[string]interface{}, verifyConnection bool) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL