Documentation ¶
Index ¶
- Constants
- type InfluxConnectionParams
- type InfluxConnectionService
- type MockPgxW
- func (t *MockPgxW) Begin() (*pgx.Tx, error)
- func (t *MockPgxW) Close() error
- func (t *MockPgxW) CopyFrom(tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int, error)
- func (t *MockPgxW) Exec(sql string, arguments ...interface{}) (commandTag pgx.CommandTag, err error)
- func (t *MockPgxW) Query(sql string, args ...interface{}) (*pgx.Rows, error)
- type PgxWrap
- type TSConnectionService
Constants ¶
View Source
const ( UserEnvVar = "INFLUX_USERNAME" PassEnvVar = "INFLUX_PASSWORD" )
Environment variable names to be used for the InfluxDB connection
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InfluxConnectionParams ¶
type InfluxConnectionParams struct { Server string Username string Password string Database string UnsafeHTTPS bool }
InfluxConnectionParams represents the parameters required to open a InfluxDB connection
type InfluxConnectionService ¶
type InfluxConnectionService interface {
NewConnection(*InfluxConnectionParams) (influx.Client, error)
}
InfluxConnectionService creates new clients connected to some Influx server
func NewInfluxConnectionService ¶
func NewInfluxConnectionService() InfluxConnectionService
NewInfluxConnectionService creates a new instance of the service
type MockPgxW ¶
type MockPgxW struct { ExecRes []pgx.CommandTag ExecErrs []error CurrentExec int QueryRes []*pgx.Rows QueryErrs []error CurrentQ int ExpQ []string ExpQArgs [][]interface{} ExpExec []string ExpExecArgs [][]interface{} BeginRes []*pgx.Tx BeginErr []error CurrentBegin int CopyFromErr []error CurrentCopyFrom int ExpCopyFromTab []pgx.Identifier ExpCopyFromCol [][]string }
MockPgxW is a mock implementation of the PgxWrapper.
func (*MockPgxW) CopyFrom ¶
func (t *MockPgxW) CopyFrom(tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int, error)
CopyFrom uses COPY to insert data.
type PgxWrap ¶
type PgxWrap interface { Begin() (*pgx.Tx, error) CopyFrom(tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int, error) Exec(sql string, arguments ...interface{}) (commandTag pgx.CommandTag, err error) Query(sql string, args ...interface{}) (*pgx.Rows, error) Close() error }
PgxWrap represents a wrapper interface around pgx.Conn, for easier testing.
func NewPgxWrapper ¶
NewPgxWrapper creates a new pgx.Conn wrapper.
type TSConnectionService ¶
TSConnectionService creates new timescale db connections
func NewTSConnectionService ¶
func NewTSConnectionService() TSConnectionService
NewTSConnectionService creates a new TSConnectionService instance
Click to show internal directories.
Click to hide internal directories.