Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { MaxIdleConns int MaxOpenConns int ConnMaxIdleTime time.Duration ConnMaxLifetime time.Duration }
Config contais PgSQL configuration value.
type Repository ¶
type Repository struct { repository.User repository.Last repository.Capabilities repository.Offline repository.BlockList repository.Private repository.Roster repository.VCard // contains filtered or unexported fields }
Repository represents a PgSQL repository implementation.
func New ¶
func New(host, username, password, database, sslMode string, cfg Config) *Repository
New creates and returns an initialized PgSQL Repository instance.
func (*Repository) InTransaction ¶
func (r *Repository) InTransaction(ctx context.Context, f func(ctx context.Context, tx repository.Transaction) error) error
InTransaction generates a PgSQL transaction and completes it after it's being used by f function.
Click to show internal directories.
Click to hide internal directories.