Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3-chunker
Commits
57fa6591
Unverified
Commit
57fa6591
authored
Oct 07, 2019
by
Jakub Sztandera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add buzhash to parsers list
License: MIT Signed-off-by:
Jakub Sztandera
<
kubuxu@protocol.ai
>
parent
462a6eb4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
parse.go
parse.go
+5
-2
No files found.
parse.go
View file @
57fa6591
...
...
@@ -14,8 +14,8 @@ var (
)
// FromString returns a Splitter depending on the given string:
// it supports "default" (""), "size-{size}", "rabin", "rabin-{blocksize}"
and
// "rabin-{min}-{avg}-{max}".
// it supports "default" (""), "size-{size}", "rabin", "rabin-{blocksize}"
,
// "rabin-{min}-{avg}-{max}"
and "buzhash"
.
func
FromString
(
r
io
.
Reader
,
chunker
string
)
(
Splitter
,
error
)
{
switch
{
case
chunker
==
""
||
chunker
==
"default"
:
...
...
@@ -34,6 +34,9 @@ func FromString(r io.Reader, chunker string) (Splitter, error) {
case
strings
.
HasPrefix
(
chunker
,
"rabin"
)
:
return
parseRabinString
(
r
,
chunker
)
case
chunker
==
"buzhash"
:
return
NewBuzhash
(
r
),
nil
default
:
return
nil
,
fmt
.
Errorf
(
"unrecognized chunker option: %s"
,
chunker
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment