connections

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 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{}
	NodeWsClient        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 WithNodeWSClient added in v1.0.3

func WithNodeWSClient(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