Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Host string `fig:"host"` User string `fig:"user"` Password string `fig:"password"` Database string `fig:"database"` SSLMode string `fig:"ssl_mode" default:"disable"` MaxOpenConns int `fig:"max_open_conns"` MaxIdleConns int `fig:"max_idle_conns"` ConnMaxLifetime time.Duration `fig:"conn_max_lifetime"` ConnMaxIdleTime time.Duration `fig:"conn_max_idle_time"` }
Config contains PgSQL configuration value.
type Repository ¶
type Repository struct { repository.User repository.Last repository.Capabilities repository.Offline repository.BlockList repository.Private repository.Roster repository.VCard repository.Locker // contains filtered or unexported fields }
Repository represents a PgSQL repository implementation.
func New ¶
func New(cfg Config, logger kitlog.Logger) *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.