connection

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Limiter

type Limiter struct {
	dbClient.Client
	// contains filtered or unexported fields
}

Limiter implements a circuit breaker pattern for database connections. It tracks consecutive errors and blocks requests for a duration when the error limit is reached. After the duration, it allows requests again.

func NewLimiter

func NewLimiter(client dbClient.Client, limit int64, duration time.Duration) *Limiter

func (*Limiter) Close

func (l *Limiter) Close() error

func (*Limiter) Driver

func (l *Limiter) Driver() dbClient.Driver

func (*Limiter) Exec

func (l *Limiter) Exec(s string, i ...interface{}) (sql.Result, error)

func (*Limiter) ExecContext

func (l *Limiter) ExecContext(ctx context.Context, s string, i ...interface{}) (sql.Result, error)

func (*Limiter) Query

func (l *Limiter) Query(s string, i ...interface{}) (*sql.Rows, error)

func (*Limiter) QueryContext

func (l *Limiter) QueryContext(ctx context.Context, s string, i ...interface{}) (*sql.Rows, error)

func (*Limiter) QueryRow

func (l *Limiter) QueryRow(s string, i ...interface{}) *sql.Row

func (*Limiter) QueryRowContext

func (l *Limiter) QueryRowContext(ctx context.Context, s string, i ...interface{}) *sql.Row

func (*Limiter) SQL

func (l *Limiter) SQL() *sql.DB

Jump to

Keyboard shortcuts

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