-
Notifications
You must be signed in to change notification settings - Fork 0
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
implement AddLocation in siva Library #10
Conversation
Codecov Report
@@ Coverage Diff @@
## siva #10 +/- ##
==========================================
+ Coverage 60.64% 63.48% +2.83%
==========================================
Files 13 13
Lines 770 786 +16
==========================================
+ Hits 467 499 +32
+ Misses 232 210 -22
- Partials 71 77 +6
Continue to review full report at Codecov.
|
} | ||
|
||
// AddLocation creates a new borges.Location if it does not exist. | ||
func (l *Library) AddLocation(id borges.LocationID) (borges.Location, error) { |
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.
Maybe add locations should be used only to create new locations and left Location
as the way to retrieve an already created location. So if AddLocation
try to create an already existed siva file then it should return an error. wdyt?
siva/location.go
Outdated
func NewLocation(id borges.LocationID, lib *Library, path string) (*Location, error) { | ||
cp, err := newCheckpoint(lib.fs, path) | ||
// OpenLocation opens a location and returns a Location struct. | ||
func OpenLocation(id borges.LocationID, lib *Library, path string) (*Location, error) { |
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 new public method is used nowhere, should we keep it anyway?
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.
We probably get rid of both CreateLocation
and OpenLocation
and use only NewLocation
with the create parameter.
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.
Even we could make NewLocation
private because as library user you should use the Library
to manage locations.
siva/location.go
Outdated
} | ||
|
||
// CreateLocation opens or creates a location and returns a Location struct. | ||
func CreateLocation(id borges.LocationID, lib *Library, path string) (*Location, error) { |
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 new public method is used nowhere, should we keep it anyway?
Signed-off-by: Javi Fontan <jfontan@gmail.com>
Also deleted unused Location functions Signed-off-by: Javi Fontan <jfontan@gmail.com>
Signed-off-by: Javi Fontan <jfontan@gmail.com>
594bdcb
to
e4cca80
Compare
Signed-off-by: Javi Fontan <jfontan@gmail.com>
siva: implement PackfileWriter and Filesystem in storer
No description provided.