// Connect - Binds Storage with any configured DB
Binds Storage with any configured DB
// Connect - Binds Storage with any configured DB
func Connect(conf ConfStorage) (*Storage, error) {
	var store *Storage
	switch {
	case conf.SQLite != nil:
		var err error
		store, err = ConnectSQLite(*conf.SQLite)
		if err != nil {
			return nil, fmt.Errorf("can't connect to sqlite storage: %s", err)
		}
	default:
		return nil, fmt.Errorf("at least one of databases must be configured")
	}
	return store, nil
}
func Connect ( conf ConfStorage ) ( * Storage , error ) { var store * Storage switch { case conf . SQLite != nil : var err error store , err = ConnectSQLite ( * conf . SQLite ) if err != nil { return nil , fmt . Errorf ( " " , err ) } default : return nil , fmt . Errorf ( " " ) } return store , nil }
Binds Storage with any configured DB
Binds Storage with any configured DB