connections

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2022 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           data_store.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 data_store.DataStoreConfig) SourceOption

func WithMongoDBClient

func WithMongoDBClient(dbConn *mongo.Client) SourceOption

func WithMongoDBConfig

func WithMongoDBConfig(cfg database.DBConnectionParams) SourceOption

func WithNodeClient

func WithNodeClient(node interface{}) SourceOption

func WithPostgresDB

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