-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bee #48, #49, #40]: introduce netstore #104
Conversation
@acud You can always export something (constructor returning |
pkg/netstore/netstore_test.go
Outdated
|
||
type mockValidator struct{} | ||
|
||
func (m mockValidator) Validate(_ swarm.Chunk) bool { return true } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An extremely minor suggestion, m
receiver is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but it has to implement the interface (the validator is an interface, not a function type alias)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very very minor, but just as swarm.Chunk
is _
, func (_ mockValidator) ...
can have _
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm 👏
Due to popular demand - the return of the immortal
NetStore
This is a naive and trivial
NetStore
implementation: no caching and no fancy stuff, including any concurrency.A note about about the retrieval protocol:
I introduced the
Interface
type but I cannot change theNew
constructor to return theInterface
type, that is because in the retrieval tests, theserver
is expected to implement theProtocol
method:Personally it would be nice to return the interface directly from the constructor and not even export
Service
at all, but then the test won't fly in this form.It does work when I cast
server
to aService
:But I feel this solution is also sub-optimal since
Service
still needs to be exported.If someone has some nicer idea, I'd be happy to hear.
needed for #48
closes #49
closes #40
related to #98