Documentation ¶
Index ¶
Constants ¶
const ( // Aka BO DomainConf = iota // Aka POS DomainOps )
Domain values
const DefaultPart = 0
DefaultPart denotes default part of the record
Variables ¶
var ErrFilteringByOnlyPartsIsProhibited = errors.New("Filtering by only parts is prohibited")
ErrFilteringByOnlyPartsIsProhibited s.e.
var Get func(ctx context.Context, workspaceID int64, recordType int32, IDs []int64, partTypes []int32) (res <-chan Record, perr *error)
Get returns channel for records with given workspaceID and recordType - res buffer length must be zero - res must be sorted by ID, PartType - If IDs is not empty result is filtered by IDs - If IDs is not empty and partTypes is not empty result is filtered by IDs and partTypes - Get must analyze ctx.Err AFTER each write to channel - *perr will be valid when chan is closed - `Get` is intended for fast reading, Cassandra implementation must use CL=1 - ErrFilteringByOnlyPartsIsProhibited must be returned if len(partTypes) > 0 && len(IDs) == 0
var GetEvents func(ctx context.Context, LogID int64, offset1From, offset1To int64) (res <-chan Event, perr *error)
GetEvents between offset1From and offset1To (offset1To INCLUDED into result) Must analyze ctx.Err AFTER each write to channel
Put puts records in transaction
PutEvents batch of events Transaction is not needed (so only some records can be written) Offset1 MUST monotonically increase If it is not GetEvents may stop on first missed number
Functions ¶
Types ¶
type Event ¶ added in v0.12.0
type Event struct { Offset1 int64 Offset2 int64 WSID int64 Domain int32 Type int32 OriginDeviceID int64 OriginTimestamp int64 OriginOffset int64 MyTimestamp int64 Data []byte MetaData []byte }
Event s.e.
type Record ¶
type Record struct { RecordType int32 ID int64 DocType int32 DocID int64 ParentType int32 ParentID int64 PartType int32 PartID int64 // Offset of the event which affected the value Offset int64 // 0-deleted, 1-active, 2-closed State int32 // Data Value []byte }
Record used by Put