Commit 60682993 authored by Kirill Smelkov's avatar Kirill Smelkov

go/zodb/*: Cosmetics, typos, ...

parent bae8fda6
...@@ -55,7 +55,7 @@ type Cache struct { ...@@ -55,7 +55,7 @@ type Cache struct {
mu sync.RWMutex mu sync.RWMutex
// cache is fully synchronized with storage for transactions with tid <= head. // cache is currently synchronized with storage for transactions with tid <= head.
// XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head) // XXX clarify ^^^ (it means if revCacheEntry.head=∞ it is Cache.head)
head Tid head Tid
......
...@@ -274,7 +274,7 @@ func (conn *Connection) checkTxnCtx(ctx context.Context, who string) { ...@@ -274,7 +274,7 @@ func (conn *Connection) checkTxnCtx(ctx context.Context, who string) {
// checkTxn asserts that specified "current" transaction is the same as conn.txn . // checkTxn asserts that specified "current" transaction is the same as conn.txn .
func (conn *Connection) checkTxn(txn transaction.Transaction, who string) { func (conn *Connection) checkTxn(txn transaction.Transaction, who string) {
if txn != conn.txn { if txn != conn.txn {
panic("connection: " + who + "current transaction is different from connection transaction") panic("connection: " + who + ": current transaction is different from connection transaction")
} }
} }
......
...@@ -59,6 +59,7 @@ import ( ...@@ -59,6 +59,7 @@ import (
type Persistent struct { type Persistent struct {
// ZODB class of this object. // ZODB class of this object.
// XXX it could be deduced via typeTab[reflect.TypeOf(.instance)] // XXX it could be deduced via typeTab[reflect.TypeOf(.instance)]
// XXX or better drop .instance and deduce it via casting to .zclass.typ
zclass *zclass zclass *zclass
jar *Connection jar *Connection
...@@ -370,7 +371,7 @@ var rPyStateful = reflect.TypeOf((*PyStateful)(nil)).Elem() // typeof(PyStatef ...@@ -370,7 +371,7 @@ var rPyStateful = reflect.TypeOf((*PyStateful)(nil)).Elem() // typeof(PyStatef
// //
// Only registered classes can be saved to database, and are converted to // Only registered classes can be saved to database, and are converted to
// corresponding application-level objects on load. When ZODB loads an object // corresponding application-level objects on load. When ZODB loads an object
// whose class is not know, it will represent it as Broken object. // whose class is not known, it will represent it as Broken object.
// //
// class is a full class path for registered class, e.g. "BTrees.LOBTree.LOBucket". // class is a full class path for registered class, e.g. "BTrees.LOBTree.LOBucket".
// typ is Go type corresponding to class. // typ is Go type corresponding to class.
......
...@@ -65,7 +65,7 @@ func (o *myObjectState) PyGetState() interface{} { ...@@ -65,7 +65,7 @@ func (o *myObjectState) PyGetState() interface{} {
return o.value return o.value
} }
// Peristent that is not registered to ZODB. // Persistent that is not registered to ZODB.
type Unregistered struct { type Unregistered struct {
Persistent Persistent
} }
...@@ -599,3 +599,12 @@ func testPersistentDB(t0 *testing.T, rawcache bool) { ...@@ -599,3 +599,12 @@ func testPersistentDB(t0 *testing.T, rawcache bool) {
} }
// TODO Map & List tests. // TODO Map & List tests.
// TODO PyGetState vs PySetState tests (general - for any type):
//
// db1: produced by zodb/py
// go: load db1
// go: commit -> db2 (resave)
// go: load db2
// go: check (loaded from db2) == (loaded from db1)
...@@ -155,7 +155,7 @@ func TestLoad(t *testing.T) { ...@@ -155,7 +155,7 @@ func TestLoad(t *testing.T) {
} }
// load at ∞ with TidMax // load at ∞ with TidMax
// XXX should we get "no such transaction" with at > head? // XXX should we get "no such transaction" with at > head? - yes
for oid, expect := range before { for oid, expect := range before {
xid := zodb.Xid{zodb.TidMax, oid} xid := zodb.Xid{zodb.TidMax, oid}
checkLoad(t, fs, xid, expect) checkLoad(t, fs, xid, expect)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
// See COPYING file for full licensing terms. // See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options. // See https://www.nexedi.com/licensing for rationale and options.
// Package zeo provides simple ZEO client // Package zeo provides simple ZEO client.
package zeo package zeo
import ( import (
......
// Copyright (C) 2018 Nexedi SA and Contributors. // Copyright (C) 2018-2019 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
// it under the terms of the GNU General Public License version 3, or (at your // it under the terms of the GNU General Public License version 3, or (at your
...@@ -216,7 +216,7 @@ func pktDecode(pkb *pktBuf) (msg, error) { ...@@ -216,7 +216,7 @@ func pktDecode(pkb *pktBuf) (msg, error) {
} }
// call makes 1 RPC call to server, waits for reply and returns it. // Call makes 1 RPC call to server, waits for reply and returns it.
func (zl *zLink) Call(ctx context.Context, method string, argv ...interface{}) (reply msg, _ error) { func (zl *zLink) Call(ctx context.Context, method string, argv ...interface{}) (reply msg, _ error) {
// defer func() ... // defer func() ...
reply, err := zl._call(ctx, method, argv...) reply, err := zl._call(ctx, method, argv...)
......
...@@ -440,7 +440,7 @@ type Event interface { ...@@ -440,7 +440,7 @@ type Event interface {
func (_ *EventError) event() {} func (_ *EventError) event() {}
func (_ *EventCommit) event() {} func (_ *EventCommit) event() {}
// EventError is event descrbing an error observed by watcher. // EventError is event describing an error observed by watcher.
type EventError struct { type EventError struct {
Err error Err error
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment