postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2019 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresConnection

func NewPostgresConnection(url string) (*pgx.Conn, error)

func NewPostgresPool

func NewPostgresPool(url string) (*pgx.ConnPool, error)

Types

type CollectorWrappedInTransaction

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

func NewCollectorWrappedInTransaction

func NewCollectorWrappedInTransaction(decorated store.Collector, connection Transactionable) *CollectorWrappedInTransaction

func (*CollectorWrappedInTransaction) Collect

type Consumer

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

func NewConsumer

func NewConsumer(url string) (*Consumer, error)

func (*Consumer) ConsumeFor

func (c *Consumer) ConsumeFor(channel chan cloudevents.Event)

type Execable

type Execable interface {
	ExecEx(ctx context.Context, sql string, options *pgx.QueryExOptions, arguments ...interface{}) (commandTag pgx.CommandTag, err error)
}

type Lock

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

func NewLock

func NewLock(pool *pgx.ConnPool) *Lock

func (*Lock) Lock

func (l *Lock) Lock(ctx context.Context, identifier string) error

func (*Lock) Release

func (l *Lock) Release(identifier string) error

type Publisher

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

func NewPublisher

func NewPublisher(conn Execable) *Publisher

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, stream string, event *cloudevents.Event) error

type Queryable

type Queryable interface {
	QueryEx(ctx context.Context, sql string, options *pgx.QueryExOptions, args ...interface{}) (rows *pgx.Rows, err error)
	QueryRowEx(ctx context.Context, sql string, options *pgx.QueryExOptions, args ...interface{}) *pgx.Row
}

type ReadableQueryResult

type ReadableQueryResult interface {
	Scan(dest ...interface{}) (err error)
}

type Storage

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

func NewStorage

func NewStorage(conn Queryable) *Storage

func (*Storage) Find

func (s *Storage) Find(ctx context.Context, id string) (*cloudevents.Event, error)

func (*Storage) MatchingStream

func (s *Storage) MatchingStream(ctx context.Context, matcher events.Matcher) chan cloudevents.Event

func (*Storage) Store

func (s *Storage) Store(ctx context.Context, stream string, event *cloudevents.Event) error

type Transactionable

type Transactionable interface {
	BeginEx(ctx context.Context, txOptions *pgx.TxOptions) (*pgx.Tx, error)
}

Jump to

Keyboard shortcuts

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