Documentation ¶
Overview ¶
Package pool provides access to SQLite databases and their connections.
It should be used only by the metadata package.
Index ¶
- type Pool
- func (p *Pool) Close()
- func (p *Pool) Collect(ch chan<- prometheus.Metric)
- func (p *Pool) Describe(ch chan<- *prometheus.Desc)
- func (p *Pool) Drop(ctx context.Context, name string) bool
- func (p *Pool) GetExisting(ctx context.Context, name string) *fsql.DB
- func (p *Pool) GetOrCreate(ctx context.Context, name string) (*fsql.DB, bool, error)
- func (p *Pool) List(ctx context.Context) []string
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 SQLite databases and their connections.
func New ¶
New creates a pool for SQLite databases in the directory specified by SQLite URI.
All databases are opened on creation.
The returned map is the initial set of existing databases. It should not be modified.
func (*Pool) Close ¶
func (p *Pool) Close()
Close closes all databases in the pool and frees all resources.
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) Drop ¶
Drop closes and removes a database by valid name.
It does nothing if the database does not exist.
Returned boolean value indicates whether the database was removed.
func (*Pool) GetExisting ¶
GetExisting returns an existing database by valid name, or nil.
func (*Pool) GetOrCreate ¶
GetOrCreate returns an existing database by valid name, or creates a new one.
Returned boolean value indicates whether the database was created.