connections

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataSource

type DataSource struct {
	// data sources
	DatabasePostgres    *gorm.DB
	DatabaseMongoClient *mongo.Client
	DatabaseMongoCfg    database.DBConnectionParams
	RosettaClient       *client.APIClient
	NodeClient          interface{}
	DataStore           ds.DataStoreClient
	// common
	Ctx        context.Context
	RetryDelay time.Duration
}

func NewDataSource

func NewDataSource(opts ...SourceOption) DataSource

type SourceOption

type SourceOption func(*DataSource)

func WithContext

func WithContext(ctx context.Context) SourceOption

func WithDataStore

func WithDataStore(cfg ds.DataStoreConfig) SourceOption

func WithMongoDBClient added in v0.2.7

func WithMongoDBClient(dbConn *mongo.Client) SourceOption

func WithMongoDBConfig added in v0.2.7

func WithMongoDBConfig(cfg database.DBConnectionParams) SourceOption

func WithNodeClient

func WithNodeClient(node interface{}) SourceOption

func WithPostgresDB added in v0.2.5

func WithPostgresDB(dbConn *gorm.DB) SourceOption

func WithRetryDelay

func WithRetryDelay(delay time.Duration) SourceOption

func WithRosettaClient

func WithRosettaClient(client *client.APIClient) SourceOption

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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