Relative Content

Tag Archive for databasegomocking

How to mock gorqlite database connection ? and Daoer interface?

// rqliteDao implements the Daoer interface for interacting with an rqlite database. type rqliteDao struct { conn *gorqlite.Connection } // NewRQLiteDao creates a new instance of rqliteDao. func NewRQLiteDao() (Daoer, error) { // Connect to rqlite cluster conn, err := gorqlite.Open(os.Getenv(“RQLITE_DB”)) if err != nil { return nil, err } return &rqliteDao{ conn: conn, }, […]