Documentation
¶
Overview ¶
File is part of the build only if cgo is enabled. Otherwise, the compilation will complains about missing type sqlite3,Error It is due to the fact than sqlite lib use import "C" statement. The presence of these statement during the build exclude the file if CGO is disabled.
Index ¶
- Constants
- Variables
- func DriverModule(cfg ModuleConfig) fx.Option
- func NewCachedDBDriver(name string, flavor Flavor, where string) *cachedDBDriver
- func NewInMemorySQLiteDriver() *cachedDBDriver
- func NewOpenCloseDBDriver(name string, flavor Flavor, connString ConnStringResolver) *openCloseDBDriver
- func SQLDriverName(f Flavor) string
- func SQLiteFileConnString(path string) string
- func TestingModule() fx.Option
- func UpdateSQLDriverMapping(flavor Flavor, name string)
- type ConnStringResolver
- type Flavor
- type ModuleConfig
- type PostgresConfig
- type SQLiteConfig
- type Store
- func (s *Store) AggregateBalances(ctx context.Context, address string) (map[string]int64, error)
- func (s *Store) AggregateVolumes(ctx context.Context, address string) (map[string]map[string]int64, error)
- func (s *Store) Close(ctx context.Context) error
- func (s *Store) CountAccounts(ctx context.Context) (int64, error)
- func (s *Store) CountMeta(ctx context.Context) (int64, error)
- func (s *Store) CountTransactions(ctx context.Context) (int64, error)
- func (s *Store) FindAccounts(ctx context.Context, q query.Query) (query.Cursor, error)
- func (s *Store) FindTransactions(ctx context.Context, q query.Query) (query.Cursor, error)
- func (s *Store) GetMeta(ctx context.Context, ty string, id string) (core.Metadata, error)
- func (s *Store) GetTransaction(ctx context.Context, txid string) (tx core.Transaction, err error)
- func (s *Store) Initialize(ctx context.Context) error
- func (s *Store) LastMetaID(ctx context.Context) (int64, error)
- func (s *Store) LastTransaction(ctx context.Context) (*core.Transaction, error)
- func (s *Store) LoadMapping(ctx context.Context) (*core.Mapping, error)
- func (s *Store) Name() string
- func (s *Store) SaveMapping(ctx context.Context, mapping core.Mapping) error
- func (s *Store) SaveMeta(ctx context.Context, id int64, ...) error
- func (s *Store) SaveTransactions(ctx context.Context, ts []core.Transaction) error
Constants ¶
View Source
const SQLiteMemoryConnString = "file::memory:?cache=shared"
Variables ¶
View Source
var ( SQLite = Flavor(sqlbuilder.SQLite) PostgreSQL = Flavor(sqlbuilder.PostgreSQL) )
Functions ¶
func DriverModule ¶
func DriverModule(cfg ModuleConfig) fx.Option
func NewCachedDBDriver ¶
func NewInMemorySQLiteDriver ¶
func NewInMemorySQLiteDriver() *cachedDBDriver
func NewOpenCloseDBDriver ¶
func NewOpenCloseDBDriver(name string, flavor Flavor, connString ConnStringResolver) *openCloseDBDriver
func SQLDriverName ¶
func SQLiteFileConnString ¶
func TestingModule ¶
func UpdateSQLDriverMapping ¶
Types ¶
type ConnStringResolver ¶
type Flavor ¶
type Flavor sqlbuilder.Flavor
func FlavorFromString ¶
func (Flavor) AttributeKeyValue ¶
type ModuleConfig ¶
type ModuleConfig struct {
StorageDriver string
SQLiteConfig *SQLiteConfig
PostgresConfig *PostgresConfig
}
type PostgresConfig ¶
type PostgresConfig struct {
ConnString string
}
type SQLiteConfig ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) AggregateBalances ¶
func (*Store) AggregateVolumes ¶
func (*Store) CountTransactions ¶
func (*Store) FindAccounts ¶
func (*Store) FindTransactions ¶
func (*Store) GetTransaction ¶
func (*Store) LastTransaction ¶
func (*Store) SaveMapping ¶
func (*Store) SaveTransactions ¶
Click to show internal directories.
Click to hide internal directories.