Documentation ¶
Index ¶
- func CreateJetDrop(db *gorm.DB, jetDrop models.JetDrop) error
- func CreateJetDropCanonical(records []types.Record) types.JetDrop
- func CreateJetDrops(db *gorm.DB, jetDrops []models.JetDrop) error
- func CreatePulse(db *gorm.DB, pulse models.Pulse) error
- func CreatePulses(db *gorm.DB, pulses []models.Pulse) error
- func CreateRecord(db *gorm.DB, record models.Record) error
- func CreateRecordCanonical() types.Record
- func GenerateJetDropsWithSomeJetID(t *testing.T, jCount int) (string, []models.JetDrop, []models.Pulse)
- func GenerateJetDropsWithSplit(t *testing.T, pulseCount, jDCount int, depth int) ([]models.JetDrop, []models.Pulse)
- func GenerateJetIDTree(pn insolar.PulseNumber, depth int) map[insolar.PulseNumber]map[insolar.JetID][][]byte
- func GenerateRandBytes() []byte
- func GenerateRecordInNextPulse(prevPulse insolar.PulseNumber) *exporter.Record
- func GenerateRecords(batchSize int) func() (record *exporter.Record, e error)
- func GenerateRecordsFromOneJetSilence(differentPulseSize, recordCount int) []*exporter.Record
- func GenerateRecordsSilence(count int) []*exporter.Record
- func GenerateRecordsWIthSplitJetDrops(pn insolar.PulseNumber, depth int, recordsInJetDrop int) (records []*exporter.Record, ...)
- func GenerateRecordsWithDifferencePulses(differentPulseSize, recordCount int, startpn int64) func() (record *exporter.Record, e error)
- func GenerateRecordsWithDifferencePulsesSilence(differentPulseSize, recordCount int) []*exporter.Record
- func GenerateRequestRecord(pulse insolar.PulseNumber, objectID insolar.ID) *exporter.Record
- func GenerateUniqueJetID() insolar.JetID
- func GenerateVirtualActivateRecord(pulse insolar.PulseNumber, objectID, requestID insolar.ID) (record *exporter.Record)
- func GenerateVirtualAmendRecord(pulse insolar.PulseNumber, objectID, prevStateID insolar.ID) *exporter.Record
- func GenerateVirtualAmendRecordsLinkedArray(pulse insolar.PulseNumber, jetID insolar.JetID, ...) []*exporter.Record
- func GenerateVirtualDeactivateRecord(pulse insolar.PulseNumber, objectID, prevStateID insolar.ID) *exporter.Record
- func GenerateVirtualRequestRecord(pulse insolar.PulseNumber, objectID insolar.ID) (record *exporter.Record)
- func GenerateVirtualResultRecord(pulse insolar.PulseNumber, objectID, requestID insolar.ID) (record *exporter.Record)
- func InitJetDropDB(pulse models.Pulse) models.JetDrop
- func InitJetDropWithRecords(t *testing.T, s interfaces.StorageSetter, recordAmount int, pulse models.Pulse) models.JetDrop
- func InitNextPulseDB(pn int64) (models.Pulse, error)
- func InitPulseDB() (models.Pulse, error)
- func InitRecordDB(jetDrop models.JetDrop) models.Record
- func OrderedRecords(t *testing.T, db *gorm.DB, jetDrop models.JetDrop, objRef insolar.ID, ...) []models.Record
- func RandNumberOverRange(min int64, max int64) int64
- func RandomString(n int) string
- func RunDBInDocker(dbName, dbPassword string) (*dockertest.Pool, *dockertest.Resource, func())
- func RunDBInDockerWithPortBindings(dbName, dbPassword string) (int, *dockertest.Pool, *dockertest.Resource, func())
- func SetupDB() (*gorm.DB, func(), error)
- func TruncateTables(t testing.TB, db *gorm.DB, models []interface{})
- type ObjectLifeline
- type RecordsByPulse
- type TestGRPCServer
- type TestGRPCServerConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateJetDrop ¶
CreatePulse creates provided jet drop at db
func CreateJetDropCanonical ¶
CreateJetDropCanonical returns generated jet drop with provided record and without prevHash
func CreateJetDrops ¶
CreateJetDrops creates provided jet drop list to db
func CreatePulse ¶
CreatePulse creates provided pulse at db
func CreatePulses ¶
CreatePulses creates provided pulses to db
func CreateRecord ¶
CreateRecord creates provided record at db
func CreateRecordCanonical ¶
CreateRecordCanonical returns generated record
func GenerateJetDropsWithSomeJetID ¶
func GenerateJetDropsWithSomeJetID(t *testing.T, jCount int) (string, []models.JetDrop, []models.Pulse)
GenerateJetDropsWithSomeJetID returns a list of JetDrops with some JetID and ascending pulseNumber
func GenerateJetDropsWithSplit ¶
func GenerateJetDropsWithSplit(t *testing.T, pulseCount, jDCount int, depth int) ([]models.JetDrop, []models.Pulse)
GenerateJetDropsWithSplit returns a jetdrops with splited by depth in different pulse
func GenerateJetIDTree ¶
func GenerateJetIDTree(pn insolar.PulseNumber, depth int) map[insolar.PulseNumber]map[insolar.JetID][][]byte
GenerateJetIDTree generates tree of splitted JetDrops with specified depth
func GenerateRandBytes ¶
func GenerateRandBytes() []byte
GenerateRandBytes generates random bytes array
func GenerateRecordInNextPulse ¶
func GenerateRecordInNextPulse(prevPulse insolar.PulseNumber) *exporter.Record
func GenerateRecords ¶
GenerateRecords returns a function for generating record with error
func GenerateRecordsFromOneJetSilence ¶
GenerateRecordsFromOneJetSilence returns new generated records from one JetID
func GenerateRecordsSilence ¶
GenerateRecordsSilence returns new generated records without errors
func GenerateRecordsWIthSplitJetDrops ¶
func GenerateRecordsWIthSplitJetDrops(pn insolar.PulseNumber, depth int, recordsInJetDrop int) ( records []*exporter.Record, jetDropTree map[insolar.PulseNumber]map[insolar.JetID][][]byte)
generate records with split JetDrops
func GenerateRecordsWithDifferencePulses ¶
func GenerateRecordsWithDifferencePulses(differentPulseSize, recordCount int, startpn int64) func() (record *exporter.Record, e error)
GenerateRecordsWithDifferencePulses generates records with recordCount for each pulse
func GenerateRequestRecord ¶
func GenerateUniqueJetID ¶
func InitJetDropDB ¶
InitJetDropDB returns generated jet drop with provided pulse
func InitJetDropWithRecords ¶
func InitJetDropWithRecords(t *testing.T, s interfaces.StorageSetter, recordAmount int, pulse models.Pulse) models.JetDrop
InitJetDropWithRecords create new JetDrop, generate random records, save SaveJetDropData
func InitNextPulseDB ¶
InitNextPulseDB returns generated pulse after pn
func InitRecordDB ¶
InitRecordDB returns generated record
func OrderedRecords ¶
func RandNumberOverRange ¶
RandNumberOverRange generates random number over a range
func RunDBInDocker ¶
func RunDBInDocker(dbName, dbPassword string) (*dockertest.Pool, *dockertest.Resource, func())
func RunDBInDockerWithPortBindings ¶
func RunDBInDockerWithPortBindings(dbName, dbPassword string) (int, *dockertest.Pool, *dockertest.Resource, func())
RunDBInDockerWithPortBindings start a container with binding port to host machine
Types ¶
type ObjectLifeline ¶
type ObjectLifeline struct { StateRecords []RecordsByPulse SideRecords []RecordsByPulse ObjID insolar.ID }
func GenerateObjectLifeline ¶
func GenerateObjectLifeline(pulseCount, recordsInPulse int) ObjectLifeline
func (*ObjectLifeline) GetAllRecords ¶
func (l *ObjectLifeline) GetAllRecords() []*exporter.Record
func (*ObjectLifeline) GetStateRecords ¶
func (l *ObjectLifeline) GetStateRecords() []*exporter.Record
type RecordsByPulse ¶
type RecordsByPulse struct { Pn insolar.PulseNumber Records []*exporter.Record }
type TestGRPCServer ¶
type TestGRPCServer struct { Listener net.Listener Server *grpc.Server Network string Address string }
func CreateTestGRPCServer ¶
func CreateTestGRPCServer(t testing.TB, config *TestGRPCServerConfig) *TestGRPCServer
func (*TestGRPCServer) Serve ¶
func (s *TestGRPCServer) Serve(t testing.TB)
Serve starts to read gRPC requests