Rename packages under /auth (#114)

Previously, all database stuff was under the helpfully named
package 'storage'. However, this convention is used throughout all
of dendrite, which will clash the moment we want to add auth to all
the CS API endpoints. To prevent the package name clash, add
sub-directories which represent what is being stored so the final
usage ends up being:

```
func doThing(db *storage.SyncServerDatabase, authDB *accounts.Database)
{
    // ...
}
```
This commit is contained in:
Kegsay 2017-05-22 16:49:32 +01:00 committed by GitHub
parent 0325459e7f
commit d63a1ddc7c
6 changed files with 60 additions and 12 deletions

View file

@ -19,7 +19,7 @@ import (
"os"
"strings"
"github.com/matrix-org/dendrite/clientapi/auth/storage"
"github.com/matrix-org/dendrite/clientapi/auth/storage/accounts"
"github.com/matrix-org/dendrite/clientapi/config"
"github.com/matrix-org/dendrite/clientapi/producers"
"github.com/matrix-org/dendrite/clientapi/routing"
@ -81,7 +81,7 @@ func main() {
}
queryAPI := api.NewRoomserverQueryAPIHTTP(cfg.RoomserverURL, nil)
accountDB, err := storage.NewAccountDatabase(accountDataSource, serverName)
accountDB, err := accounts.NewDatabase(accountDataSource, serverName)
if err != nil {
log.Panicf("Failed to setup account database(%s): %s", accountDataSource, err.Error())
}