heavymock

package
v1.0.10-0...-7349ede Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthImportRecords = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowImportRecords   = fmt.Errorf("proto: integer overflow")
)
View Source
var SimpleRecord = &exporter.Record{
	Polymorph:    1,
	RecordNumber: 100,
	Record: record.Material{
		ID: *insolar.NewID(65537, nil),
	},
	ShouldIterateFrom: nil,
}

Functions

func GetRecordsByPulse

func GetRecordsByPulse(pulse insolar.PulseNumber, count int) []exporter.Record

func GetRecordsByPulseNumber

func GetRecordsByPulseNumber(pulse pulse.Number, count int) []exporter.Record

func ImportRecords

func ImportRecords(client HeavymockImporterClient, records []*exporter.Record) error

func ReceiveRecords

func ReceiveRecords(client exporter.RecordExporterClient, request *exporter.GetRecords) ([]*exporter.Record, error)

func RegisterHeavymockImporterServer

func RegisterHeavymockImporterServer(s *grpc.Server, srv HeavymockImporterServer)

Types

type HeavymockImporterClient

type HeavymockImporterClient interface {
	Import(ctx context.Context, opts ...grpc.CallOption) (HeavymockImporter_ImportClient, error)
}

HeavymockImporterClient is the client API for HeavymockImporter service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewHeavymockImporterClient

func NewHeavymockImporterClient(cc *grpc.ClientConn) HeavymockImporterClient

type HeavymockImporterServer

type HeavymockImporterServer interface {
	Import(HeavymockImporter_ImportServer) error
}

HeavymockImporterServer is the server API for HeavymockImporter service.

type HeavymockImporter_ImportClient

type HeavymockImporter_ImportClient interface {
	Send(*exporter.Record) error
	CloseAndRecv() (*Ok, error)
	grpc.ClientStream
}

type HeavymockImporter_ImportServer

type HeavymockImporter_ImportServer interface {
	SendAndClose(*Ok) error
	Recv() (*exporter.Record, error)
	grpc.ServerStream
}

type ImporterServer

type ImporterServer struct {
	// contains filtered or unexported fields
}

func NewHeavymockImporter

func NewHeavymockImporter() *ImporterServer

func (*ImporterServer) GetLowestUnsentPulse

func (s *ImporterServer) GetLowestUnsentPulse() (insolar.PulseNumber, []exporter.JetDropContinue)

func (*ImporterServer) GetUnsentRecords

func (s *ImporterServer) GetUnsentRecords() []*exporter.Record

func (*ImporterServer) Import

func (*ImporterServer) MarkAsSent

func (s *ImporterServer) MarkAsSent(records []*exporter.Record)

type Ok

type Ok struct {
	Ok bool `protobuf:"varint,1,opt,name=ok,proto3" json:"ok,omitempty"`
}

func (*Ok) Descriptor

func (*Ok) Descriptor() ([]byte, []int)

func (*Ok) Equal

func (this *Ok) Equal(that interface{}) bool

func (*Ok) GetOk

func (m *Ok) GetOk() bool

func (*Ok) GoString

func (this *Ok) GoString() string

func (*Ok) Marshal

func (m *Ok) Marshal() (dAtA []byte, err error)

func (*Ok) MarshalTo

func (m *Ok) MarshalTo(dAtA []byte) (int, error)

func (*Ok) ProtoMessage

func (*Ok) ProtoMessage()

func (*Ok) Reset

func (m *Ok) Reset()

func (*Ok) Size

func (m *Ok) Size() (n int)

func (*Ok) String

func (this *Ok) String() string

func (*Ok) Unmarshal

func (m *Ok) Unmarshal(dAtA []byte) error

func (*Ok) XXX_DiscardUnknown

func (m *Ok) XXX_DiscardUnknown()

func (*Ok) XXX_Marshal

func (m *Ok) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Ok) XXX_Merge

func (m *Ok) XXX_Merge(src proto.Message)

func (*Ok) XXX_Size

func (m *Ok) XXX_Size() int

func (*Ok) XXX_Unmarshal

func (m *Ok) XXX_Unmarshal(b []byte) error

type RecordExporter

type RecordExporter struct {
	// contains filtered or unexported fields
}

func NewRecordExporter

func NewRecordExporter(importerServer *ImporterServer) *RecordExporter

func (*RecordExporter) Export

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL