diff --git a/go.mod b/go.mod index d058a9b..459040d 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,6 @@ module github.com/jay-dee7/storage go 1.15 require ( - github.com/mailhog/data v1.0.1 // indirect - gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 // indirect + github.com/mailhog/data v1.0.1 + gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 ) diff --git a/mongodb_multi_tenant.go b/mongodb_multi_tenant.go index 24dbd93..521f402 100644 --- a/mongodb_multi_tenant.go +++ b/mongodb_multi_tenant.go @@ -34,7 +34,7 @@ func (m *MultiTenantMongoDB) Store(msg *data.Message, tenant string) (string, er log.Printf("Error inserting message: %s", err) return "", err } - + return string(msg.ID), nil } diff --git a/storage.go b/storage.go index 59c0be9..2c712e0 100644 --- a/storage.go +++ b/storage.go @@ -17,7 +17,7 @@ type Storage interface { type MultiTenantStorage interface { Store(m *data.Message, tenant string) (string, error) List(start, limit int, tenant string) (*data.Messages, error) - Search(kind, query string, start, limit int, tenant string) (*data.Messages, int, error) + Search(filter interface{}, start, limit int, tenant string) (*data.Messages, int, error) Count(tenant string) int DeleteOne(id, tenant string) error DeleteAll(tenant string) error