store

package
v0.0.0-...-08d8c9a Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPostgresStore

func NewPostgresStore(postgresURL string) (*pgxpool.Pool, error)

NewPostgresStore creates new Postgres connection pool using specified DSN

Types

type Config

type Config struct {
	PostgresURL string // URL for connecting to Postgres service
}

Config defines configuration for Store

func TestStoreConfig

func TestStoreConfig(_ *testing.T) *Config

TestStoreConfig returns config for test purposes

type Store

type Store struct {
	Config *Config
	PgDB   *pgxpool.Pool
}

Store is the persistent storage for application data

func NewStore

func NewStore(ctx context.Context, c *Config) (*Store, error)

NewStore creates new store

func TestStore

func TestStore(t *testing.T, config *Config) (*Store, func(...string))

TestPostgresStore provides store for testing with teardown function which allow to cleanup store after tests

func (*Store) Close

func (s *Store) Close()

Close gracefully closes connections to store services

Jump to

Keyboard shortcuts

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