database

package
v9.9.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(sessionVariables map[string]string, logger lager.Logger) *Client

func (*Client) Check

func (c *Client) Check(db *sql.DB, timestamp time.Time) (bool, error)

Check returns (true,nil) when the provided data matches the actual data Check returns (false,nil) when the provided data does not match the actual data Check returns (false,error) if an error occurred while determining whether data matches. Check will never return (true,error) Check swallows sql.ErrNoRow

Check uses a transaction block, even though it's only performing reads because that's the only way to ensure that all commands are executed on the same connection. See https://github.com/go-sql-driver/mysql/issues/208

func (*Client) Cleanup

func (c *Client) Cleanup(db *sql.DB) error

func (*Client) Setup

func (c *Client) Setup(db *sql.DB) error

func (*Client) Write

func (c *Client) Write(db *sql.DB, timestamp time.Time) error

type ConnectionFactory

type ConnectionFactory struct {
	OpenConn func(dsn string) (*sql.DB, error)
	// contains filtered or unexported fields
}

func NewConnectionFactoryFromConfig

func NewConnectionFactoryFromConfig(
	c *config.Config,
	switchboardClients []SwitchboardClient,
	logger lager.Logger,
) *ConnectionFactory

func (*ConnectionFactory) Conns

func (c *ConnectionFactory) Conns() ([]*models.NamedConnection, error)

func (*ConnectionFactory) WriteConn

func (c *ConnectionFactory) WriteConn() (*models.NamedConnection, error)

type SwitchboardClient

type SwitchboardClient interface {
	ActiveBackendHost() (string, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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