github.com/ydb-platform/ydb-go-sdk/v3@v3.57.0/internal/topic/topicreaderinternal/public_callbacks.go (about) 1 package topicreaderinternal 2 3 import ( 4 "context" 5 6 "github.com/ydb-platform/ydb-go-sdk/v3/internal/grpcwrapper/rawtopic/rawtopicreader" 7 ) 8 9 // PublicGetPartitionStartOffsetResponse allow to set start offset for read messages for the partition 10 type PublicGetPartitionStartOffsetResponse struct { 11 startOffset rawtopicreader.Offset 12 startOffsetUsed bool 13 } 14 15 // StartFrom set start offset for read the partition 16 func (r *PublicGetPartitionStartOffsetResponse) StartFrom(offset int64) { 17 r.startOffset.FromInt64(offset) 18 r.startOffsetUsed = true 19 } 20 21 // PublicGetPartitionStartOffsetRequest info about partition 22 type PublicGetPartitionStartOffsetRequest struct { 23 Topic string 24 PartitionID int64 25 } 26 27 // PublicGetPartitionStartOffsetFunc callback function for optional manage read progress store at own side 28 type PublicGetPartitionStartOffsetFunc func( 29 ctx context.Context, 30 req PublicGetPartitionStartOffsetRequest, 31 ) (res PublicGetPartitionStartOffsetResponse, err error)