NewFactory with given session
@@ -58,6 +58,16 @@ func NewFactory(
if err != nil {
logger.Fatal("unable to initialize cassandra session", tag.Error(err))
}
+ return NewFactoryFromSession(cfg, clusterName, logger, session)
+}
+
+// NewFactoryFromSession returns an instance of a factory object from the given session.
+func NewFactoryFromSession(
+ cfg config.Cassandra,
+ clusterName string,
+ logger log.Logger,
+ session gocql.Session,
+) *Factory {
return &Factory{
cfg: cfg,
clusterName: clusterName,
