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
890290e6
Commit
890290e6
authored
Mar 26, 2021
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go/*: Cosmetics
parent
25a8766b
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
13 additions
and
10 deletions
+13
-10
go/neo/neonet/newlink.go
go/neo/neonet/newlink.go
+1
-1
go/neo/proto/proto.go
go/neo/proto/proto.go
+1
-1
go/zodb/storage.go
go/zodb/storage.go
+1
-1
go/zodb/storage/fs1/filestorage_test.go
go/zodb/storage/fs1/filestorage_test.go
+3
-0
go/zodb/storage/zeo/zeo.go
go/zodb/storage/zeo/zeo.go
+2
-2
go/zodb/storage/zeo/zeo_test.go
go/zodb/storage/zeo/zeo_test.go
+3
-3
go/zodb/zodb.go
go/zodb/zodb.go
+2
-2
No files found.
go/neo/neonet/newlink.go
View file @
890290e6
...
...
@@ -346,7 +346,7 @@ type LinkListener interface {
// linkListener implements LinkListener.
type
linkListener
struct
{
l
xnet
.
Listener
l
xnet
.
Listener
}
func
(
l
*
linkListener
)
Accept
(
ctx
context
.
Context
)
(
*
NodeLink
,
error
)
{
...
...
go/neo/proto/proto.go
View file @
890290e6
...
...
@@ -438,7 +438,7 @@ type Pong struct{}
type
CloseClient
struct
{
}
// Ask node identier of the current primary master.
// Ask node identi
fi
er of the current primary master.
//
//neo:nodes ctl -> A
type
PrimaryMaster
struct
{
...
...
go/zodb/storage.go
View file @
890290e6
...
...
@@ -396,7 +396,7 @@ func (s *storage) _watcher() error {
func
(
s
*
storage
)
AddWatch
(
watchq
chan
<-
Event
)
(
at0
Tid
)
{
ack
:=
make
(
chan
Tid
)
select
{
// no longer operational: behave if watchq was registered before that
// no longer operational: behave
as
if watchq was registered before that
// and then seen down/close events. Interact with DelWatch directly.
case
<-
s
.
down
:
s
.
headMu
.
Lock
()
// shutdown may be due to Close call and watcher might be
...
...
go/zodb/storage/fs1/filestorage_test.go
View file @
890290e6
...
...
@@ -108,6 +108,7 @@ func TestLoad(t *testing.T) {
}
// iterate tidMin..tidMax and expect db entries in expectv
// TODO -> xtesting
func
testIterate
(
t
*
testing
.
T
,
fs
*
FileStorage
,
tidMin
,
tidMax
zodb
.
Tid
,
expectv
[]
dbEntry
)
{
ctx
:=
context
.
Background
()
iter
:=
fs
.
Iterate
(
ctx
,
tidMin
,
tidMax
)
...
...
@@ -218,6 +219,7 @@ func testIterate(t *testing.T, fs *FileStorage, tidMin, tidMax zodb.Tid, expectv
}
}
// TODO -> xtesting
func
TestIterate
(
t
*
testing
.
T
)
{
fs
,
_
:=
xfsopen
(
t
,
"testdata/1.fs"
)
defer
exc
.
XRun
(
fs
.
Close
)
...
...
@@ -254,6 +256,7 @@ func TestIterate(t *testing.T) {
testIterate
(
t
,
fs
,
0
,
zodb
.
TidMax
,
_1fs_dbEntryv
[
:
])
}
// TODO -> xtesting
func
BenchmarkIterate
(
b
*
testing
.
B
)
{
fs
,
_
:=
xfsopen
(
b
,
"testdata/1.fs"
)
defer
exc
.
XRun
(
fs
.
Close
)
...
...
go/zodb/storage/zeo/zeo.go
View file @
890290e6
...
...
@@ -279,7 +279,7 @@ func (r rpc) call(ctx context.Context, argv ...interface{}) (interface{}, error)
// excError returns error corresponding to an exception.
//
// well-known exceptions are mapped to corresponding well-known errors - e.g.
// POSKeyError -> zodb.NoObjectError, and rest are returned wrappe
r
into rpcExcept.
// POSKeyError -> zodb.NoObjectError, and rest are returned wrappe
d
into rpcExcept.
func
(
r
rpc
)
excError
(
exc
string
,
argv
tuple
)
error
{
// translate well-known exceptions
switch
exc
{
...
...
@@ -409,7 +409,7 @@ func (r rpc) ereplyf(format string, argv ...interface{}) *errorUnexpectedReply {
func
openByURL
(
ctx
context
.
Context
,
u
*
url
.
URL
,
opt
*
zodb
.
DriverOptions
)
(
_
zodb
.
IStorageDriver
,
at0
zodb
.
Tid
,
err
error
)
{
url
:=
u
.
String
()
defer
xerr
.
Contextf
(
&
err
,
"open %s"
,
url
)
defer
xerr
.
Contextf
(
&
err
,
"
zeo:
open %s"
,
url
)
// zeo://host:port/path?storage=...&...
var
net
xnet
.
Networker
...
...
go/zodb/storage/zeo/zeo_test.go
View file @
890290e6
...
...
@@ -34,7 +34,6 @@ import (
"lab.nexedi.com/kirr/neo/go/zodb"
_
"lab.nexedi.com/kirr/neo/go/zodb/storage/fs1"
"lab.nexedi.com/kirr/go123/exc"
"lab.nexedi.com/kirr/go123/xerr"
"lab.nexedi.com/kirr/go123/xnet"
)
...
...
@@ -139,7 +138,7 @@ func (z *ZEOPySrv) Close() (err error) {
<-
z
.
done
err
=
z
.
errExit
if
_
,
ok
:=
err
.
(
*
exec
.
ExitError
);
ok
{
err
=
nil
// ignore exit statu
e
- it is always !0 on kill
err
=
nil
// ignore exit statu
s
- it is always !0 on kill
}
return
err
}
...
...
@@ -154,6 +153,7 @@ func (z *ZEOPySrv) Encoding() encoding {
// ----------------
// tOptions represents options for testing.
// TODO -> xtesting
type
tOptions
struct
{
Preload
string
// preload database with data from this location
}
...
...
@@ -253,7 +253,7 @@ func TestEmptyDB(t *testing.T) {
}
func
TestLoad
(
t
*
testing
.
T
)
{
X
:=
exc
.
Raiseif
X
:=
xtesting
.
FatalIf
(
t
)
data
:=
"../fs1/testdata/1.fs"
txnvOk
,
err
:=
xtesting
.
LoadDBHistory
(
data
);
X
(
err
)
...
...
go/zodb/zodb.go
View file @
890290e6
// Copyright (C) 2016-202
0
Nexedi SA and Contributors.
// Copyright (C) 2016-202
1
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -327,7 +327,7 @@ type IStorage interface {
Loader
Iterator
// similar to IStorage
// similar to IStorage
Driver
// Sync syncs to storage and updates current view of it.
//
...
...
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