pool

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package pool provides access to MySQL connections.

It should be used only by the metadata package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

Pool provides access to MySQL connections.

func New

func New(u string, l *zap.Logger, sp *state.Provider) (*Pool, error)

New creates a new Pool.

func (*Pool) Close

func (p *Pool) Close()

Close closes all connections in the pool.

func (*Pool) Collect

func (p *Pool) Collect(ch chan<- prometheus.Metric)

Collect implements Prometheus.Collector.

func (*Pool) Describe

func (p *Pool) Describe(ch chan<- *prometheus.Desc)

Describe implements Prometheus.Collector.

func (*Pool) Get

func (p *Pool) Get(username, password string) (*fsql.DB, error)

Get returns a pool of connections to MySQL database for that username/password combination.

func (*Pool) GetAny

func (p *Pool) GetAny() *fsql.DB

GetAny returns a random open pool of connections to MySQL, or nil if none are available.

Jump to

Keyboard shortcuts

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