Documentation ¶
Index ¶
- Variables
- func InitializeAtlasConnection(username string, password string, id string) (*mongo.Client, error)
- func ParseResult(cursor *mongo.Cursor, ctx context.Context) ([]byte, error)
- type MongoClient
- type MongoDBConnect
- type PaymentData
- type PostgreDatabaseClient
- func (dbc *PostgreDatabaseClient) CloseConnection()
- func (dbc *PostgreDatabaseClient) CreateConnection() error
- func (dbc *PostgreDatabaseClient) CreateTx(input *PaymentData) error
- func (dbc *PostgreDatabaseClient) GetTx(instructionId string) (*PaymentData, error)
- func (dbc *PostgreDatabaseClient) UpdateTx(input *PaymentData) error
Constants ¶
This section is empty.
Variables ¶
View Source
var LOGGER = logging.MustGetLogger("database")
Functions ¶
Types ¶
type MongoClient ¶
func InitializeIbmCloudConnection ¶
func InitializeIbmCloudConnection() (*MongoClient, error)
func (*MongoClient) GetCollection ¶
func (client *MongoClient) GetCollection() (*mongo.Collection, context.Context)
func (*MongoClient) GetSpecificCollection ¶
func (client *MongoClient) GetSpecificCollection(dbName, dbCollection string) (*mongo.Collection, context.Context)
type MongoDBConnect ¶
type MongoDBConnect struct {
// contains filtered or unexported fields
}
struct to hold driver instance, db name and collection name
func InitializeConnection ¶
func InitializeConnection(addrs []string, timeout int, authDatabase string, username string, password string, workDatabase string) (conn MongoDBConnect, err error)
*Create object to establish session to MongoDB for pool of socket connections
func (MongoDBConnect) CloseSession ¶
func (mongoDBConnect MongoDBConnect) CloseSession()
* Close the session when the goroutine exits
func (MongoDBConnect) GetCollection ¶
func (mongoDBConnection MongoDBConnect) GetCollection(session *mgo.Session, collectionName string) (collection *mgo.Collection)
* Get the collection object from the session and collection name provided
func (MongoDBConnect) GetSocketConn ¶
func (mongoDBConnection MongoDBConnect) GetSocketConn() (session *mgo.Session)
* Request a socket connection from the session and retrieve collection to process query.
type PaymentData ¶
type PaymentData struct { InstructionID *string `json:"instruction_id,omitempty" db:"instructionid"` TxData *string `json:"tx_data,omitempty" db:"txdata"` TxStatus *string `json:"tx_status,omitempty" db:"txstatus"` ResId *string `json:"res_id,omitempty" db:"resid"` TxDetail *transaction.Payment `json:"tx_detail,omitempty" db:"txdetail"` TxDetail64 *string `db:"txdetail"` CreatedTimeStamp int64 `json:"created_timestamp,omitempty" db:"created_timestamp"` UpdatedTimeStamp int64 `json:"updated_timestamp,omitempty" db:"updated_timestamp"` }
type PostgreDatabaseClient ¶
type PostgreDatabaseClient struct { Host string Port int User string Password string Dbname string Tablename string // contains filtered or unexported fields }
func (*PostgreDatabaseClient) CloseConnection ¶
func (dbc *PostgreDatabaseClient) CloseConnection()
CloseConnection closes DB connection
func (*PostgreDatabaseClient) CreateConnection ¶
func (dbc *PostgreDatabaseClient) CreateConnection() error
CreateConnection opens DB connection
func (*PostgreDatabaseClient) CreateTx ¶
func (dbc *PostgreDatabaseClient) CreateTx(input *PaymentData) error
Create new tx record to DB
func (*PostgreDatabaseClient) GetTx ¶
func (dbc *PostgreDatabaseClient) GetTx(instructionId string) (*PaymentData, error)
Get tx
func (*PostgreDatabaseClient) UpdateTx ¶
func (dbc *PostgreDatabaseClient) UpdateTx(input *PaymentData) error
Click to show internal directories.
Click to hide internal directories.