postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 5432
)

Variables

This section is empty.

Functions

func New

func New(opts Opts, queryTimeout time.Duration, logger *zap.Logger) (persistence.Persister, error)

func NewSQLClient

func NewSQLClient(opts Opts, logger *zap.Logger) (*sql.DB, error)

Types

type Opts

type Opts struct {
	DBName           string
	Hostname         string
	ReadOnlyHostname string
	Port             int
	User             string
	Password         string
	EnableTLS        bool
	CABundleFSPath   string
	SQLOpen          func(driver persistence.Driver, dataSourceName string) (*sql.DB, error)
}

type Postgres

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

func (*Postgres) Close

func (s *Postgres) Close() error

func (*Postgres) Delete

func (s *Postgres) Delete(ctx context.Context, key string) error

func (*Postgres) Get

func (s *Postgres) Get(ctx context.Context, key string) ([]byte, error)

func (*Postgres) List

func (s *Postgres) List(ctx context.Context, prefix string, opts *persistence.ListOpts) (persistence.ListResult,
	error,
)

func (*Postgres) Put

func (s *Postgres) Put(ctx context.Context, key string, value []byte) error

func (*Postgres) Tx

func (s *Postgres) Tx(ctx context.Context) (persistence.Tx, error)

Jump to

Keyboard shortcuts

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