Documentation ¶
Index ¶
- Constants
- Variables
- func NewKvStreamSender(s MsgSender) *kvStreamSender
- func NewMsgReceiver(stream ImmuServiceReceiver_Stream) *msgReceiver
- func NewMsgSender(s ImmuServiceSender_Stream, bs int) *msgSender
- func NewVEntryStreamSender(s MsgSender) *vEntryStreamSender
- func NewZStreamReceiver(s io.Reader, bs int) *zStreamReceiver
- func NewZStreamSender(s MsgSender) *zStreamSender
- func NumberFromBytes(bs []byte, n interface{}) error
- func NumberToBytes(n interface{}) ([]byte, error)
- func ParseVerifiableEntry(entryWithoutValueProto []byte, verifiableTxProto []byte, ...) (*schema.VerifiableEntry, error)
- func ParseZEntry(set []byte, key []byte, score float64, atTx uint64, vr io.Reader, ...) (*schema.ZEntry, error)
- func ReadValue(vr io.Reader, bufferSize int) (value []byte, err error)
- type ExecAllRequest
- type ExecAllStreamReceiver
- type ExecAllStreamSender
- type ImmuServiceReceiver_Stream
- type ImmuServiceSender_Stream
- type IsOp_Operation
- type KeyValue
- type KvStreamReceiver
- type KvStreamSender
- type MsgReceiver
- type MsgSender
- type Op
- type Op_KeyValue
- type Op_Ref
- type Op_ZAdd
- type ServiceFactory
- type VEntryStreamReceiver
- type VEntryStreamSender
- type ValueSize
- type VerifiableEntry
- type ZEntry
- type ZStreamReceiver
- type ZStreamSender
Constants ¶
const ( TOp_Kv byte = 1 << iota TOp_ZAdd TOp_Ref )
const DefaultChunkSize int = 64 * 1024 // 64 * 1024 64 KiB
const MaxTxValueLen int = 1 << 25 // 32Mb
const MinChunkSize int = 4096
Variables ¶
var ErrChunkTooSmall = fmt.Sprintf("minimum chunk size is %d", MinChunkSize)
var ErrMaxTxValuesLenExceeded = "max transaction values length exceeded"
var ErrMaxValueLenExceeded = "internal store max value length exceeded"
var ErrMessageLengthIsZero = "message trailer length is declared equal to zero"
var ErrMissingExpectedData = "expected data on stream is missing"
var ErrNotEnoughDataOnStream = "not enough data to build the expected message. check value length declaration"
var ErrReaderIsEmpty = "reader contains no data"
var ErrRefOptNotImplemented = "reference operation is not implemented"
var ErrUnableToReassembleExecAllMessage = "unable to reassemble ZAdd message on a streamExecAll"
var ProveSinceTxFakeKey = []byte("ProveSinceTx")
Functions ¶
func NewKvStreamSender ¶
func NewKvStreamSender(s MsgSender) *kvStreamSender
NewKvStreamSender returns a new kvStreamSender
func NewMsgReceiver ¶
func NewMsgReceiver(stream ImmuServiceReceiver_Stream) *msgReceiver
NewMsgReceiver returns a NewMsgReceiver reader
func NewMsgSender ¶
func NewMsgSender(s ImmuServiceSender_Stream, bs int) *msgSender
NewMsgSender returns a NewMsgSender. It can be used on server side or client side to send a message on a stream.
func NewVEntryStreamSender ¶
func NewVEntryStreamSender(s MsgSender) *vEntryStreamSender
func NewZStreamReceiver ¶
NewZStreamReceiver ...
func ParseVerifiableEntry ¶
func ParseVerifiableEntry( entryWithoutValueProto []byte, verifiableTxProto []byte, inclusionProofProto []byte, vr io.Reader, chunkSize int, ) (*schema.VerifiableEntry, error)
ParseVerifiableEntry ...
Types ¶
type ExecAllRequest ¶
type ExecAllRequest struct {
Operations []*Op
}
type ExecAllStreamReceiver ¶
type ExecAllStreamReceiver interface {
Next() (IsOp_Operation, error)
}
func NewExecAllStreamReceiver ¶
func NewExecAllStreamReceiver(s io.Reader, bs int) ExecAllStreamReceiver
NewExecAllStreamReceiver returns a new execAllStreamReceiver
type ExecAllStreamSender ¶
type ExecAllStreamSender interface {
Send(req *ExecAllRequest) error
}
func NewExecAllStreamSender ¶
func NewExecAllStreamSender(s MsgSender) ExecAllStreamSender
NewExecAllStreamSender returns a new ExecAllStreamSender
type ImmuServiceReceiver_Stream ¶
ImmuServiceReceiver_Stream is used to inject schema.ImmuService_StreamGetClient, schema.ImmuService_StreamGetClient, schema.ImmuService_StreamHistoryClient and similar inside both client and server receivers
type ImmuServiceSender_Stream ¶
type ImmuServiceSender_Stream interface { Send(*schema.Chunk) error RecvMsg(m interface{}) error // used to retrieve server side errors }
ImmuServiceSender_Stream is used to inject schema.ImmuService_StreamGetServer, schema.ImmuService_StreamZScanServer inside both client and server senders
type IsOp_Operation ¶
type IsOp_Operation interface {
// contains filtered or unexported methods
}
type KvStreamReceiver ¶
func NewKvStreamReceiver ¶
func NewKvStreamReceiver(s io.Reader, bs int) KvStreamReceiver
NewKvStreamReceiver returns a new kvStreamReceiver
type KvStreamSender ¶
type MsgReceiver ¶
type Op ¶
type Op struct {
Operation IsOp_Operation
}
type Op_KeyValue ¶
type Op_KeyValue struct {
KeyValue *KeyValue
}
type Op_ZAdd ¶
type Op_ZAdd struct {
ZAdd *schema.ZAddRequest
}
type ServiceFactory ¶
type ServiceFactory interface { NewMsgReceiver(str ImmuServiceReceiver_Stream) MsgReceiver NewMsgSender(str ImmuServiceSender_Stream) MsgSender NewKvStreamReceiver(str MsgReceiver) KvStreamReceiver NewKvStreamSender(str MsgSender) KvStreamSender NewVEntryStreamReceiver(str MsgReceiver) VEntryStreamReceiver NewVEntryStreamSender(str MsgSender) VEntryStreamSender NewZStreamReceiver(str MsgReceiver) ZStreamReceiver NewZStreamSender(str MsgSender) ZStreamSender NewExecAllStreamSender(str MsgSender) ExecAllStreamSender NewExecAllStreamReceiver(str MsgReceiver) ExecAllStreamReceiver }
ServiceFactory returns high level immudb streaming services High level services are capable to receive and send immudb transportation objects. Those services rely on internal more generic receiver and sender services.
func NewStreamServiceFactory ¶
func NewStreamServiceFactory(chunkSize int) ServiceFactory
NewStreamServiceFactory returns a new ServiceFactory
type VEntryStreamReceiver ¶
VEntryStreamReceiver ...
func NewVEntryStreamReceiver ¶
func NewVEntryStreamReceiver(s io.Reader, bs int) VEntryStreamReceiver
NewVEntryStreamReceiver ...
type VEntryStreamSender ¶
type VEntryStreamSender interface {
Send(ve *VerifiableEntry) error
}
VEntryStreamSender ...
type VerifiableEntry ¶
type ZStreamReceiver ¶
ZStreamReceiver ...