store

package
v0.0.0-...-589da53 Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const SQLMigrationsDir = "migrations"

Variables

View Source
var (
	ErrTxNotFound      = errors.New("transaction not found")
	ErrMultipleTxFound = errors.New("multiple transactions found")
)
View Source
var EmbedMigrations embed.FS

Functions

func DropAllTablesAndViews

func DropAllTablesAndViews(log *logging.Logger, config Config) error

func MigrateToLatestSchema

func MigrateToLatestSchema(log *logging.Logger, config Config) error

Types

type Config

type Config struct {
	Postgres config.PostgresConnection `group:"database" namespace:"postgres"`
}

func NewDefaultConfig

func NewDefaultConfig() Config

type Store

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

func MustNewStore

func MustNewStore(config Config, log *logging.Logger) *Store

func NewStore

func NewStore(config Config, log *logging.Logger) (*Store, error)

func (*Store) GetTransaction

func (s *Store) GetTransaction(ctx context.Context, txID string) (*pb.Transaction, error)

func (*Store) ListTransactions

func (s *Store) ListTransactions(ctx context.Context,
	filters map[string]string,
	limit uint32,
	before *entities.TxCursor,
	after *entities.TxCursor,
) ([]*pb.Transaction, error)

Jump to

Keyboard shortcuts

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