Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
Kirill Smelkov
neo
Commits
f951b01c
Commit
f951b01c
authored
Sep 01, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
8e84ac9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
31 deletions
+9
-31
go/neo/client/client.go
go/neo/client/client.go
+9
-31
No files found.
go/neo/client/client.go
View file @
f951b01c
...
...
@@ -443,41 +443,19 @@ func (c *Client) Iterate(tidMin, tidMax zodb.Tid) zodb.IStorageIterator {
// TODO read-only support
func
openClientByURL
(
ctx
context
.
Context
,
u
*
url
.
URL
)
(
zodb
.
IStorage
,
error
)
{
// XXX u.Host -> masterAddr (not storage)
panic
(
"TODO"
)
// neo://name@master1,master2,...,masterN?options
/*
// XXX check/use other url fields
net := xnet.NetPlain("tcp") // TODO + TLS; not only "tcp" ?
storLink, err := neo.DialLink(ctx, net, u.Host) // XXX -> Dial
if err != nil {
return nil, err
if
u
.
User
==
nil
{
return
nil
,
fmt
.
Errorf
(
"neo: open %q: cluster name not specified"
)
}
// close storLink on error or ctx cancel
defer func() {
if err != nil {
storLink.Close()
}
}()
// XXX try to prettify this
type Result struct {*Client; error}
done := make(chan Result, 1)
go func() {
client, err := NewClient(storLink)
done <- Result{client, err}
}()
select {
case <-ctx.Done():
return nil, ctx.Err()
// XXX check/use other url fields
net
:=
xnet
.
NetPlain
(
"tcp"
)
// TODO + TLS; not only "tcp" ?
case r := <-done:
return r.Client, r.error
}
*/
// XXX we are not passing ctx to NewClient - right?
// as ctx for open can be done after open finishes - not covering
// whole storage working lifetime.
return
NewClient
(
u
.
User
.
Username
(),
u
.
Host
,
net
),
nil
}
func
init
()
{
...
...
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