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
077c4651
Commit
077c4651
authored
Mar 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
e5e5879b
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
15 additions
and
15 deletions
+15
-15
go/zodb/btree/btree_test.go
go/zodb/btree/btree_test.go
+1
-1
go/zodb/persistent_test.go
go/zodb/persistent_test.go
+1
-1
go/zodb/storage.go
go/zodb/storage.go
+4
-4
go/zodb/storage/fs1/filestorage.go
go/zodb/storage/fs1/filestorage.go
+1
-1
go/zodb/zodb.go
go/zodb/zodb.go
+1
-1
go/zodb/zodbtools/catobj.go
go/zodb/zodbtools/catobj.go
+1
-1
go/zodb/zodbtools/dump.go
go/zodb/zodbtools/dump.go
+1
-1
go/zodb/zodbtools/dump_test.go
go/zodb/zodbtools/dump_test.go
+2
-2
go/zodb/zodbtools/info.go
go/zodb/zodbtools/info.go
+1
-1
go/zodb/zodbtools/watch.go
go/zodb/zodbtools/watch.go
+1
-1
go/zodb/zodbtools/watch_test.go
go/zodb/zodbtools/watch_test.go
+1
-1
No files found.
go/zodb/btree/btree_test.go
View file @
077c4651
...
@@ -101,7 +101,7 @@ func (b *bucketWrap) MaxKey(ctx context.Context) (k int64, ok bool, err error) {
...
@@ -101,7 +101,7 @@ func (b *bucketWrap) MaxKey(ctx context.Context) (k int64, ok bool, err error) {
func
TestBTree
(
t
*
testing
.
T
)
{
func
TestBTree
(
t
*
testing
.
T
)
{
X
:=
exc
.
Raiseif
X
:=
exc
.
Raiseif
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
stor
,
err
:=
zodb
.
Open
Storage
(
ctx
,
"testdata/1.fs"
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
stor
,
err
:=
zodb
.
Open
(
ctx
,
"testdata/1.fs"
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
go/zodb/persistent_test.go
View file @
077c4651
...
@@ -348,7 +348,7 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
...
@@ -348,7 +348,7 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
// open connection to it via zodb/go
// open connection to it via zodb/go
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
stor
,
err
:=
Open
Storage
(
ctx
,
zurl
,
&
OpenOptions
{
ReadOnly
:
true
,
NoCache
:
!
rawcache
});
X
(
err
)
stor
,
err
:=
Open
(
ctx
,
zurl
,
&
OpenOptions
{
ReadOnly
:
true
,
NoCache
:
!
rawcache
});
X
(
err
)
db
:=
NewDB
(
stor
)
db
:=
NewDB
(
stor
)
defer
func
()
{
defer
func
()
{
err
:=
db
.
Close
();
X
(
err
)
err
:=
db
.
Close
();
X
(
err
)
...
...
go/zodb/storage.go
View file @
077c4651
...
@@ -32,7 +32,7 @@ import (
...
@@ -32,7 +32,7 @@ import (
"lab.nexedi.com/kirr/go123/xcontext"
"lab.nexedi.com/kirr/go123/xcontext"
)
)
// OpenOptions describes options for Open
Storage
.
// OpenOptions describes options for Open.
type
OpenOptions
struct
{
type
OpenOptions
struct
{
ReadOnly
bool
// whether to open storage as read-only
ReadOnly
bool
// whether to open storage as read-only
NoCache
bool
// don't use cache for read/write operations; prefetch will be noop
NoCache
bool
// don't use cache for read/write operations; prefetch will be noop
...
@@ -73,14 +73,14 @@ func RegisterDriver(scheme string, opener DriverOpener) {
...
@@ -73,14 +73,14 @@ func RegisterDriver(scheme string, opener DriverOpener) {
driverRegistry
[
scheme
]
=
opener
driverRegistry
[
scheme
]
=
opener
}
}
// Open
Storage
opens ZODB storage by URL.
// Open opens ZODB storage by URL.
//
//
// Only URL schemes registered to zodb package are handled.
// Only URL schemes registered to zodb package are handled.
// Users should import in storage packages they use or zodb/wks package to
// Users should import in storage packages they use or zodb/wks package to
// get support for well-known storages.
// get support for well-known storages.
//
//
// Storage authors should register their storages with RegisterStorage.
// Storage authors should register their storages with RegisterStorage.
func
Open
Storage
(
ctx
context
.
Context
,
zurl
string
,
opt
*
OpenOptions
)
(
IStorage
,
error
)
{
func
Open
(
ctx
context
.
Context
,
zurl
string
,
opt
*
OpenOptions
)
(
IStorage
,
error
)
{
// no scheme -> file://
// no scheme -> file://
if
!
strings
.
Contains
(
zurl
,
"://"
)
{
if
!
strings
.
Contains
(
zurl
,
"://"
)
{
zurl
=
"file://"
+
zurl
zurl
=
"file://"
+
zurl
...
@@ -142,7 +142,7 @@ func OpenStorage(ctx context.Context, zurl string, opt *OpenOptions) (IStorage,
...
@@ -142,7 +142,7 @@ func OpenStorage(ctx context.Context, zurl string, opt *OpenOptions) (IStorage,
// storage represents storage opened via Open
Storage
.
// storage represents storage opened via Open.
//
//
// it provides a small cache on top of raw storage driver to implement prefetch
// it provides a small cache on top of raw storage driver to implement prefetch
// and other storage-independent higher-level functionality.
// and other storage-independent higher-level functionality.
...
...
go/zodb/storage/fs1/filestorage.go
View file @
077c4651
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
//
//
// Unless one is doing something FileStorage-specific, it is advised not to use
// Unless one is doing something FileStorage-specific, it is advised not to use
// fs1 package directly, and instead link-in lab.nexedi.com/kirr/neo/go/zodb/wks,
// fs1 package directly, and instead link-in lab.nexedi.com/kirr/neo/go/zodb/wks,
// open storage by zodb.Open
Storage
and use it by way of zodb.IStorage interface.
// open storage by zodb.Open and use it by way of zodb.IStorage interface.
//
//
// The fs1 package exposes all FileStorage data format details and most of
// The fs1 package exposes all FileStorage data format details and most of
// internal workings so that it is possible to implement FileStorage-specific
// internal workings so that it is possible to implement FileStorage-specific
...
...
go/zodb/zodb.go
View file @
077c4651
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
// The storage layer provides access to a ZODB database in terms of database
// The storage layer provides access to a ZODB database in terms of database
// records with raw bytes payload.
// records with raw bytes payload.
//
//
// At storage level a ZODB database can be opened with Open
Storage
. Once opened
// At storage level a ZODB database can be opened with Open. Once opened
// IStorage interface is returned that represents access to the database.
// IStorage interface is returned that represents access to the database.
// Please see IStorage, and interfaces it embeds, for details.
// Please see IStorage, and interfaces it embeds, for details.
//
//
...
...
go/zodb/zodbtools/catobj.go
View file @
077c4651
...
@@ -126,7 +126,7 @@ func catobjMain(argv []string) {
...
@@ -126,7 +126,7 @@ func catobjMain(argv []string) {
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
stor
,
err
:=
zodb
.
Open
Storage
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
stor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
if
err
!=
nil
{
if
err
!=
nil
{
prog
.
Fatal
(
err
)
prog
.
Fatal
(
err
)
}
}
...
...
go/zodb/zodbtools/dump.go
View file @
077c4651
...
@@ -271,7 +271,7 @@ func dumpMain(argv []string) {
...
@@ -271,7 +271,7 @@ func dumpMain(argv []string) {
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
stor
,
err
:=
zodb
.
Open
Storage
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
stor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
if
err
!=
nil
{
if
err
!=
nil
{
prog
.
Fatal
(
err
)
prog
.
Fatal
(
err
)
}
}
...
...
go/zodb/zodbtools/dump_test.go
View file @
077c4651
// Copyright (C) 2016-201
7
Nexedi SA and Contributors.
// Copyright (C) 2016-201
9
Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
// Kirill Smelkov <kirr@nexedi.com>
//
//
// This program is free software: you can Use, Study, Modify and Redistribute
// This program is free software: you can Use, Study, Modify and Redistribute
...
@@ -67,7 +67,7 @@ func loadZdumpPy(t *testing.T, path string) string {
...
@@ -67,7 +67,7 @@ func loadZdumpPy(t *testing.T, path string) string {
}
}
func
withTestdataFs
(
t
testing
.
TB
,
db
string
,
f
func
(
zstor
zodb
.
IStorage
))
{
func
withTestdataFs
(
t
testing
.
TB
,
db
string
,
f
func
(
zstor
zodb
.
IStorage
))
{
zstor
,
err
:=
zodb
.
Open
Storage
(
context
.
Background
(),
fmt
.
Sprintf
(
"../../zodb/storage/fs1/testdata/%s.fs"
,
db
),
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
zstor
,
err
:=
zodb
.
Open
(
context
.
Background
(),
fmt
.
Sprintf
(
"../../zodb/storage/fs1/testdata/%s.fs"
,
db
),
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatal
(
err
)
t
.
Fatal
(
err
)
}
}
...
...
go/zodb/zodbtools/info.go
View file @
077c4651
...
@@ -125,7 +125,7 @@ func infoMain(argv []string) {
...
@@ -125,7 +125,7 @@ func infoMain(argv []string) {
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
stor
,
err
:=
zodb
.
Open
Storage
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
stor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
if
err
!=
nil
{
if
err
!=
nil
{
prog
.
Fatal
(
err
)
prog
.
Fatal
(
err
)
}
}
...
...
go/zodb/zodbtools/watch.go
View file @
077c4651
...
@@ -154,7 +154,7 @@ func watchMain(argv []string) {
...
@@ -154,7 +154,7 @@ func watchMain(argv []string) {
ctx
:=
context
.
Background
()
ctx
:=
context
.
Background
()
stor
,
err
:=
zodb
.
Open
Storage
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
stor
,
err
:=
zodb
.
Open
(
ctx
,
zurl
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
})
if
err
!=
nil
{
if
err
!=
nil
{
prog
.
Fatal
(
err
)
prog
.
Fatal
(
err
)
}
}
...
...
go/zodb/zodbtools/watch_test.go
View file @
077c4651
...
@@ -62,7 +62,7 @@ func TestWatch(t *testing.T) {
...
@@ -62,7 +62,7 @@ func TestWatch(t *testing.T) {
// open tfs at go side
// open tfs at go side
bg
:=
context
.
Background
()
bg
:=
context
.
Background
()
stor
,
err
:=
zodb
.
Open
Storage
(
bg
,
tfs
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
});
X
(
err
)
stor
,
err
:=
zodb
.
Open
(
bg
,
tfs
,
&
zodb
.
OpenOptions
{
ReadOnly
:
true
});
X
(
err
)
// spawn plain and verbose watchers
// spawn plain and verbose watchers
ctx0
,
cancel
:=
context
.
WithCancel
(
bg
)
ctx0
,
cancel
:=
context
.
WithCancel
(
bg
)
...
...
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