impexp_test.go 1.37 KB
Newer Older
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// Copyright (C) 2019  Nexedi SA and Contributors.
//                     Kirill Smelkov <kirr@nexedi.com>
//
// 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
// option) any later version, as published by the Free Software Foundation.
//
// You can also Link and Combine this program with other software covered by
// the terms of any of the Free Software licenses or any of the Open Source
// Initiative approved licenses and Convey the resulting work. Corresponding
// source of such a combination shall include the source code for all other
// software used.
//
// This program is distributed WITHOUT ANY WARRANTY; without even the implied
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// See COPYING file for full licensing terms.
// See https://www.nexedi.com/licensing for rationale and options.

package zodb

import (
	"lab.nexedi.com/kirr/go123/mem"
)

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
26 27
// imported at runtime via import_x_test due to cyclic dependency:

28 29
var ZPyCommit    func(string, Tid, ...IPersistent) (Tid, error)
var ZPyCommitRaw func(string, Tid, ...ZRawObject)  (Tid, error)
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
30 31 32

// exported for zodb_test package:

33 34 35 36 37
type ZRawObject struct { // keep in sync with xtesting.ZRawObject
	Oid  Oid
	Data []byte
}

Kirill Smelkov's avatar
.  
Kirill Smelkov committed
38
func PSerialize(obj IPersistent) *mem.Buf {
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
39
	return obj.persistent().pSerialize()
Kirill Smelkov's avatar
.  
Kirill Smelkov committed
40
}