Categorygithub.com/mikedonnici/datasource
repositorypackage
0.0.0-20210923224533-acb4919f20f7
Repository: https://github.com/mikedonnici/datasource.git
Documentation: pkg.go.dev

# README

datasource

Convenience package for organising multiple data source connections.

Overview

This package allows you to create a bunch of data source connections and hang them off your server for much convenience.

Currently, includes connectors for:

  • MongoDB
  • PostgreSQL
  • Pulsar
  • SOLR

Todo:

  • Redis
  • MySQL

Usage

A quick example:

// A service...
srvc := struct {
	Connections datasource.Connections
}

// Add connections...
srvc.Connections.AddPostgresConnection("pg1", "postgres://.....")
srvc.Connections.AddPostgresConnection("pg2", "postgres://.....")
srvc.Connections.AddMongoConnection("mg1", "mongodb://.....")