persistence

package
v0.0.0-...-6d13c91 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const RetryCount int = 50

RetryCount is a number of retries when trying to open the database

Variables

This section is empty.

Functions

This section is empty.

Types

type AdvisoryLocker

type AdvisoryLocker interface {
	Lock(ctx context.Context, key string) error
	Unlock(ctx context.Context, key string) error
	TryLock(ctx context.Context, key string) (bool, error)
}

AdvisoryLocker represents Advisory locking in Postgres

type Connection

type Connection interface {
	GetAdvisoryLocker() AdvisoryLocker
	Close() error
}

Connection represents database connection

type DatabaseConnector

type DatabaseConnector interface {
	GetConnection(ctx context.Context) (Connection, error)
}

DatabaseConnector returns database connection

func Configure

func Configure(ctx context.Context, conf persistence.DatabaseConfig) (DatabaseConnector, func() error, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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