postgres

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresStorage

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

func New

func New(db *sql.DB) *PostgresStorage

New creates sqlite3 storage. If you have a lot of candidates (50 and more) it's recomended to do db.SetMaxOpenConns(1) before calling New.

func (*PostgresStorage) Get

func (sq *PostgresStorage) Get(ctx context.Context, key string) (string, error)

func (*PostgresStorage) Renew

func (sq *PostgresStorage) Renew(ctx context.Context, key string, deadline time.Time) error

func (*PostgresStorage) SetNX

func (sq *PostgresStorage) SetNX(ctx context.Context, key string, val string, deadline time.Time) (bool, error)

Jump to

Keyboard shortcuts

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