Repository navigation
lib/syncthing: Expose backend instead of lowlevel - #6224
Merged
Merged
Conversation
calmh
reviewed
Dec 11, 2019
| return nil, err | ||
| } | ||
| return db.NewLowlevel(ldb), nil | ||
| func OpenDBBackend(path string, tuning config.Tuning) (backend.Backend, error) { |
Member
There was a problem hiding this comment.
This function doesn't add much value. We could do the cast in main...
Member
Author
There was a problem hiding this comment.
The intention is that all parameters of syncthing.New can be created from this package alone, i.e. no need to import lib/db/backend. And I am not sure anymore, but I think it might even be a bit more than just convenience: I believe creating reverse bindings for a package puts some restrictions on its exported functions, but not on dependent packages. And afaik I made sure lib/syncthing conforms to those, but not any others.
calmh
approved these changes
Dec 12, 2019
calmh
added a commit
to calmh/syncthing
that referenced
this pull request
Dec 18, 2019
* master: golangci: Skip godox build(deps): bump github.com/mattn/go-isatty from 0.0.10 to 0.0.11 (syncthing#6231) lib/upgrade: Let Mac load .zip archives (syncthing#6230) lib/api: Prevent leaks in tests (syncthing#6227) lib/syncthing: Expose backend instead of lowlevel (syncthing#6224) gui: Prevent spurious api call (fixes syncthing#6222) (syncthing#6223) gui: Fix a typo in a class name (syncthing#6220) gui: Allow to degrade 'Automatic upgrades' option to 'No upgrades' (fixes syncthing#6044) (syncthing#6168)
calmh
added a commit
to calmh/syncthing
that referenced
this pull request
Jan 4, 2020
* master: gui, lib/model: Prevent negative sync completion (fixes syncthing#4570) (syncthing#6248) build, pmp: Replace fork with upstream for go-nat-pmp and tidy go.mod (syncthing#6247) gui: Missing line break (fixes syncthing#6240) (syncthing#6241) docker: Fix HOME setting (fixes syncthing#6234) (syncthing#6235) golangci: Skip godox build(deps): bump github.com/mattn/go-isatty from 0.0.10 to 0.0.11 (syncthing#6231) lib/upgrade: Let Mac load .zip archives (syncthing#6230) lib/api: Prevent leaks in tests (syncthing#6227) lib/syncthing: Expose backend instead of lowlevel (syncthing#6224) gui: Prevent spurious api call (fixes syncthing#6222) (syncthing#6223) gui: Fix a typo in a class name (syncthing#6220) gui: Allow to degrade 'Automatic upgrades' option to 'No upgrades' (fixes syncthing#6044) (syncthing#6168) lib/db, lib/protocol: Compact FileInfo and BlockInfo alignment (syncthing#6215)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of having the concrete
db.Lowleveltype in Syncthing's libraries interface, this proposes to expose thebackend.Backendinterface. That's something a library consumer can actually implement themselves if they don't want to use "our" db backend.