connection

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	Copy() Connection
	Close(ctx context.Context) error
	Connect(ctx context.Context, driver string, connString string) error
	Exec(ctx context.Context, disableLog LogInfo, query string, args ...interface{}) error
}

type DefaultConnector

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

func NewDefaultConnector

func NewDefaultConnector(logger logr.Logger) *DefaultConnector

func (*DefaultConnector) Close

func (d *DefaultConnector) Close(_ context.Context) error

func (*DefaultConnector) Connect

func (d *DefaultConnector) Connect(ctx context.Context, driver, connString string) error

func (*DefaultConnector) Copy

func (d *DefaultConnector) Copy() Connection

func (*DefaultConnector) Exec

func (d *DefaultConnector) Exec(ctx context.Context, disableLog LogInfo, query string, args ...interface{}) error

type FakeConnection

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

func NewFakeConnection

func NewFakeConnection() *FakeConnection

func (*FakeConnection) Close

func (m *FakeConnection) Close(_ context.Context) error

func (*FakeConnection) Connect

func (m *FakeConnection) Connect(_ context.Context, driver, connString string) error

func (*FakeConnection) Connections

func (m *FakeConnection) Connections() map[string]bool

func (*FakeConnection) Copy

func (m *FakeConnection) Copy() Connection

func (*FakeConnection) Exec

func (m *FakeConnection) Exec(_ context.Context, _ LogInfo, query string, args ...interface{}) error

func (*FakeConnection) Queries

func (m *FakeConnection) Queries() map[string]int

func (*FakeConnection) ResetDB

func (m *FakeConnection) ResetDB()

type LogInfo

type LogInfo int
const (
	DisableLogger LogInfo = 1
	EnableLogger  LogInfo = 0
)

Jump to

Keyboard shortcuts

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