Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
N
node-bigstream
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bs
node-bigstream
Commits
f9307a44
Commit
f9307a44
authored
Feb 01, 2017
by
project
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
6825976a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
2 deletions
+28
-2
bsdata.js
lib/model/bsdata.js
+8
-1
db.js
storage-service/lib/db.js
+1
-1
resource.js
storage-service/lib/resource.js
+19
-0
No files found.
lib/model/bsdata.js
View file @
f9307a44
...
@@ -19,7 +19,11 @@ module.exports.parse = function(obj)
...
@@ -19,7 +19,11 @@ module.exports.parse = function(obj)
var
jsonobj
=
BSON
.
parse
(
obj
);
var
jsonobj
=
BSON
.
parse
(
obj
);
return
new
BSData
(
jsonobj
.
data
,
jsonobj
.
data_type
);
return
new
BSData
(
jsonobj
.
data
,
jsonobj
.
data_type
);
}
else
if
(
obj
.
data_type
&&
obj
.
data
){
}
else
if
(
obj
.
data_type
&&
obj
.
data
){
return
new
BSData
(
obj
.
data
,
obj
.
data_type
);
var
oData
=
obj
.
data
;
if
(
obj
.
encoding
==
'base64'
){
oData
=
new
Buffer
(
obj
.
data
,
'base64'
);
}
return
new
BSData
(
oData
,
obj
.
data_type
);
}
else
{
}
else
{
return
null
;
return
null
;
}
}
...
@@ -78,6 +82,9 @@ BSData.prototype.serialize = function(type){
...
@@ -78,6 +82,9 @@ BSData.prototype.serialize = function(type){
bsdata
.
encoding
=
'base64'
;
bsdata
.
encoding
=
'base64'
;
}
}
if
(
type
==
'object-encoded'
){
return
bsdata
;
}
return
JSON
.
stringify
(
bsdata
);
return
JSON
.
stringify
(
bsdata
);
}
}
...
...
storage-service/lib/db.js
View file @
f9307a44
...
@@ -37,7 +37,7 @@ Db.prototype.request = function(req,cb)
...
@@ -37,7 +37,7 @@ Db.prototype.request = function(req,cb)
Db
.
prototype
.
bsscmd_w
=
function
(
cmd
,
cb
)
Db
.
prototype
.
bsscmd_w
=
function
(
cmd
,
cb
)
{
{
var
self
=
this
;
var
self
=
this
;
var
filepath
=
this
.
repos_dir
+
'/'
+
name2path
(
cmd
.
storage
)
+
'.bss'
var
filepath
=
this
.
repos_dir
+
'/'
+
name2path
(
cmd
.
storage
)
+
'.bss'
;
var
bssname
=
cmd
.
storage
;
var
bssname
=
cmd
.
storage
;
var
w_cmd
=
{
var
w_cmd
=
{
'command'
:
'write'
,
'command'
:
'write'
,
...
...
storage-service/lib/resource.js
0 → 100644
View file @
f9307a44
function
resource
(
cfg
)
{
cfg
=
cfg
||
{};
this
.
resource_store
=
cfg
.
resource_store
;
}
resource
.
prototype
.
getData
=
function
(
res
,
cb
)
{
if
(
res
.
type
==
'data'
)
{
cb
(
null
,
res
.
value
);
}
else
if
(
res
.
type
==
'ref'
){
cb
(
null
,
""
);
}
else
{
cb
(
"unsupported datatype"
);
}
}
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