zindexer

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

README

zindexer - Common Components

License CircleCI

Documentation

Index

Constants

View Source
const (
	// ENV_DB_USER is the name of the environment variable that specifies
	// the user of required db we have to connect to.
	ENV_DB_USER = "ZINDEXER_DB_USER"

	// ENV_DB_PASSWORD is the name of the environment variable that specifies
	// the password of required db we have to connect to.
	ENV_DB_PASSWORD = "ZINDEXER_DB_PASSWORD" // nolint

	// ENV_DB_NAME is the name of the environment variable that specifies
	// the schema of required db we have to connect to.
	ENV_DB_NAME = "ZINDEXER_DB_NAME"

	// ENV_DB_HOST is the name of the environment variable that specifies
	// the host IP of required db we have to connect to.
	ENV_DB_HOST = "ZINDEXER_DB_HOST"

	// ENV_DB_PORT is the name of the environment variable that specifies
	// the port of required db we have to connect to.
	ENV_DB_PORT = "ZINDEXER_DB_PORT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainIndexer

type ChainIndexer interface {
	MigrateTypes() error
	Start()
}

ChainIndexer

type ConnectionParams

type ConnectionParams struct {
	User     string
	Password string
	Name     string
	Host     string
	Port     string
}

func GetConnectionParamsFromEnv

func GetConnectionParamsFromEnv() (*ConnectionParams, error)

GetConnectionParamsFromEnv gets required config options from environmental variables

func (*ConnectionParams) GetDSN

func (p *ConnectionParams) GetDSN() (string, error)

type DBConnection

type DBConnection interface {
	GetDB() *gorm.DB
}

type GormConnection

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

func NewPostgresConnection

func NewPostgresConnection(params *ConnectionParams) (*GormConnection, error)

func (*GormConnection) GetDB

func (c *GormConnection) GetDB() *gorm.DB

type IndexingWorker

type IndexingWorker interface {
	Index(from int64, to int64) error
}

IndexingWorker interface

Jump to

Keyboard shortcuts

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