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-ds-flatfs
Commits
30b5a0e7
Commit
30b5a0e7
authored
Jan 07, 2017
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prefix shard function identifier with "/repo/flatfs/shard/".
parent
8dba91b3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
flatfs.go
flatfs.go
+1
-1
flatfs_test.go
flatfs_test.go
+2
-2
shard.go
shard.go
+1
-1
No files found.
flatfs.go
View file @
30b5a0e7
...
...
@@ -40,7 +40,7 @@ var _ datastore.Datastore = (*Datastore)(nil)
type
ShardFunc
func
(
string
)
string
var
IPFS_DEF_SHARD
=
"v1/next-to-last/2"
const
IPFS_DEF_SHARD
=
"
/repo/flatfs/shard/
v1/next-to-last/2"
func
New
(
path
string
,
fun0
string
,
sync
bool
)
(
*
Datastore
,
error
)
{
fun0
=
NormalizeShardFunc
(
fun0
)
...
...
flatfs_test.go
View file @
30b5a0e7
...
...
@@ -424,8 +424,8 @@ func TestSHARDINGFile(t *testing.T) {
if
err
!=
nil
{
t
.
Fatalf
(
"New fail: %v
\n
"
,
err
)
}
if
fs
.
ShardFunc
()
!=
flatfs
.
NormalizeShardFunc
(
fun
)
{
t
.
Fatalf
(
"
S
hard function
in repo n
ot %s"
,
f
un
)
if
fs
.
ShardFunc
()
!=
flatfs
.
IPFS_DEF_SHARD
{
t
.
Fatalf
(
"
Expected '%s' for s
hard function
g
ot
'
%s
'
"
,
f
latfs
.
IPFS_DEF_SHARD
,
fs
.
ShardFunc
()
)
}
fs
.
Close
()
...
...
shard.go
View file @
30b5a0e7
...
...
@@ -19,7 +19,7 @@ func (f shardId) str() string {
if
f
.
funName
==
""
||
f
.
funName
==
"auto"
{
return
"auto"
}
else
{
return
fmt
.
Sprintf
(
"v1/%s/%s"
,
f
.
funName
,
f
.
param
)
return
fmt
.
Sprintf
(
"
/repo/flatfs/shard/
v1/%s/%s"
,
f
.
funName
,
f
.
param
)
}
}
...
...
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