Commit a3127b62 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent ec815f60
......@@ -23,6 +23,8 @@ import (
"strings"
"testing"
"unsafe"
"./zodb"
)
// decode string as hex; panic on error
......@@ -192,9 +194,9 @@ func TestPktMarshal(t *testing.T) {
// map[Oid]struct {Tid,Tid,bool}
{&AnswerObjectUndoSerial{
ObjectTIDDict: map[Oid]struct{
CurrentSerial Tid
UndoSerial Tid
ObjectTIDDict: map[zodb.Oid]struct{
CurrentSerial zodb.Tid
UndoSerial zodb.Tid
IsCurrent bool
} {
1: {1, 0, false},
......
......@@ -2,6 +2,8 @@
// Package zodb defines types and interfaces used in ZODB databases
// XXX partly based on ZODB/py
package zodb
// ZODB types
......@@ -27,8 +29,15 @@ const (
// ----------------------------------------
// TxnStatus represents status of a transaction
type TxnStatus byte
const (
TxnComplete TxnStatus = ' ' // completed transaction that hasn't been packed
TxnPacked = 'p' // completed transaction that has been packed
TxnInprogress = 'c' // checkpoint -- a transaction in progress; it's been thru vote() but not finish()
)
// TODO Tid.String(), Oid.String() +verbose, scanning (?)
// Information about single storage transaction
......@@ -59,13 +68,18 @@ type StorageRecordInformation struct {
type IStorage interface {
Close() error
// TODO:
// Name()
// Name returns storage name
Name() string
// History(oid, size=1)
// LastTid()
// LoadBefore(oid Oid, beforeTid Tid) (data []bytes, tid Tid, err error)
// LoadSerial(oid Oid, serial Tid) (data []bytes, err error)
// LastTid returns the id of the last committed transaction.
// if not transactions have been committed yet, LastTid returns Tid zero value
// XXX ^^^ ok ?
LastTid() Tid // XXX -> Tid, ok ?
LoadBefore(oid Oid, beforeTid Tid) (data []byte, tid Tid, err error)
LoadSerial(oid Oid, serial Tid) (data []byte, err error)
// PrefetchBefore(oidv []Oid, beforeTid Tid) error (?)
// Store(oid Oid, serial Tid, data []byte, txn ITransaction) 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