Skip to content

Commit

Permalink
fix(GODT-1757): Refactor code to have better data separation
Browse files Browse the repository at this point in the history
Due to Go's lackluster import system we had to refactor certain types
into separate packages so we can better control what each type has
access to.

All the database related code has been moved into the db package.

All the remote user management code has been been moved into the remote
package. Existing remote code has been erased.

All things related to state and snapshot have been moved into the state
package.

To avoid cyclic imports, the state package declares two interfaces which
provide access to some user specific data as well as a custom connector
implementation on which metadata can be attached.
  • Loading branch information
LBeernaertProton committed Aug 31, 2022
1 parent 731e472 commit 37a99ce
Show file tree
Hide file tree
Showing 148 changed files with 1,695 additions and 1,701 deletions.
4 changes: 2 additions & 2 deletions builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/ProtonMail/gluon/events"
"github.com/ProtonMail/gluon/internal"
"github.com/ProtonMail/gluon/internal/backend"
"github.com/ProtonMail/gluon/internal/remote"
"github.com/ProtonMail/gluon/internal/session"
"github.com/ProtonMail/gluon/profiling"
"github.com/ProtonMail/gluon/store"
Expand Down Expand Up @@ -48,7 +48,7 @@ func (builder *serverBuilder) build() (*Server, error) {
return nil, err
}

backend, err := backend.New(filepath.Join(builder.dir, "backend"), builder.storeBuilder, builder.delim)
backend, err := remote.NewRemote(filepath.Join(builder.dir, "backend"), builder.storeBuilder, builder.delim)
if err != nil {
return nil, err
}
Expand Down
72 changes: 0 additions & 72 deletions internal/backend/state_filters.go

This file was deleted.

207 changes: 0 additions & 207 deletions internal/backend/user.go

This file was deleted.

Loading

0 comments on commit 37a99ce

Please sign in to comment.