store

package
v0.0.0-...-64046f9 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrTooManyAffectedRows returned when store modifes too many rows.
	ErrTooManyAffectedRows = errors.New("too many affected rows")
)

Functions

This section is empty.

Types

type Migrator

type Migrator interface {
	Up(ctx context.Context) error
	Down(ctx context.Context) error
}

Migrator defines generic interface for migrations.

type Store

type Store interface {
	StoreFactory
	StoreTx
	StoreMigrator
}

Store define generic interface for database with transaction support

type StoreFactory

type StoreFactory interface {
	User() core.UserStore
	File() core.FileStore
	Download() core.DownloadStore
	Chat() core.ChatStore
}

StoreFactory define interface of factory methods

type StoreMigrator

type StoreMigrator interface {
	Migrator() Migrator
}

StoreMigrator define method for migrations of store

type StoreTx

type StoreTx interface {
	// TxFactory returns function for create transaction scopes.
	Tx(ctx context.Context, txFunc TxFunc) error
}

StoreTx define interface of transactional of store.

type TxFunc

type TxFunc func(ctx context.Context) error

TxFunc define signature of callback used in tx block

type Txier

type Txier func(ctx context.Context, txFunc TxFunc) error

Txier define function to start tx block

Directories

Path Synopsis
dal

Jump to

Keyboard shortcuts

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