Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
3ad0b220
Commit
3ad0b220
authored
Apr 25, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2a17421f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
go/neo/client.go
go/neo/client.go
+21
-1
go/neo/storage.go
go/neo/storage.go
+2
-2
go/zodb/wks/wks.go
go/zodb/wks/wks.go
+1
-0
No files found.
go/neo/client.go
View file @
3ad0b220
...
...
@@ -19,12 +19,14 @@ package neo
// access to NEO database via ZODB interfaces
import
(
"context"
"net/url"
"../zodb"
)
type
Client
struct
{
storLink
NodeLink
// link to storage node
storLink
*
NodeLink
// link to storage node
}
var
_
zodb
.
IStorage
=
(
*
Client
)(
nil
)
...
...
@@ -52,3 +54,21 @@ func (c *Client) Load(xid zodb.Xid) (data []byte, tid zodb.Tid, err error) {
func
(
c
*
Client
)
Iterate
(
tidMin
,
tidMax
zodb
.
Tid
)
zodb
.
IStorageIterator
{
panic
(
"TODO"
)
}
// TODO read-only support
func
openClientByURL
(
u
*
url
.
URL
)
(
zodb
.
IStorage
,
error
)
{
// XXX for now url is treated as storage node URL
// XXX check/use other url fields
ctx
:=
context
.
Background
()
// XXX ok?
storLink
,
err
:=
Dial
(
ctx
,
"tcp"
,
u
.
Host
)
if
err
!=
nil
{
return
nil
,
err
}
return
&
Client
{
storLink
},
nil
}
func
init
()
{
zodb
.
RegisterStorage
(
"neo"
,
openClientByURL
)
}
go/neo/storage.go
View file @
3ad0b220
...
...
@@ -27,7 +27,7 @@ import (
"os"
"../zodb"
_
"../zodb/wks
"
"../zodb/storage/fs1
"
)
// NEO Storage application
...
...
@@ -226,7 +226,7 @@ func storageMain(argv []string) {
}
// XXX hack
zstor
,
err
:=
zodb
.
OpenStorageURL
(
argv
[
0
])
zstor
,
err
:=
fs1
.
Open
(
argv
[
0
])
if
err
!=
nil
{
log
.
Fatal
(
err
)
}
...
...
go/zodb/wks/wks.go
View file @
3ad0b220
...
...
@@ -26,4 +26,5 @@ package wks
import
(
_
"../../zodb/storage/fs1"
_
"../../neo"
// XXX split into neo/client ?
)
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